List:Commits« Previous MessageNext Message »
From:Jan Wedvik Date:January 11 2011 11:48am
Subject:bzr push into mysql-5.1 branch (jan.wedvik:3539 to 3540) Bug#58553
View as plain text  
 3540 Jan Wedvik	2011-01-11
      Fix for bug#58553, "Queries with pushed conditions causes 'explain extended' 
      to crash mysqld". 
            
      handler::pushed_cond was not always properly reset when table objects where
      recycled via the table cache.
            
      handler::pushed_cond is now set to NULL in handler::ha_reset(). This should 
      prevent pushed conditions from (incorrectly) re-apperaring in later queries.

    modified:
      sql/handler.cc
      sql/sql_base.cc
      sql/sql_select.cc
 3539 Mattias Jonsson	2011-01-10 [merge]
      merge

    modified:
      mysql-test/r/partition.result
      mysql-test/r/partition_error.result
      mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc
      mysql-test/suite/parts/r/part_supported_sql_func_innodb.result
      mysql-test/suite/parts/r/part_supported_sql_func_myisam.result
      mysql-test/t/partition.test
      mysql-test/t/partition_error.test
      sql/item.h
      sql/item_func.h
      sql/item_timefunc.h
      sql/sql_partition.cc
      sql/table.cc
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2010-12-16 19:11:08 +0000
+++ b/sql/handler.cc	2011-01-11 11:09:54 +0000
@@ -4657,6 +4657,7 @@ int handler::ha_reset()
   free_io_cache(table);
   /* reset the bitmaps to point to defaults */
   table->default_column_bitmaps();
+  pushed_cond= NULL;
   DBUG_RETURN(reset());
 }
 

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2010-12-28 23:47:05 +0000
+++ b/sql/sql_base.cc	2011-01-11 11:09:54 +0000
@@ -2993,6 +2993,11 @@ TABLE *open_table(THD *thd, TABLE_LIST *
   table->insert_values= 0;
   table->fulltext_searched= 0;
   table->file->ft_handler= 0;
+  /*
+    Check that there is no reference to a condtion from an earlier query
+    (cf. Bug#58553). 
+  */
+  DBUG_ASSERT(table->file->pushed_cond == NULL);
   table->reginfo.impossible_range= 0;
   /* Catch wrong handling of the auto_increment_field_not_null. */
   DBUG_ASSERT(!table->auto_increment_field_not_null);

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-12-28 23:47:05 +0000
+++ b/sql/sql_select.cc	2011-01-11 11:09:54 +0000
@@ -6380,7 +6380,6 @@ make_join_select(JOIN *join,SQL_SELECT *
           tab->select_cond=sel->cond=tmp;
           /* Push condition to storage engine if this is enabled
              and the condition is not guarded */
-          tab->table->file->pushed_cond= NULL;
 	  if (thd->variables.engine_condition_pushdown)
           {
             COND *push_cond= 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1 branch (jan.wedvik:3539 to 3540) Bug#58553Jan Wedvik11 Jan