MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:kroki Date:July 7 2006 5:25pm
Subject:bk commit into 5.0 tree (kroki:1.2207) BUG#19207
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tomash. When tomash 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, 2006-07-07 21:24:54+04:00, kroki@stripped +3 -0
  Bug#19207: Final parenthesis omitted for CREATE INDEX in Stored Procedure
  
  Wrong criteria was used to distinguish the case when there was no
  lookahead performed in the parser.  Bug affected only statements
  ending in one-character token without any optional tail, like CREATE
  INDEX and CALL.

  mysql-test/r/sp-code.result@stripped, 2006-07-07 21:24:52+04:00, kroki@stripped +9 -2
    Add result for bug#19207: Final parenthesis omitted for CREATE INDEX
    in Stored Procedure

  mysql-test/t/sp-code.test@stripped, 2006-07-07 21:24:52+04:00, kroki@stripped +22 -0
    Add test case for bug#19207: Final parenthesis omitted for CREATE INDEX
    in Stored Procedure

  sql/sql_yacc.yy@stripped, 2006-07-07 21:24:52+04:00, kroki@stripped +12 -4
    Use (yychar == YYEMPTY) as the criteria of whether lookahead was not
    performed.

# 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:	kroki
# Host:	moonlight.intranet
# Root:	/home/tomash/src/mysql_ab/mysql-5.0-bug19207

--- 1.472/sql/sql_yacc.yy	2006-07-07 21:25:02 +04:00
+++ 1.473/sql/sql_yacc.yy	2006-07-07 21:25:02 +04:00
@@ -1911,9 +1911,12 @@
               sp_instr_stmt *i=new sp_instr_stmt(sp->instructions(),
                                                  lex->spcont, lex);
 
-              /* Extract the query statement from the tokenizer:
-                 The end is either lex->tok_end or tok->ptr. */
-              if (lex->ptr - lex->tok_end > 1)
+              /*
+                Extract the query statement from the tokenizer.  The
+                end is either lex->ptr, if there was no lookahead,
+                lex->tok_end otherwise.
+              */
+              if (yychar == YYEMPTY)
                 i->m_query.length= lex->ptr - sp->m_tmp_query;
               else
                 i->m_query.length= lex->tok_end - sp->m_tmp_query;
@@ -7841,7 +7844,12 @@
                                          lex)))
                 YYABORT;
 
-              if (lex->ptr - lex->tok_end > 1)
+              /*
+                Extract the query statement from the tokenizer.  The
+                end is either lex->ptr, if there was no lookahead,
+                lex->tok_end otherwise.
+              */
+              if (yychar == YYEMPTY)
                 qbuff.length= lex->ptr - sp->m_tmp_query;
               else
                 qbuff.length= lex->tok_end - sp->m_tmp_query;

--- 1.6/mysql-test/r/sp-code.result	2006-07-07 21:25:02 +04:00
+++ 1.7/mysql-test/r/sp-code.result	2006-07-07 21:25:02 +04:00
@@ -155,11 +155,11 @@
 0	stmt 9 "drop temporary table if exists sudoku..."
 1	stmt 1 "create temporary table sudoku_work ( ..."
 2	stmt 1 "create temporary table sudoku_schedul..."
-3	stmt 95 "call sudoku_init("
+3	stmt 95 "call sudoku_init()"
 4	jump_if_not 7(8) p_naive@0
 5	stmt 4 "update sudoku_work set cnt = 0 where ..."
 6	jump 8
-7	stmt 95 "call sudoku_count("
+7	stmt 95 "call sudoku_count()"
 8	stmt 6 "insert into sudoku_schedule (row,col)..."
 9	set v_scounter@2 0
 10	set v_i@3 1
@@ -199,3 +199,10 @@
 44	jump 14
 45	stmt 9 "drop temporary table sudoku_work, sud..."
 drop procedure sudoku_solve;
+DROP PROCEDURE IF EXISTS p1;
+CREATE PROCEDURE p1() CREATE INDEX idx ON t1 (c1);
+SHOW PROCEDURE CODE p1;
+Pos	Instruction
+0	stmt 2 "CREATE INDEX idx ON t1 (c1)"
+DROP PROCEDURE p1;
+End of 5.0 tests.

--- 1.4/mysql-test/t/sp-code.test	2006-07-07 21:25:02 +04:00
+++ 1.5/mysql-test/t/sp-code.test	2006-07-07 21:25:02 +04:00
@@ -190,3 +190,25 @@
 show procedure code sudoku_solve;
 
 drop procedure sudoku_solve;
+
+
+#
+# Bug#19207: Final parenthesis omitted for CREATE INDEX in Stored
+# Procedure
+#
+# Wrong criteria was used to distinguish the case when there was no
+# lookahead performed in the parser.  Bug affected only statements
+# ending in one-character token without any optional tail, like CREATE
+# INDEX and CALL.
+#
+--disable_warnings
+DROP PROCEDURE IF EXISTS p1;
+--enable_warnings
+
+CREATE PROCEDURE p1() CREATE INDEX idx ON t1 (c1);
+SHOW PROCEDURE CODE p1;
+
+DROP PROCEDURE p1;
+
+
+--echo End of 5.0 tests.
Thread
bk commit into 5.0 tree (kroki:1.2207) BUG#19207kroki7 Jul