summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-04-30 14:37:29 +0500
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-04-30 14:37:29 +0500
commit5d41d821744c1138da7b8bdd886b7f97dfbd9714 (patch)
tree21714309ca20317c8dfc70915a4954a72115659e
parent88139cba8ebacca6a816528d5b2a3d2e4ed81711 (diff)
downloadmariadb-git-5d41d821744c1138da7b8bdd886b7f97dfbd9714.tar.gz
Bug#43962 "Packets out of order" calling a SHOW TABLE STATUS
Error happens because sp_head::MULTI_RESULTS is not set for SP which has 'show table status' command. The fix is to add a SQLCOM_SHOW_TABLE_STATUS case into sp_get_flags_for_command() func. mysql-test/r/sp.result: test result mysql-test/t/sp.test: test case sql/sp_head.cc: Error happens because sp_head::MULTI_RESULTS is not set for SP which has 'show table status' command. The fix is to add a SQLCOM_SHOW_TABLE_STATUS case into sp_get_flags_for_command() func.
-rw-r--r--mysql-test/r/sp.result15
-rw-r--r--mysql-test/t/sp.test27
-rw-r--r--sql/sp_head.cc1
3 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 772cedac751..9574841bc35 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6994,6 +6994,21 @@ select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
name
p
drop procedure p;
+CREATE DEFINER = 'root'@'localhost' PROCEDURE p1()
+NOT DETERMINISTIC
+CONTAINS SQL
+SQL SECURITY DEFINER
+COMMENT ''
+BEGIN
+SHOW TABLE STATUS like 't1';
+END;//
+CREATE TABLE t1 (f1 INT);
+CALL p1();
+CALL p1();
+CALL p1();
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index b71a9653b7d..fdf6ed8f382 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -8270,6 +8270,33 @@ select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mo
select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
drop procedure p;
+#
+# Bug#43962 "Packets out of order" calling a SHOW TABLE STATUS
+#
+DELIMITER //;
+CREATE DEFINER = 'root'@'localhost' PROCEDURE p1()
+NOT DETERMINISTIC
+CONTAINS SQL
+SQL SECURITY DEFINER
+COMMENT ''
+BEGIN
+ SHOW TABLE STATUS like 't1';
+END;//
+DELIMITER ;//
+
+
+CREATE TABLE t1 (f1 INT);
+--disable_result_log
+let $tab_count= 4;
+while ($tab_count)
+{
+ EVAL CALL p1();
+ dec $tab_count ;
+}
+--enable_result_log
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
--echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests
--echo # ------------------------------------------------------------------
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index b50247e2e5a..1dba8a45926 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -207,6 +207,7 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_SHOW_STATUS_PROC:
case SQLCOM_SHOW_STORAGE_ENGINES:
case SQLCOM_SHOW_TABLES:
+ case SQLCOM_SHOW_TABLE_STATUS:
case SQLCOM_SHOW_VARIABLES:
case SQLCOM_SHOW_WARNS:
case SQLCOM_REPAIR: