File tree 3 files changed +43
-6
lines changed
3 files changed +43
-6
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,11 @@ Pos Instruction
155
155
0 stmt 9 "drop temporary table if exists sudoku..."
156
156
1 stmt 1 "create temporary table sudoku_work ( ..."
157
157
2 stmt 1 "create temporary table sudoku_schedul..."
158
- 3 stmt 95 "call sudoku_init("
158
+ 3 stmt 95 "call sudoku_init() "
159
159
4 jump_if_not 7(8) p_naive@0
160
160
5 stmt 4 "update sudoku_work set cnt = 0 where ..."
161
161
6 jump 8
162
- 7 stmt 95 "call sudoku_count("
162
+ 7 stmt 95 "call sudoku_count() "
163
163
8 stmt 6 "insert into sudoku_schedule (row,col)..."
164
164
9 set v_scounter@2 0
165
165
10 set v_i@3 1
@@ -199,3 +199,10 @@ Pos Instruction
199
199
44 jump 14
200
200
45 stmt 9 "drop temporary table sudoku_work, sud..."
201
201
drop procedure sudoku_solve;
202
+ DROP PROCEDURE IF EXISTS p1;
203
+ CREATE PROCEDURE p1() CREATE INDEX idx ON t1 (c1);
204
+ SHOW PROCEDURE CODE p1;
205
+ Pos Instruction
206
+ 0 stmt 2 "CREATE INDEX idx ON t1 (c1)"
207
+ DROP PROCEDURE p1;
208
+ End of 5.0 tests.
Original file line number Diff line number Diff line change @@ -190,3 +190,25 @@ delimiter ;//
190
190
show procedure code sudoku_solve;
191
191
192
192
drop procedure sudoku_solve;
193
+
194
+
195
+ #
196
+ # Bug#19207: Final parenthesis omitted for CREATE INDEX in Stored
197
+ # Procedure
198
+ #
199
+ # Wrong criteria was used to distinguish the case when there was no
200
+ # lookahead performed in the parser. Bug affected only statements
201
+ # ending in one-character token without any optional tail, like CREATE
202
+ # INDEX and CALL.
203
+ #
204
+ --disable_warnings
205
+ DROP PROCEDURE IF EXISTS p1;
206
+ --enable_warnings
207
+
208
+ CREATE PROCEDURE p1() CREATE INDEX idx ON t1 (c1);
209
+ SHOW PROCEDURE CODE p1;
210
+
211
+ DROP PROCEDURE p1;
212
+
213
+
214
+ --echo End of 5.0 tests.
Original file line number Diff line number Diff line change @@ -1911,9 +1911,12 @@ sp_proc_stmt:
1911
1911
sp_instr_stmt *i=new sp_instr_stmt (sp->instructions (),
1912
1912
lex->spcont , lex);
1913
1913
1914
- /* Extract the query statement from the tokenizer:
1915
- The end is either lex->tok_end or tok->ptr. */
1916
- if (lex->ptr - lex->tok_end > 1 )
1914
+ /*
1915
+ Extract the query statement from the tokenizer. The
1916
+ end is either lex->ptr, if there was no lookahead,
1917
+ lex->tok_end otherwise.
1918
+ */
1919
+ if (yychar == YYEMPTY)
1917
1920
i->m_query .length = lex->ptr - sp->m_tmp_query ;
1918
1921
else
1919
1922
i->m_query .length = lex->tok_end - sp->m_tmp_query ;
@@ -7841,7 +7844,12 @@ option_type_value:
7841
7844
lex)))
7842
7845
YYABORT;
7843
7846
7844
- if (lex->ptr - lex->tok_end > 1 )
7847
+ /*
7848
+ Extract the query statement from the tokenizer. The
7849
+ end is either lex->ptr, if there was no lookahead,
7850
+ lex->tok_end otherwise.
7851
+ */
7852
+ if (yychar == YYEMPTY)
7845
7853
qbuff.length = lex->ptr - sp->m_tmp_query ;
7846
7854
else
7847
7855
qbuff.length = lex->tok_end - sp->m_tmp_query ;
You can’t perform that action at this time.
0 commit comments