Fixed bug #643, which caused intermittent crashes in net_printf() with repeated

syntax errors in stored procedures.
This commit is contained in:
pem@mysql.com 2003-06-12 15:31:20 +02:00
parent 7c6522a74e
commit 541c94fcf1
3 changed files with 17 additions and 0 deletions

View file

@ -1,4 +1,10 @@
delete from mysql.proc;
create procedure syntaxerror(t int);
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 '' at line 1
create procedure syntaxerror(t int);
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 '' at line 1
create procedure syntaxerror(t int);
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 '' at line 1
create procedure proc1()
set @x = 42;
create function func1() returns int

View file

@ -7,6 +7,16 @@ delete from mysql.proc;
delimiter |;
# This should give three syntax errors (sometimes crashed; bug #643)
# (Unfortunately, this is not a 100% test, on some platforms this
# passed despite the bug.)
--error 1064
create procedure syntaxerror(t int)|
--error 1064
create procedure syntaxerror(t int)|
--error 1064
create procedure syntaxerror(t int)|
# Check that we get the right error, i.e. UDF declaration parses correctly,
# but foo.so doesn't exist.
# QQ This generates an error message containing a misleading errno which

View file

@ -376,6 +376,7 @@ sp_head::reset_lex(THD *thd)
/* We must reset ptr and end_of_query again */
sublex->ptr= m_lex->ptr;
sublex->end_of_query= m_lex->end_of_query;
sublex->tok_start= m_lex->tok_start;
/* And keep the SP stuff too */
sublex->sphead= m_lex->sphead;
sublex->spcont= m_lex->spcont;