List:Internals« Previous MessageNext Message »
From:gluh Date:April 5 2005 1:10pm
Subject:bk commit into 5.0 tree (gluh:1.1872) BUG#9383
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gluh. When gluh 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.1872 05/04/05 16:09:56 gluh@stripped +4 -0
  Fix for bug#9383: INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement
     restore original 'lex->query_tables' table list after
     processing of information schema table
     remove unnecessary operations

  sql/sql_show.cc
    1.234 05/04/05 16:09:51 gluh@stripped +2 -3
    Fix for bug#9383: INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement

  sql/sql_lex.h
    1.173 05/04/05 16:09:51 gluh@stripped +3 -2
    Fix for bug#9383: INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement

  mysql-test/t/ps.test
    1.34 05/04/05 16:09:51 gluh@stripped +21 -0
    Fix for bug#9383: INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement

  mysql-test/r/ps.result
    1.35 05/04/05 16:09:51 gluh@stripped +18 -0
    Fix for bug#9383: INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement

# 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:	gluh
# Host:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Bugs/mysql-5.0

--- 1.172/sql/sql_lex.h	Fri Apr  1 15:02:22 2005
+++ 1.173/sql/sql_lex.h	Tue Apr  5 16:09:51 2005
@@ -701,8 +701,9 @@
   TABLE_LIST *query_tables;	/* global list of all tables in this query */
   /*
     last element next_global of previous list (used only for list building
-    during parsing and VIEW processing. This pointer is not valid in
-    mysql_execute_command
+    during parsing and VIEW processing. This pointer could be invalid during
+    processing of information schema tables(see get_schema_tables_result
+    function)
   */
   TABLE_LIST **query_tables_last;
   TABLE_LIST *proc_table; /* refer to mysql.proc if it was opened by VIEW */

--- 1.233/sql/sql_show.cc	Tue Apr  5 15:12:10 2005
+++ 1.234/sql/sql_show.cc	Tue Apr  5 16:09:51 2005
@@ -3442,12 +3442,11 @@
     TABLE_LIST *table_list= tab->table->pos_in_table_list;
     if (table_list->schema_table && thd->fill_derived_tables())
     {
-      TABLE_LIST *save_next_global= table_list->next_global;
       TABLE_LIST **query_tables_last= lex->query_tables_last;
       TABLE *old_derived_tables= thd->derived_tables;
       MYSQL_LOCK *sql_lock= thd->lock;
       lex->sql_command= SQLCOM_SHOW_FIELDS;
-
+      DBUG_ASSERT(!*query_tables_last);
       if (&lex->unit != lex->current_select->master_unit()) // is subselect
       {
         table_list->table->file->extra(HA_EXTRA_RESET_STATE);
@@ -3466,8 +3465,8 @@
       thd->lock= sql_lock;
       lex->sql_command= SQLCOM_SELECT;
       thd->derived_tables= old_derived_tables;
-      table_list->next_global= save_next_global;
       lex->query_tables_last= query_tables_last;
+      *query_tables_last= 0;
     }
   }
   thd->no_warnings_for_error= 0;

--- 1.34/mysql-test/r/ps.result	Thu Mar  3 17:39:22 2005
+++ 1.35/mysql-test/r/ps.result	Tue Apr  5 16:09:51 2005
@@ -524,3 +524,21 @@
 a	b	c	a	b	c
 deallocate prepare stmt;
 drop table t1,t2;
+SET @aux= "SELECT COUNT(*)
+                FROM INFORMATION_SCHEMA.COLUMNS A,
+                INFORMATION_SCHEMA.COLUMNS B
+                WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
+                AND A.TABLE_NAME = B.TABLE_NAME
+                AND A.COLUMN_NAME = B.COLUMN_NAME AND
+                A.TABLE_NAME = 'user'";
+prepare my_stmt from @aux;
+execute my_stmt;
+COUNT(*)
+37
+execute my_stmt;
+COUNT(*)
+37
+execute my_stmt;
+COUNT(*)
+37
+deallocate prepare my_stmt;

--- 1.33/mysql-test/t/ps.test	Thu Mar  3 17:39:22 2005
+++ 1.34/mysql-test/t/ps.test	Tue Apr  5 16:09:51 2005
@@ -540,3 +540,24 @@
 
 drop table t1,t2;
 
+
+#
+# Bug#9383: INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement
+#
+
+eval SET @aux= "SELECT COUNT(*)
+                FROM INFORMATION_SCHEMA.COLUMNS A,
+                INFORMATION_SCHEMA.COLUMNS B
+                WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
+                AND A.TABLE_NAME = B.TABLE_NAME
+                AND A.COLUMN_NAME = B.COLUMN_NAME AND
+                A.TABLE_NAME = 'user'";
+
+let $exec_loop_count= 3;
+eval prepare my_stmt from @aux;
+while ($exec_loop_count)
+{
+  eval execute my_stmt;
+  dec $exec_loop_count;
+}
+deallocate prepare my_stmt;
Thread
bk commit into 5.0 tree (gluh:1.1872) BUG#9383gluh5 Apr