List:Commits« Previous MessageNext Message »
From:marc.alff Date:April 25 2007 5:38pm
Subject:bk commit into 5.0 tree (malff:1.2439)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of marcsql. When marcsql 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@stripped, 2007-04-25 11:38:11-06:00, malff@weblab.(none) +3 -0
  code review fix

  sql/sql_lex.cc@stripped, 2007-04-25 11:38:08-06:00, malff@weblab.(none) +3 -3
    code review fix

  sql/sql_lex.h@stripped, 2007-04-25 11:38:08-06:00, malff@weblab.(none) +4 -1
    code review fix

  sql/sql_parse.cc@stripped, 2007-04-25 11:38:09-06:00, malff@weblab.(none) +5 -4
    code review fix

# 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:	malff
# Host:	weblab.(none)
# Root:	/home/marcsql/TREE/mysql-5.0-25411_d

--- 1.219/sql/sql_lex.cc	2007-04-25 11:38:17 -06:00
+++ 1.220/sql/sql_lex.cc	2007-04-25 11:38:17 -06:00
@@ -122,7 +122,8 @@ Lex_input_stream::Lex_input_stream(THD *
   tok_start_prev(NULL),
   buf(buffer),
   next_state(MY_LEX_START),
-  found_semicolon(NULL)
+  found_semicolon(NULL),
+  ignore_space(test(thd->variables.sql_mode & MODE_IGNORE_SPACE))
 {
 }
 
@@ -192,7 +193,6 @@ void lex_start(THD *thd)
   lex->select_lex.udf_list.empty();
   lex->current_select= &lex->select_lex;
   lex->yacc_yyss=lex->yacc_yyvs=0;
-  lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE);
   lex->sql_command= lex->orig_sql_command= SQLCOM_END;
   lex->duplicates= DUP_ERROR;
   lex->ignore= 0;
@@ -656,7 +656,7 @@ int MYSQLlex(void *arg, void *yythd)
       }
       length= (uint) (lip->ptr - lip->tok_start)-1;
       start= lip->ptr;
-      if (lex->ignore_space)
+      if (lip->ignore_space)
       {
         /*
           If we find a space then this can't be an identifier. We notice this

--- 1.243/sql/sql_lex.h	2007-04-25 11:38:17 -06:00
+++ 1.244/sql/sql_lex.h	2007-04-25 11:38:17 -06:00
@@ -951,6 +951,9 @@ public:
 
   /** Position of ';' in the stream, to delimit multiple queries. */
   const char* found_semicolon;
+
+  /** SQL_MODE = IGNORE_SPACE. */
+  bool ignore_space;
 };
 
 
@@ -1069,7 +1072,7 @@ typedef struct st_lex : public Query_tab
   uint8 create_view_algorithm;
   uint8 create_view_check;
   bool drop_if_exists, drop_temporary, local_file, one_shot_set;
-  bool in_comment, ignore_space, verbose, no_write_to_binlog;
+  bool in_comment, verbose, no_write_to_binlog;
   bool tx_chain, tx_release;
   /*
     Special JOIN::prepare mode: changing of query is prohibited.

--- 1.618/sql/sql_parse.cc	2007-04-25 11:38:17 -06:00
+++ 1.619/sql/sql_parse.cc	2007-04-25 11:38:17 -06:00
@@ -5990,16 +5990,14 @@ void mysql_parse(THD *thd, const char *i
     - first, call query_cache_send_result_to_client,
     - second, if caching failed, initialise the lexical and syntactic parser.
     The problem is that the query cache depends on a clean initialization
-    of the thd and thd->lex structures, which happen to be implemented
-    by:
+    of (among others) lex->safe_to_cache_query and thd->server_status,
+    which are reset respectively in
     - lex_start()
     - mysql_reset_thd_for_next_command()
     So, initializing the lexical analyser *before* using the query cache
     is required for the cache to work properly.
     FIXME: cleanup the dependencies in the code to simplify this.
   */
-  Lex_input_stream lip(thd, inBuf, length);
-  thd->m_lip= &lip;
   lex_start(thd);
   mysql_reset_thd_for_next_command(thd);
 
@@ -6009,6 +6007,9 @@ void mysql_parse(THD *thd, const char *i
 
     sp_cache_flush_obsolete(&thd->sp_proc_cache);
     sp_cache_flush_obsolete(&thd->sp_func_cache);
+
+    Lex_input_stream lip(thd, inBuf, length);
+    thd->m_lip= &lip;
 
     int err= MYSQLparse(thd);
     *found_semicolon= lip.found_semicolon;
Thread
bk commit into 5.0 tree (malff:1.2439)marc.alff25 Apr