summaryrefslogtreecommitdiff
path: root/mysql-test/t/range.test
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2004-08-11 23:08:20 +0400
committerunknown <sergefp@mysql.com>2004-08-11 23:08:20 +0400
commitb37a73611024d78de35145c5f6cb394a7c3f225c (patch)
tree4773c593bb7d7e615217ae75cc62fdda42923650 /mysql-test/t/range.test
parentcffa34d9fba41ca853e7f11c88e5962382b6219c (diff)
downloadmariadb-git-b37a73611024d78de35145c5f6cb394a7c3f225c.tar.gz
Fix for BUG#4488: first portion: sign aware '<' and '>' comparisons.
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r--mysql-test/t/range.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 471af8e4a5b..b171f5f98e7 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -383,3 +383,42 @@ select * from t1, t2 where t1.uid=t2.uid AND t1.uid > 0;
select * from t1, t2 where t1.uid=t2.uid AND t1.uid != 0;
drop table t1,t2;
+
+# Fix for bug#4488
+#
+create table t1 (x bigint unsigned not null);
+insert into t1(x) values (0xfffffffffffffff0);
+insert into t1(x) values (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;
+select count(*) from t1 where x > -16;
+
+create table t2 (x bigint not null);
+insert into t2(x) values (0xfffffffffffffff0);
+insert into t2(x) values (0xfffffffffffffff1);
+select * from t2;
+select count(*) from t2 where x>0;
+select count(*) from t2 where x=0;
+select count(*) from t2 where x<0;
+select count(*) from t2 where x < -16;
+select count(*) from t2 where x = -16;
+select count(*) from t2 where x > -16;
+
+drop table t1;
+create table t1 (x bigint unsigned not null primary key) engine=innodb;
+insert into t1(x) values (0xfffffffffffffff0);
+insert into t1(x) values (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;
+select count(*) from t1 where x > -16;
+
+drop table t1;
+