diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 5cdffbdc52c..306b4ba89a8 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -1360,6 +1360,18 @@ bug3132('Bob') Hello, Bob! Hello, Judy! drop function bug3132| +create procedure bug3843() +analyze table t1| +call bug3843()| +Table Op Msg_type Msg_text +test.t1 analyze status OK +call bug3843()| +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +select 1+2| +1+2 +3 +drop procedure bug3843| drop table if exists fac| create table fac (n int unsigned not null primary key, f bigint unsigned)| create procedure ifac(n int unsigned) diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 2571a5b0674..0e95eb154d0 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -1560,6 +1560,19 @@ create function bug3132(s char(20)) returns char(50) select bug3132('Bob') union all select bug3132('Judy')| drop function bug3132| +# +# BUG#3843 +# +create procedure bug3843() + analyze table t1| + +# Testing for packets out of order +call bug3843()| +call bug3843()| +select 1+2| + +drop procedure bug3843| + # # Some "real" examples diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 40c0626b33c..ac5e84ee783 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1601,7 +1601,8 @@ sp_proc_stmt: lex->sql_command == SQLCOM_SHOW_CREATE_PROC || lex->sql_command == SQLCOM_SHOW_CREATE_FUNC || lex->sql_command == SQLCOM_SHOW_STATUS_PROC || - lex->sql_command == SQLCOM_SHOW_STATUS_FUNC) + lex->sql_command == SQLCOM_SHOW_STATUS_FUNC || + lex->sql_command == SQLCOM_ANALYZE) { /* We maybe have one or more SELECT without INTO */ lex->sphead->m_multi_results= TRUE;