List:Internals« Previous MessageNext Message »
From:Sergey Petrunia Date:April 17 2005 12:05am
Subject:bk commit into 4.1 tree (sergefp:1.2193) BUG#9348
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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.2193 05/04/17 02:05:09 sergefp@stripped +3 -0
  Fix for BUG#9348: when computing union of two intervals set lower bound to 
  minimum of lower bounds of two joined intervals.

  sql/opt_range.cc
    1.133 05/04/17 02:05:06 sergefp@stripped +1 -0
    Fix for BUG#9348: when computing union of two intervals set lower bound to 
    minimum of lower bounds of two joined intervals.

  mysql-test/t/range.test
    1.24 05/04/17 02:05:06 sergefp@stripped +21 -0
    Testcase for BUG#9348

  mysql-test/r/range.result
    1.33 05/04/17 02:05:06 sergefp@stripped +19 -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-4.1-look-range

--- 1.132/sql/opt_range.cc	2004-11-08 02:13:49 +03:00
+++ 1.133/sql/opt_range.cc	2005-04-17 02:05:06 +04:00
@@ -1683,6 +1683,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.32/mysql-test/r/range.result	2004-11-22 16:53:12 +03:00
+++ 1.33/mysql-test/r/range.result	2005-04-17 02:05:06 +04:00
@@ -577,3 +577,22 @@
 explain select * from t1 where a='aaa' collate latin1_german1_ci;
 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.23/mysql-test/t/range.test	2004-11-03 14:21:48 +03:00
+++ 1.24/mysql-test/t/range.test	2005-04-17 02:05:06 +04:00
@@ -445,3 +445,24 @@
 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;
+
Thread
bk commit into 4.1 tree (sergefp:1.2193) BUG#9348Sergey Petrunia17 Apr