Commit bbfb5f24 authored by serg@serg.mylan's avatar serg@serg.mylan

the test moved from range.test to innodb.test - it should not be run when innodb is disabled

parent 0b7f26d7
...@@ -1630,3 +1630,37 @@ show status like "binlog_cache_disk_use"; ...@@ -1630,3 +1630,37 @@ show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
drop table t1; drop table t1;
create table t1 (x bigint unsigned not null primary key) engine=innodb;
insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
select * from t1;
x
18446744073709551600
18446744073709551601
select count(*) from t1 where x>0;
count(*)
2
select count(*) from t1 where x=0;
count(*)
0
select count(*) from t1 where x<0;
count(*)
0
select count(*) from t1 where x < -16;
count(*)
0
select count(*) from t1 where x = -16;
count(*)
0
explain select count(*) from t1 where x > -16;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 1 Using where; Using index
select count(*) from t1 where x > -16;
count(*)
1
select * from t1 where x > -16;
x
18446744073709551601
select count(*) from t1 where x = 18446744073709551601;
count(*)
1
drop table t1;
...@@ -537,38 +537,3 @@ select count(*) from t2 where x = 18446744073709551601; ...@@ -537,38 +537,3 @@ select count(*) from t2 where x = 18446744073709551601;
count(*) count(*)
0 0
drop table t1; drop table t1;
create table t1 (x bigint unsigned not null primary key) engine=innodb;
insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
select * from t1;
x
18446744073709551600
18446744073709551601
select count(*) from t1 where x>0;
count(*)
2
select count(*) from t1 where x=0;
count(*)
0
select count(*) from t1 where x<0;
count(*)
0
select count(*) from t1 where x < -16;
count(*)
0
select count(*) from t1 where x = -16;
count(*)
0
explain select count(*) from t1 where x > -16;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 2 Using where; Using index
select count(*) from t1 where x > -16;
count(*)
2
select * from t1 where x > -16;
x
18446744073709551600
18446744073709551601
select count(*) from t1 where x = 18446744073709551601;
count(*)
1
drop table t1;
...@@ -1155,5 +1155,27 @@ delete from t1; ...@@ -1155,5 +1155,27 @@ delete from t1;
commit; commit;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
drop table t1;
#
# range optimizer problem
#
create table t1 (x bigint unsigned not null primary key) engine=innodb;
insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
select * from t1;
select count(*) from t1 where x>0;
select count(*) from t1 where x=0;
select count(*) from t1 where x<0;
select count(*) from t1 where x < -16;
select count(*) from t1 where x = -16;
explain select count(*) from t1 where x > -16;
# The following result should be (2). To be fixed when we add 'unsigned flag' to
# Field::store(longlong)
select count(*) from t1 where x > -16;
select * from t1 where x > -16;
select count(*) from t1 where x = 18446744073709551601;
drop table t1; drop table t1;
...@@ -414,23 +414,4 @@ select count(*) from t2 where x > -16; ...@@ -414,23 +414,4 @@ select count(*) from t2 where x > -16;
select count(*) from t2 where x = 18446744073709551601; select count(*) from t2 where x = 18446744073709551601;
drop table t1; drop table t1;
--disable_warnings
create table t1 (x bigint unsigned not null primary key) engine=innodb;
--enable_warnings
insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
select * from t1;
select count(*) from t1 where x>0;
select count(*) from t1 where x=0;
select count(*) from t1 where x<0;
select count(*) from t1 where x < -16;
select count(*) from t1 where x = -16;
explain select count(*) from t1 where x > -16;
# The following result should be (2). To be fixed when we add 'unsigned flag' to
# Field::store(longlong)
select count(*) from t1 where x > -16;
select * from t1 where x > -16;
select count(*) from t1 where x = 18446744073709551601;
drop table t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment