List:Commits« Previous MessageNext Message »
From:konstantin Date:May 11 2007 1:26pm
Subject:bk commit into 5.0 tree (kostja:1.2477)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja 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-05-11 17:26:12+04:00, kostja@vajra.(none) +8 -0
  Cleanup: now that we have Lex_input_stream, finish the transition
  by moving yet another relevant flag to it from struct LEX.

  mysql-test/r/ps.result@stripped, 2007-05-11 17:26:09+04:00, kostja@vajra.(none) +3 -3
    Update result.

  mysql-test/r/ps_1general.result@stripped, 2007-05-11 17:26:09+04:00, kostja@vajra.(none) +3 -3
    Update result.

  mysql-test/t/ps.test@stripped, 2007-05-11 17:26:09+04:00, kostja@vajra.(none) +3 -3
    New error code.

  mysql-test/t/ps_1general.test@stripped, 2007-05-11 17:26:09+04:00, kostja@vajra.(none) +3 -3
    New error code.

  sql/sql_lex.cc@stripped, 2007-05-11 17:26:09+04:00, kostja@vajra.(none) +4 -4
    Move stmt_prepare_mode to Lex_input_stream.

  sql/sql_lex.h@stripped, 2007-05-11 17:26:09+04:00, kostja@vajra.(none) +5 -5
    Move stmt_prepare_mode to class Lex_input_stream

  sql/sql_prepare.cc@stripped, 2007-05-11 17:26:09+04:00, kostja@vajra.(none) +4 -1
    Move stmt_prepare_mode to Lex_input_stream

  sql/sql_yacc.yy@stripped, 2007-05-11 17:26:09+04:00, kostja@vajra.(none) +0 -15
    Remove dead code.

# 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:	kostja
# Host:	vajra.(none)
# Root:	/opt/local/work/mysql-5.0-runtime

--- 1.220/sql/sql_lex.cc	2007-05-02 19:59:35 +04:00
+++ 1.221/sql/sql_lex.cc	2007-05-11 17:26:09 +04:00
@@ -123,7 +123,8 @@
   buf(buffer),
   next_state(MY_LEX_START),
   found_semicolon(NULL),
-  ignore_space(test(thd->variables.sql_mode & MODE_IGNORE_SPACE))
+  ignore_space(test(thd->variables.sql_mode & MODE_IGNORE_SPACE)),
+  stmt_prepare_mode(FALSE)
 {
 }
 
@@ -172,7 +173,6 @@
   lex->describe= 0;
   lex->subqueries= FALSE;
   lex->view_prepare_mode= FALSE;
-  lex->stmt_prepare_mode= FALSE;
   lex->derived_tables= 0;
   lex->lock_option= TL_READ;
   lex->safe_to_cache_query= 1;
@@ -586,7 +586,7 @@
         its value in a query for the binlog, the query must stay
         grammatically correct.
       */
-      else if (c == '?' && lex->stmt_prepare_mode && !ident_map[yyPeek()])
+      else if (c == '?' && lip->stmt_prepare_mode && !ident_map[yyPeek()])
         return(PARAM_MARKER);
       return((int) c);
 
@@ -989,7 +989,7 @@
       if (yyPeek())
       {
         if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) && 
-            !lex->stmt_prepare_mode)
+            !lip->stmt_prepare_mode)
         {
 	  lex->safe_to_cache_query= 0;
           lip->found_semicolon= lip->ptr;

--- 1.244/sql/sql_lex.h	2007-04-25 21:38:08 +04:00
+++ 1.245/sql/sql_lex.h	2007-05-11 17:26:09 +04:00
@@ -954,6 +954,11 @@
 
   /** SQL_MODE = IGNORE_SPACE. */
   bool ignore_space;
+  /*
+    TRUE if we're parsing a prepared statement: in this mode
+    we should allow placeholders and disallow multi-statements.
+  */
+  bool stmt_prepare_mode;
 };
 
 
@@ -1082,11 +1087,6 @@
     to an .frm file. We need this definition to stay untouched.
   */
   bool view_prepare_mode;
-  /*
-    TRUE if we're parsing a prepared statement: in this mode
-    we should allow placeholders and disallow multistatements.
-  */
-  bool stmt_prepare_mode;
   bool safe_to_cache_query;
   bool subqueries, ignore;
   st_parsing_options parsing_options;

--- 1.516/sql/sql_yacc.yy	2007-04-28 03:14:23 +04:00
+++ 1.517/sql/sql_yacc.yy	2007-05-11 17:26:09 +04:00
@@ -1276,11 +1276,6 @@
         {
           THD *thd=YYTHD;
           LEX *lex= thd->lex;
-          if (lex->stmt_prepare_mode)
-          {
-            my_parse_error(ER(ER_SYNTAX_ERROR));
-            MYSQL_YYABORT;
-          }
           lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
           lex->prepared_stmt_name= $3;
         };
