MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:holyfoot Date:December 3 2006 5:49pm
Subject:bk commit into 5.1 tree (holyfoot:1.2380) BUG#20835
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of hf. When hf 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@stripped, 2006-12-03 21:49:26+04:00, holyfoot@stripped +3 -0
  bug #20835 (Subqueries: literal string with =any fails)
  We create Item_cache_* object for each operand for each left operand of
  a subquery predicate. We also create Item_func_conv_charset for each string
  constant that needs charset conversion. So here we have Item_cache wrapped
  into Item_func_conv_charset.
  When Item_func_conv_charset wraps an constant Item it gets it's value
  in constructor. The problem is that Item_cache is ready to be used only
  at execution time, which is too late.
  The fix makes Item_cache wrapping constant to get ready at fix_fields() time.

  mysql-test/r/subselect.result@stripped, 2006-12-03 21:49:21+04:00, holyfoot@stripped +6 -0
    test result

  mysql-test/t/subselect.test@stripped, 2006-12-03 21:49:21+04:00, holyfoot@stripped +8 -0
    test case

  sql/item_cmpfunc.cc@stripped, 2006-12-03 21:49:21+04:00, holyfoot@stripped +2 -1
    now Item_optimizer::fix_left will store constant arguments in cache
    on fix_fields() stage

# 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:	holyfoot
# Host:	deer.(none)
# Root:	/home/hf/work/mysql-5.1.20835

--- 1.227/sql/item_cmpfunc.cc	2006-12-03 21:49:34 +04:00
+++ 1.228/sql/item_cmpfunc.cc	2006-12-03 21:49:34 +04:00
@@ -797,7 +797,8 @@ bool Item_in_optimizer::fix_left(THD *th
   }
   not_null_tables_cache= args[0]->not_null_tables();
   with_sum_func= args[0]->with_sum_func;
-  const_item_cache= args[0]->const_item();
+  if ((const_item_cache= args[0]->const_item()))
+    cache->store(args[0]);
   return 0;
 }
 

--- 1.158/mysql-test/r/subselect.result	2006-12-03 21:49:34 +04:00
+++ 1.159/mysql-test/r/subselect.result	2006-12-03 21:49:34 +04:00
@@ -3592,3 +3592,9 @@ FROM t1) t;
 COUNT(*)
 3000
 DROP TABLE t1,t2;
+CREATE TABLE t1 (s1 char(1));
+INSERT INTO t1 VALUES ('a');
+SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
+s1
+a
+DROP TABLE t1;

--- 1.136/mysql-test/t/subselect.test	2006-12-03 21:49:34 +04:00
+++ 1.137/mysql-test/t/subselect.test	2006-12-03 21:49:34 +04:00
@@ -2496,3 +2496,11 @@ SELECT SQL_NO_CACHE COUNT(*) 
           FROM t1) t;
 
 DROP TABLE t1,t2;
+
+#
+# Bug#20835 (literal string with =any values)
+#
+CREATE TABLE t1 (s1 char(1));
+INSERT INTO t1 VALUES ('a');
+SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
+DROP TABLE t1;
Thread
bk commit into 5.1 tree (holyfoot:1.2380) BUG#20835holyfoot3 Dec