Below is the list of changes that have just been committed into a local
5.0 repository of psergey. When psergey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1827 05/04/16 12:14:33 sergefp@stripped +3 -0
Fix for BUG#9348.
sql/opt_range.cc
1.151 05/04/16 12:14:28 sergefp@stripped +1 -0
Fix for BUG#9348: when computing union of two intervals set lower bound to minimum
left bound
mysql-test/t/range.test
1.23 05/04/16 12:14:28 sergefp@stripped +20 -0
Testcase for BUG#9348
mysql-test/r/range.result
1.31 05/04/16 12:14:28 sergefp@stripped +18 -0
Testcase for BUG#9348
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: sergefp
# Host: newbox.mylan
# Root: /home/psergey/mysql-5.0-bug9348-look2
--- 1.150/sql/opt_range.cc 2005-04-05 15:17:40 +04:00
+++ 1.151/sql/opt_range.cc 2005-04-16 12:14:28 +04:00
@@ -4371,6 +4371,7 @@
last=last->next;
key1=key1->tree_delete(save);
}
+ last->copy_min(tmp);
if (last->copy_min(key2) || last->copy_max(key2))
{ // Full range
key1->free_tree();
--- 1.30/mysql-test/r/range.result 2005-04-12 14:04:38 +04:00
+++ 1.31/mysql-test/r/range.result 2005-04-16 12:14:28 +04:00
@@ -566,3 +566,21 @@
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where
drop table t1;
+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');
+count(*)
+4
+SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1');
+count(*)
+4
+drop table t1;
--- 1.22/mysql-test/t/range.test 2005-04-12 14:04:38 +04:00
+++ 1.23/mysql-test/t/range.test 2005-04-16 12:14:28 +04:00
@@ -433,3 +433,23 @@
# 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;
+
| Thread |
|---|
| • bk commit into 5.0 tree (sergefp:1.1827) BUG#9348 | Sergey Petrunia | 16 Apr |