@@ -1296,11 +1291,6 @@
         {
           THD *thd=YYTHD;
           LEX *lex= thd->lex;
-          if (lex->stmt_prepare_mode)
-          {
-            my_parse_error(ER(ER_SYNTAX_ERROR));
-            MYSQL_YYABORT;
-          }
           lex->sql_command= SQLCOM_PREPARE;
           lex->prepared_stmt_name= $2;
         };
@@ -1326,11 +1316,6 @@
         {
           THD *thd=YYTHD;
           LEX *lex= thd->lex;
-          if (lex->stmt_prepare_mode)
-          {
-            my_parse_error(ER(ER_SYNTAX_ERROR));
-            MYSQL_YYABORT;
-          }
           lex->sql_command= SQLCOM_EXECUTE;
           lex->prepared_stmt_name= $2;
         }

--- 1.54/mysql-test/r/ps_1general.result	2006-08-02 16:48:15 +04:00
+++ 1.55/mysql-test/r/ps_1general.result	2007-05-11 17:26:09 +04:00
@@ -391,11 +391,11 @@
 deallocate prepare stmt_do ;
 deallocate prepare stmt_set ;
 prepare stmt1 from ' prepare stmt2 from '' select 1 ''  ' ;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' select 1 '' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt1 from ' execute stmt2 ' ;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt2' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt1 from ' deallocate prepare never_prepared ' ;
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'never_prepared' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt4 from ' use test ' ;
 ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt3 from ' create database mysqltest ';

--- 1.30/mysql-test/t/ps_1general.test	2007-01-31 15:45:31 +03:00
+++ 1.31/mysql-test/t/ps_1general.test	2007-05-11 17:26:09 +04:00
@@ -416,11 +416,11 @@
 deallocate prepare stmt_set ;
 
 ## nonsense like prepare of prepare,execute or deallocate
---error 1064
+--error ER_UNSUPPORTED_PS 
 prepare stmt1 from ' prepare stmt2 from '' select 1 ''  ' ;
---error 1064
+--error ER_UNSUPPORTED_PS 
 prepare stmt1 from ' execute stmt2 ' ;
---error 1064
+--error ER_UNSUPPORTED_PS 
 prepare stmt1 from ' deallocate prepare never_prepared ' ;
 
 ## switch the database connection

--- 1.89/mysql-test/r/ps.result	2007-02-01 19:31:54 +03:00
+++ 1.90/mysql-test/r/ps.result	2007-05-11 17:26:09 +04:00
@@ -26,11 +26,11 @@
 execute stmt1;
 ERROR HY000: Incorrect arguments to EXECUTE
 prepare stmt2 from 'prepare nested_stmt from "select 1"';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"select 1"' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt2 from 'execute stmt1';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt1' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt2 from 'deallocate prepare z';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'z' at line 1
+ERROR HY000: This command is not supported in the prepared statement protocol yet
 prepare stmt3 from 'insert into t1 values (?,?)';
 set @arg1=5, @arg2='five';
 execute stmt3 using @arg1, @arg2;

--- 1.89/mysql-test/t/ps.test	2007-02-01 19:32:29 +03:00
+++ 1.90/mysql-test/t/ps.test	2007-05-11 17:26:09 +04:00
@@ -33,13 +33,13 @@
 execute stmt1;
 
 # Nesting ps commands is not allowed: 
---error 1064
+--error ER_UNSUPPORTED_PS 
 prepare stmt2 from 'prepare nested_stmt from "select 1"';
 
---error 1064
+--error ER_UNSUPPORTED_PS 
 prepare stmt2 from 'execute stmt1';
 
---error 1064
+--error ER_UNSUPPORTED_PS 
 prepare stmt2 from 'deallocate prepare z';
 
 # PS insert 

--- 1.199/sql/sql_prepare.cc	2007-04-24 19:25:51 +04:00
+++ 1.200/sql/sql_prepare.cc	2007-05-11 17:26:09 +04:00
@@ -1762,6 +1762,9 @@
   case SQLCOM_OPTIMIZE:
     break;
 
+  case SQLCOM_PREPARE:
+  case SQLCOM_EXECUTE:
+  case SQLCOM_DEALLOCATE_PREPARE:
   default:
     /* All other statements are not supported yet. */
     my_message(ER_UNSUPPORTED_PS, ER(ER_UNSUPPORTED_PS), MYF(0));
@@ -2801,10 +2804,10 @@
   thd->stmt_arena= this;
 
   Lex_input_stream lip(thd, thd->query, thd->query_length);
+  lip.stmt_prepare_mode= TRUE;
   thd->m_lip= &lip;
   lex_start(thd);
   lex->safe_to_cache_query= FALSE;
-  lex->stmt_prepare_mode= TRUE;
   int err= MYSQLparse((void *)thd);
 
   error= err || thd->is_fatal_error ||
Thread
bk commit into 5.0 tree (kostja:1.2477)konstantin11 May