At file:///home/psergey/dev/mysql-next-fix-subq/

------------------------------------------------------------
revno: 2819
revision-id: [email protected]
parent: [email protected]
committer: Sergey Petrunya <[email protected]>
branch nick: mysql-next-fix-subq
timestamp: Wed 2009-07-08 21:47:03 +0400
message:
  BUG#31480: Incorrect result for nested subquery when executed via semi join
  Make the fix work with prepared statements:
  - in previous cset changed calloc to alloc, forgot to add bzero.
=== modified file 'sql/item_subselect.cc'
--- a/sql/item_subselect.cc     2009-07-08 09:53:41 +0000
+++ b/sql/item_subselect.cc     2009-07-08 17:47:03 +0000
@@ -180,10 +180,11 @@
   if (!ancestor_used_tables)
   {
     set_depth();
-    if (!(ancestor_used_tables= 
-          (table_map*)alloc_root(thd->stmt_arena->mem_root, 
-                                 (1+depth)*sizeof(table_map))))
+    size_t size= (1+depth) * sizeof(table_map); 
+    if (!(ancestor_used_tables= (table_map*)
+                                alloc_root(thd->stmt_arena->mem_root, size)))
       return TRUE;
+    bzero(ancestor_used_tables, size);
     furthest_correlated_ancestor= 0;
     inside_first_fix_fields= TRUE;
   }
@@ -258,7 +259,7 @@
     is_correlated= TRUE;
     furthest_correlated_ancestor= max(furthest_correlated_ancestor, n_levels);
     if (n_levels > 1)
-      ancestor_used_tables[n_levels - 2]= dep_map;
+      ancestor_used_tables[n_levels - 2] |= dep_map;
   }
 }
 


_______________________________________________
Mailing list: https://launchpad.net/~maria-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to