From bbfb5f244a374f228a076e6b22e20cfa572836b9 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Wed, 20 Oct 2004 12:56:49 +0200 Subject: [PATCH] the test moved from range.test to innodb.test - it should not be run when innodb is disabled --- mysql-test/r/innodb.result | 34 ++++++++++++++++++++++++++++++++++ mysql-test/r/range.result | 35 ----------------------------------- mysql-test/t/innodb.test | 22 ++++++++++++++++++++++ mysql-test/t/range.test | 19 ------------------- 4 files changed, 56 insertions(+), 54 deletions(-) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index bb18fe9eef0..40767a40b82 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1630,3 +1630,37 @@ show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 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; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 4c6caf2d23b..f0f5cef30a0 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -537,38 +537,3 @@ select count(*) from t2 where x = 18446744073709551601; count(*) 0 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; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index e2e0afce6e6..f9b1de44b81 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1155,5 +1155,27 @@ delete from t1; commit; show status like "binlog_cache_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; + diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 7a86c0cef1d..52a1a457908 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -414,23 +414,4 @@ select count(*) from t2 where x > -16; select count(*) from t2 where x = 18446744073709551601; 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;