Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a53b50d0
Commit
a53b50d0
authored
Jan 19, 2007
by
mtaylor@qualinost.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into qualinost.(none):/home/mtaylor/src/mysql-4.1-maint
parents
fd75030f
6e915574
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
11 deletions
+52
-11
mysql-test/r/range.result
mysql-test/r/range.result
+2
-2
mysql-test/r/select.result
mysql-test/r/select.result
+17
-0
mysql-test/t/range.test
mysql-test/t/range.test
+2
-2
mysql-test/t/select.test
mysql-test/t/select.test
+12
-1
sql/item.cc
sql/item.cc
+19
-6
No files found.
mysql-test/r/range.result
View file @
a53b50d0
...
...
@@ -504,8 +504,8 @@ select count(*) from t1 where x = 18446744073709551601;
count(*)
1
create table t2 (x bigint not null);
insert into t2(x) values (
0xfffffffffffffff0
);
insert into t2(x) values (
0xfffffffffffffff1
);
insert into t2(x) values (
-16
);
insert into t2(x) values (
-15
);
select * from t2;
x
-16
...
...
mysql-test/r/select.result
View file @
a53b50d0
...
...
@@ -2819,3 +2819,20 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
0.37619999051094
DROP TABLE t1,t2;
create table t1(a bigint unsigned, b bigint);
insert into t1 values (0xfffffffffffffffff, 0xfffffffffffffffff),
(0x10000000000000000, 0x10000000000000000),
(0x8fffffffffffffff, 0x8fffffffffffffff);
Warnings:
Warning 1264 Data truncated; out of range for column 'a' at row 1
Warning 1264 Data truncated; out of range for column 'b' at row 1
Warning 1264 Data truncated; out of range for column 'a' at row 2
Warning 1264 Data truncated; out of range for column 'b' at row 2
Warning 1264 Data truncated; out of range for column 'b' at row 3
select hex(a), hex(b) from t1;
hex(a) hex(b)
FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
8FFFFFFFFFFFFFFF 7FFFFFFFFFFFFFFF
drop table t1;
End of 4.1 tests
mysql-test/t/range.test
View file @
a53b50d0
...
...
@@ -400,8 +400,8 @@ select count(*) from t1 where x = 18446744073709551601;
create
table
t2
(
x
bigint
not
null
);
insert
into
t2
(
x
)
values
(
0xfffffffffffffff0
);
insert
into
t2
(
x
)
values
(
0xfffffffffffffff1
);
insert
into
t2
(
x
)
values
(
-
16
);
insert
into
t2
(
x
)
values
(
-
15
);
select
*
from
t2
;
select
count
(
*
)
from
t2
where
x
>
0
;
select
count
(
*
)
from
t2
where
x
=
0
;
...
...
mysql-test/t/select.test
View file @
a53b50d0
...
...
@@ -2342,4 +2342,15 @@ select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
DROP
TABLE
t1
,
t2
;
--
enable_ps_protocol
# End of 4.1 tests
#
# Bug #22533: storing large hex strings
#
create
table
t1
(
a
bigint
unsigned
,
b
bigint
);
insert
into
t1
values
(
0xfffffffffffffffff
,
0xfffffffffffffffff
),
(
0x10000000000000000
,
0x10000000000000000
),
(
0x8fffffffffffffff
,
0x8fffffffffffffff
);
select
hex
(
a
),
hex
(
b
)
from
t1
;
drop
table
t1
;
--
echo
End
of
4.1
tests
sql/item.cc
View file @
a53b50d0
...
...
@@ -2369,18 +2369,31 @@ longlong Item_varbinary::val_int()
int
Item_varbinary
::
save_in_field
(
Field
*
field
,
bool
no_conversions
)
{
int
error
;
field
->
set_notnull
();
if
(
field
->
result_type
()
==
STRING_RESULT
)
return
field
->
store
(
str_value
.
ptr
(),
str_value
.
length
(),
collation
.
collation
);
ulonglong
nr
;
uint32
length
=
str_value
.
length
();
if
(
length
>
8
)
{
error
=
field
->
store
(
str_value
.
ptr
(),
str_value
.
length
(),
collation
.
collation
);
nr
=
field
->
flags
&
UNSIGNED_FLAG
?
ULONGLONG_MAX
:
LONGLONG_MAX
;
goto
warn
;
}
else
nr
=
(
ulonglong
)
val_int
();
if
((
length
==
8
)
&&
!
(
field
->
flags
&
UNSIGNED_FLAG
)
&&
(
nr
>
LONGLONG_MAX
))
{
longlong
nr
=
val_int
()
;
error
=
field
->
store
(
nr
)
;
nr
=
LONGLONG_MAX
;
goto
warn
;
}
return
error
;
return
field
->
store
((
longlong
)
nr
);
warn:
if
(
!
field
->
store
((
longlong
)
nr
))
field
->
set_warning
(
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WARN_DATA_OUT_OF_RANGE
,
1
);
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment