[Commits] Rev 4478: MDEV-6785 Wrong result on 2nd execution of PS with aggregate function, FROM SQ or MERGE view in lp:~maria-captains/maria/10.0

Sergei Golubchik serg at mariadb.org
Thu Nov 13 13:59:02 EET 2014


At lp:~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4478
revision-id: sergii at pisem.net-20141113115901-qwfor6fspova0ikt
parent: sergii at pisem.net-20141112184336-4ge700t4xww1e1au
fixes bug: https://mariadb.atlassian.net/browse/MDEV-6785
committer: Sergei Golubchik <sergii at pisem.net>
branch nick: 10.0
timestamp: Thu 2014-11-13 12:59:01 +0100
message:
  MDEV-6785 Wrong result on 2nd execution of PS with aggregate function, FROM SQ or MERGE view
  
  a different patch for view.test --ps-protocol crash
=== modified file 'sql/sql_derived.cc'
--- a/sql/sql_derived.cc	2014-09-30 17:31:14 +0000
+++ b/sql/sql_derived.cc	2014-11-13 11:59:01 +0000
@@ -465,8 +465,6 @@ bool mysql_derived_merge(THD *thd, LEX *
     }
   }
 
-  if (!derived->merged_for_insert)
-    dt_select->first_cond_optimization= FALSE; // consider it optimized
 exit_merge:
   if (arena)
     thd->restore_active_arena(arena, &backup);

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2014-11-03 16:47:37 +0000
+++ b/sql/sql_select.cc	2014-11-13 11:59:01 +0000
@@ -633,7 +633,7 @@ inline int setup_without_group(THD *thd,
   res= setup_conds(thd, tables, leaves, conds);
   if (thd->lex->current_select->first_cond_optimization)
   {
-    if (!res && *conds)
+    if (!res && *conds && ! thd->lex->current_select->merged_into)
       (*reserved)= (*conds)->exists2in_reserved_items();
     else
       (*reserved)= 0;



More information about the commits mailing list