MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Mikael Ronstrom Date:August 7 2009 9:26am
Subject:bzr commit into mysql-5.4 branch (mikael:3481) Bug#32115
View as plain text  
#At file:///home/mikael/mysql_clones/mysql-6.0-bugteam-bug32115/

 3481 Mikael Ronstrom	2009-08-07
      Bug#32115, remove now obsolete lex_start calls
      modified:
        libmysqld/lib_sql.cc
        sql/event_data_objects.cc
        sql/ha_ndbcluster.cc
        sql/ha_ndbcluster_binlog.cc
        sql/slave.cc
        sql/sql_insert.cc
        sql/sql_partition.cc

=== modified file 'libmysqld/lib_sql.cc'
--- a/libmysqld/lib_sql.cc	2009-07-03 05:54:09 +0000
+++ b/libmysqld/lib_sql.cc	2009-08-07 09:26:33 +0000
@@ -119,7 +119,6 @@ emb_advanced_command(MYSQL *mysql, enum 
   thd->current_stmt= stmt;
 
   thd->store_globals();				// Fix if more than one connect
-  lex_start(thd);
   /* 
      We have to call free_old_query before we start to fill mysql->fields 
      for new query. In the case of embedded server we collect field data

=== modified file 'sql/event_data_objects.cc'
--- a/sql/event_data_objects.cc	2009-04-01 09:34:34 +0000
+++ b/sql/event_data_objects.cc	2009-08-07 09:26:33 +0000
@@ -1368,7 +1368,6 @@ Event_job_data::execute(THD *thd, bool d
 
   DBUG_ENTER("Event_job_data::execute");
 
-  lex_start(thd);
   mysql_reset_thd_for_next_command(thd);
 
   /*

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2009-06-19 09:28:44 +0000
+++ b/sql/ha_ndbcluster.cc	2009-08-07 09:26:33 +0000
@@ -7245,7 +7245,6 @@ int ndb_create_table_from_engine(THD *th
   LEX *old_lex= thd->lex, newlex;
   thd->lex= &newlex;
   newlex.current_select= NULL;
-  lex_start(thd);
   int res= ha_create_table_from_engine(thd, db, table_name);
   thd->lex= old_lex;
   return res;
@@ -10098,7 +10097,6 @@ pthread_handler_t ndb_util_thread_func(v
   thd->thread_stack= (char*)&thd; /* remember where our stack is */
   if (thd->store_globals())
     goto ndb_util_thread_fail;
-  lex_start(thd);
   thd->init_for_queries();
   thd->version=refresh_version;
   thd->main_security_ctx.host_or_ip= "";

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2009-06-19 09:28:44 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2009-08-07 09:26:33 +0000
@@ -4707,7 +4707,6 @@ pthread_handler_t ndb_binlog_thread_func
     pthread_exit(0);
     DBUG_RETURN(NULL);
   }
-  lex_start(thd);
 
   thd->init_for_queries();
   thd->command= COM_DAEMON;

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-07-20 05:02:41 +0000
+++ b/sql/slave.cc	2009-08-07 09:26:33 +0000
@@ -1996,7 +1996,6 @@ static int init_slave_thread(THD* thd, S
     thd->cleanup();
     DBUG_RETURN(-1);
   }
-  lex_start(thd);
 
   if (thd_type == SLAVE_THD_SQL)
     thd_proc_info(thd, "Waiting for the next event in relay log");

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2009-07-03 08:42:46 +0000
+++ b/sql/sql_insert.cc	2009-08-07 09:26:33 +0000
@@ -2396,12 +2396,6 @@ pthread_handler_t handle_delayed_insert(
     goto err;
   }
 
-  /*
-    Open table requires an initialized lex in case the table is
-    partitioned. The .frm file contains a partial SQL string which is
-    parsed using a lex, that depends on initialized thd->lex.
-  */
-  lex_start(thd);
   thd->lex->sql_command= SQLCOM_INSERT;        // For innodb::store_lock()
   /*
     Statement-based replication of INSERT DELAYED has problems with RAND()

=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc	2009-08-05 12:57:04 +0000
+++ b/sql/sql_partition.cc	2009-08-07 09:26:33 +0000
@@ -880,11 +880,10 @@ int check_signed_flag(partition_info *pa
 */
 
 static int
-init_lex_with_single_table(THD *thd, TABLE *table)
+init_lex_with_single_table(THD *thd, TABLE *table, LEX *lex)
 {
   TABLE_LIST *table_list;
   Table_ident *table_ident;
-  LEX *lex= thd->lex;
   SELECT_LEX *select_lex= &lex->select_lex;
   Name_resolution_context *context= &select_lex->context;
   /*
@@ -895,6 +894,7 @@ init_lex_with_single_table(THD *thd, TAB
     do this by using add_table_to_list where we add the table that
     we're working with to the Name_resolution_context.
   */
+  thd->lex= lex;
   lex_start(thd);
   context->init();
   if ((!(table_ident= new Table_ident(thd,
@@ -986,12 +986,8 @@ bool fix_fields_part_func(THD *thd, Item
   LEX lex;
   DBUG_ENTER("fix_fields_part_func");
 
-  thd->lex= &lex;
-  if (init_lex_with_single_table(thd, table))
-  {
-    mem_alloc_error(sizeof(Table_ident));
+  if (init_lex_with_single_table(thd, table, &lex))
     goto end;
-  }
 
   if (part_info->fixed)
   {
@@ -3841,16 +3837,13 @@ bool mysql_unpack_partition(THD *thd,
   LEX lex;
   DBUG_ENTER("mysql_unpack_partition");
 
-  thd->lex= &lex;
   thd->variables.character_set_client= system_charset_info;
 
   Parser_state parser_state(thd, part_buf, part_info_len);
 
-  if (init_lex_with_single_table(thd, table))
-  {
-    mem_alloc_error(sizeof(Table_ident));
+  if (init_lex_with_single_table(thd, table, &lex))
     goto end;
-  }
+
   /*
     All Items created is put into a free list on the THD object. This list
     is used to free all Item objects after completing a query. We don't
@@ -3860,7 +3853,7 @@ bool mysql_unpack_partition(THD *thd,
     Thus we move away the current list temporarily and start a new list that
     we then save in the partition info structure.
   */
-  *work_part_info_used= false;
+  *work_part_info_used= FALSE;
   lex.part_info= new partition_info();/* Indicates MYSQLparse from this place */
   if (!lex.part_info)
   {

Thread
bzr commit into mysql-5.4 branch (mikael:3481) Bug#32115Mikael Ronstrom7 Aug