Merge with 4.0 to revert patch for BIGINT assignment to double
mysql-test/r/bigint.result: Auto merged mysql-test/t/bigint.test: Auto merged
This commit is contained in:
commit
ed63732bb3
@ -18,9 +18,11 @@ select -(0-3),round(-(0-3)), round(9999999999999999999);
|
|||||||
-(0-3) round(-(0-3)) round(9999999999999999999)
|
-(0-3) round(-(0-3)) round(9999999999999999999)
|
||||||
3 3 10000000000000000000
|
3 3 10000000000000000000
|
||||||
create table t1 (a bigint unsigned not null, primary key(a));
|
create table t1 (a bigint unsigned not null, primary key(a));
|
||||||
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
|
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
|
18446744073709551612
|
||||||
|
18446744073709551613
|
||||||
18446744073709551614
|
18446744073709551614
|
||||||
18446744073709551615
|
18446744073709551615
|
||||||
select * from t1 where a=18446744073709551615;
|
select * from t1 where a=18446744073709551615;
|
||||||
@ -29,6 +31,8 @@ a
|
|||||||
delete from t1 where a=18446744073709551615;
|
delete from t1 where a=18446744073709551615;
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a
|
a
|
||||||
|
18446744073709551612
|
||||||
|
18446744073709551613
|
||||||
18446744073709551614
|
18446744073709551614
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 ( a int not null default 1, big bigint );
|
create table t1 ( a int not null default 1, big bigint );
|
||||||
@ -72,9 +76,11 @@ id a
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 ( quantity decimal(60,0));
|
CREATE TABLE t1 ( quantity decimal(60,0));
|
||||||
insert into t1 values (10000000000000000000);
|
insert into t1 values (10000000000000000000);
|
||||||
|
insert into t1 values (10000000000000000000.0);
|
||||||
insert into t1 values ('10000000000000000000');
|
insert into t1 values ('10000000000000000000');
|
||||||
select * from t1;
|
select * from t1;
|
||||||
quantity
|
quantity
|
||||||
|
-8446744073709551616
|
||||||
10000000000000000000
|
10000000000000000000
|
||||||
10000000000000000000
|
10000000000000000000
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -22,7 +22,7 @@ select -(0-3),round(-(0-3)), round(9999999999999999999);
|
|||||||
#
|
#
|
||||||
|
|
||||||
create table t1 (a bigint unsigned not null, primary key(a));
|
create table t1 (a bigint unsigned not null, primary key(a));
|
||||||
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
|
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
|
||||||
select * from t1;
|
select * from t1;
|
||||||
select * from t1 where a=18446744073709551615;
|
select * from t1 where a=18446744073709551615;
|
||||||
# select * from t1 where a='18446744073709551615';
|
# select * from t1 where a='18446744073709551615';
|
||||||
@ -58,10 +58,12 @@ drop table t1;
|
|||||||
#
|
#
|
||||||
# Item_uint::save_to_field()
|
# Item_uint::save_to_field()
|
||||||
# BUG#1845
|
# BUG#1845
|
||||||
|
# This can't be fixed in MySQL 4.0 without loosing precisions for bigints
|
||||||
#
|
#
|
||||||
|
|
||||||
CREATE TABLE t1 ( quantity decimal(60,0));
|
CREATE TABLE t1 ( quantity decimal(60,0));
|
||||||
insert into t1 values (10000000000000000000);
|
insert into t1 values (10000000000000000000);
|
||||||
|
insert into t1 values (10000000000000000000.0);
|
||||||
insert into t1 values ('10000000000000000000');
|
insert into t1 values ('10000000000000000000');
|
||||||
select * from t1;
|
select * from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
16
sql/item.cc
16
sql/item.cc
@ -1192,17 +1192,11 @@ int Item_string::save_in_field(Field *field, bool no_conversions)
|
|||||||
|
|
||||||
int Item_uint::save_in_field(Field *field, bool no_conversions)
|
int Item_uint::save_in_field(Field *field, bool no_conversions)
|
||||||
{
|
{
|
||||||
longlong nr= val_int();
|
/*
|
||||||
int res;
|
TODO: To be fixed when wen have a
|
||||||
|
field->store(longlong, unsigned_flag) method
|
||||||
if (null_value)
|
*/
|
||||||
return set_field_to_null(field);
|
Item_int::save_in_field(field, no_conversions);
|
||||||
field->set_notnull();
|
|
||||||
if (nr < 0)
|
|
||||||
res= field->store(ulonglong2double(nr);
|
|
||||||
else
|
|
||||||
res= field->store(nr);
|
|
||||||
return res ? -1 : 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user