summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-12-03 15:02:09 +0100
committerunknown <serg@serg.mylan>2005-12-03 15:02:09 +0100
commitda8b9967a85ba2cbc96c144695ad9bed7e6aad53 (patch)
tree164169a3bb780c4b9e284ff34f5dc99cdc7bf6dc /mysql-test
parent33b58ea123fa474c8ab6c73cea1ac6bd37671587 (diff)
downloadmariadb-git-da8b9967a85ba2cbc96c144695ad9bed7e6aad53.tar.gz
this has nothing to do with the bug#13012.
it's about mysql_admin_commands not being reexecution-safe (and CHECK still isn't) mysql-test/r/sp-error.result: optimize is now allowed in SP mysql-test/r/sp.result: test repair/optimize/analyze in SP mysql-test/t/backup.test: clean up after itself mysql-test/t/sp-error.test: optimize is now allowed in SP mysql-test/t/sp.test: test repair/optimize/analyze in SP sql/sp_head.cc: all mysql_admin commands return result set sql/sql_parse.cc: all mysql_admin commands modify table list and we should restore it for SP sql/sql_table.cc: optimization - don't execute views when no view is expected/allowed sql/sql_yacc.yy: optimize is now allowed in SP
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sp-error.result2
-rw-r--r--mysql-test/r/sp.result63
-rw-r--r--mysql-test/t/backup.test1
-rw-r--r--mysql-test/t/sp-error.test2
-rw-r--r--mysql-test/t/sp.test13
5 files changed, 78 insertions, 3 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index f1d65ada4bf..4ba097e3d9f 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -768,7 +768,7 @@ BEGIN
OPTIMIZE TABLE t1;
RETURN 1;
END|
-ERROR 0A000: OPTIMIZE TABLE is not allowed in stored procedures
+ERROR 0A000: Not allowed to return a result set from a function
DROP FUNCTION IF EXISTS bug12995|
CREATE FUNCTION bug12995() RETURNS INT
BEGIN
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 41279534007..bfc16c826a5 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -4168,6 +4168,69 @@ test.t1 backup status OK
Table Op Msg_type Msg_text
test.t1 restore status OK
drop procedure bug13012|
+create view v1 as select * from t1|
+create procedure bug13012()
+BEGIN
+REPAIR TABLE t1,t2,t3,v1;
+OPTIMIZE TABLE t1,t2,t3,v1;
+ANALYZE TABLE t1,t2,t3,v1;
+END|
+call bug13012()|
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+test.t2 repair status OK
+test.t3 repair error Table 'test.t3' doesn't exist
+test.v1 repair note Unknown table 'test.v1'
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+test.t2 optimize status OK
+test.t3 optimize error Table 'test.t3' doesn't exist
+test.v1 optimize note Unknown table 'test.v1'
+Table Op Msg_type Msg_text
+test.t1 analyze status Table is already up to date
+test.t2 analyze status Table is already up to date
+test.t3 analyze error Table 'test.t3' doesn't exist
+test.v1 analyze note Unknown table 'test.v1'
+Warnings:
+Error 1146 Table 'test.t3' doesn't exist
+call bug13012()|
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+test.t2 repair status OK
+test.t3 repair error Table 'test.t3' doesn't exist
+test.v1 repair note Unknown table 'test.v1'
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+test.t2 optimize status OK
+test.t3 optimize error Table 'test.t3' doesn't exist
+test.v1 optimize note Unknown table 'test.v1'
+Table Op Msg_type Msg_text
+test.t1 analyze status Table is already up to date
+test.t2 analyze status Table is already up to date
+test.t3 analyze error Table 'test.t3' doesn't exist
+test.v1 analyze note Unknown table 'test.v1'
+Warnings:
+Error 1146 Table 'test.t3' doesn't exist
+call bug13012()|
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+test.t2 repair status OK
+test.t3 repair error Table 'test.t3' doesn't exist
+test.v1 repair note Unknown table 'test.v1'
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+test.t2 optimize status OK
+test.t3 optimize error Table 'test.t3' doesn't exist
+test.v1 optimize note Unknown table 'test.v1'
+Table Op Msg_type Msg_text
+test.t1 analyze status Table is already up to date
+test.t2 analyze status Table is already up to date
+test.t3 analyze error Table 'test.t3' doesn't exist
+test.v1 analyze note Unknown table 'test.v1'
+Warnings:
+Error 1146 Table 'test.t3' doesn't exist
+drop procedure bug13012|
+drop view v1;
select * from t1|
a
a - table column
diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test
index 3034129ad4b..40a9fa73b60 100644
--- a/mysql-test/t/backup.test
+++ b/mysql-test/t/backup.test
@@ -52,5 +52,6 @@ unlock tables;
connection con1;
reap;
drop table t5;
+--system rm $MYSQL_TEST_DIR/var/tmp/t?.*
# End of 4.1 tests
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index ae13758a10e..b6c7d5476e7 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1095,7 +1095,7 @@ delimiter |;
--disable_warnings
DROP FUNCTION IF EXISTS bug12953|
--enable_warnings
---error ER_SP_BADSTATEMENT
+--error ER_SP_NO_RETSET
CREATE FUNCTION bug12953() RETURNS INT
BEGIN
OPTIMIZE TABLE t1;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index fcd0fddb147..22dd1285b75 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -4961,9 +4961,20 @@ BEGIN
DROP TABLE t1;
RESTORE TABLE t1 FROM '../tmp';
END|
---replace_result ": 7" ": X" ": 17" ": X" $MYSQL_TEST_DIR MYSQL_TEST_DIR
call bug13012()|
drop procedure bug13012|
+create view v1 as select * from t1|
+create procedure bug13012()
+BEGIN
+ REPAIR TABLE t1,t2,t3,v1;
+ OPTIMIZE TABLE t1,t2,t3,v1;
+ ANALYZE TABLE t1,t2,t3,v1;
+END|
+call bug13012()|
+call bug13012()|
+call bug13012()|
+drop procedure bug13012|
+drop view v1;
select * from t1|
#