Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions mysql-test/suite/tianmu/r/signed_boundary.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Test signed boundary
#
DROP DATABASE IF EXISTS signed_boundary;
CREATE DATABASE signed_boundary;
USE signed_boundary;
CREATE TABLE int32_(c_max int, c_min int) engine = tianmu;
INSERT INTO int32_ values(-2147483647, 2147483647);
INSERT INTO int32_ values(-2147483648, 2147483647);
Expand All @@ -16,3 +18,47 @@ ERROR 22003: Out of range[-9223372036854775807, 9223372036854775807] for column
INSERT INTO int64_ values(-9223372036854775806, 9223372036854775808);
ERROR 22003: Out of range value for column 'c_min' at row 1
DROP TABLE int64_;
create table t1 (
value64 bigint not null,
value32 integer not null
);
insert into t1 values(9223372036854775806, 1);
insert into t1 values(9223372036854775807, 2);
insert into t1 values(-9223372036854775806, 2);
select * from t1;
value64 value32
9223372036854775806 1
9223372036854775807 2
-9223372036854775806 2
select * from t1 where value64= 9223372036854775807;
value64 value32
9223372036854775807 2
select * from t1 where value64= -9223372036854775806;
value64 value32
-9223372036854775806 2
select * from t1 where value64 between 9223372036854775806 and 9223372036854775807;
value64 value32
9223372036854775806 1
9223372036854775807 2
drop table t1;
create table txxx(a double);
insert into txxx values(1.79769313486231570814527423731704357e+308);
insert into txxx values(-1.79769313486231570814527423731704357e+308);
select * from txxx;
a
1.7976931348623157e308
-1.7976931348623157e308
select * from txxx where a = -1.7976931348623157e308;
a
-1.7976931348623157e308
select * from txxx where a = 1.7976931348623157e308;
a
1.7976931348623157e308
select * from txxx where a between 1.7976931348623157e308 and 1.7976931348623157e308;
a
1.7976931348623157e308
select * from txxx where a between -1.7976931348623157e308 and -1.7976931348623157e308;
a
-1.7976931348623157e308
drop table txxx;
DROP DATABASE signed_boundary;
29 changes: 29 additions & 0 deletions mysql-test/suite/tianmu/t/signed_boundary.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
DROP DATABASE IF EXISTS signed_boundary;
--enable_warnings

CREATE DATABASE signed_boundary;
USE signed_boundary;
# int32 limit
CREATE TABLE int32_(c_max int, c_min int) engine = tianmu;
INSERT INTO int32_ values(-2147483647, 2147483647);
Expand All @@ -25,3 +27,30 @@ INSERT INTO int64_ values(-9223372036854775807, 9223372036854775807);
--error 1264
INSERT INTO int64_ values(-9223372036854775806, 9223372036854775808);
DROP TABLE int64_;

# fix issue #1344, select * from t where col = 9223372036854775807,1.797693134862315708e+308, -1.797693134862315708e+308
create table t1 (
value64 bigint not null,
value32 integer not null
);

insert into t1 values(9223372036854775806, 1);
insert into t1 values(9223372036854775807, 2);
insert into t1 values(-9223372036854775806, 2);
select * from t1;
select * from t1 where value64= 9223372036854775807;
select * from t1 where value64= -9223372036854775806;
select * from t1 where value64 between 9223372036854775806 and 9223372036854775807;
drop table t1;

create table txxx(a double);
insert into txxx values(1.79769313486231570814527423731704357e+308);
insert into txxx values(-1.79769313486231570814527423731704357e+308);
select * from txxx;
select * from txxx where a = -1.7976931348623157e308;
select * from txxx where a = 1.7976931348623157e308;
select * from txxx where a between 1.7976931348623157e308 and 1.7976931348623157e308;
select * from txxx where a between -1.7976931348623157e308 and -1.7976931348623157e308;
drop table txxx;

DROP DATABASE signed_boundary;
Loading