summaryrefslogtreecommitdiff
path: root/mysql-test/t/range.test
diff options
context:
space:
mode:
authorsergefp@mysql.com <>2005-04-17 02:05:09 +0400
committersergefp@mysql.com <>2005-04-17 02:05:09 +0400
commit2ef1963c9142e98f638c07ccdbe3e131868c90e8 (patch)
treef12dadf57dcd02f4e4ec56fee2c1eaa645fa3ece /mysql-test/t/range.test
parent2b322f36d8e458927845e81e6585a61e8dfff038 (diff)
downloadmariadb-git-2ef1963c9142e98f638c07ccdbe3e131868c90e8.tar.gz
Fix for BUG#9348: when computing union of two intervals set lower bound to
minimum of lower bounds of two joined intervals.
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r--mysql-test/t/range.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 44f55da5722..3d3d4748fe3 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -445,3 +445,24 @@ explain select * from t1 where a=binary 'aaa';
explain select * from t1 where a='aaa' collate latin1_bin;
# this one cannot:
explain select * from t1 where a='aaa' collate latin1_german1_ci;
+drop table t1;
+
+# Test for BUG#9348 "result for WHERE A AND (B OR C) differs from WHERE a AND (C OR B)"
+CREATE TABLE t1 (
+ `CLIENT` char(3) character set latin1 collate latin1_bin NOT NULL default '000',
+ `ARG1` char(3) character set latin1 collate latin1_bin NOT NULL default '',
+ `ARG2` char(3) character set latin1 collate latin1_bin NOT NULL default '',
+ `FUNCTION` varchar(10) character set latin1 collate latin1_bin NOT NULL default '',
+ `FUNCTINT` int(11) NOT NULL default '0',
+ KEY `VERI_CLNT~2` (`ARG1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+INSERT INTO t1 VALUES ('000',' 0',' 0','Text 001',0), ('000',' 0',' 1','Text 002',0),
+ ('000',' 1',' 2','Text 003',0), ('000',' 2',' 3','Text 004',0),
+ ('001',' 3',' 0','Text 017',0);
+
+SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 1' OR ARG1 != ' 2');
+
+SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1');
+drop table t1;
+