summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-error.test
diff options
context:
space:
mode:
authorunknown <thek@adventure.(none)>2007-06-22 11:55:48 +0200
committerunknown <thek@adventure.(none)>2007-06-22 11:55:48 +0200
commit099be80130d852179bc4a568990c75ffc950719f (patch)
tree051242c3e5d96a0fb66314e00acb396930d2fb6c /mysql-test/t/sp-error.test
parent0e958122e197f4d02cf07040e4cb24af460ab15e (diff)
downloadmariadb-git-099be80130d852179bc4a568990c75ffc950719f.tar.gz
Bug#28846 Use of undocumented Prepared Statements crashes server
ALTER VIEW is currently not supported as a prepared statement and should be disabled as such as they otherwise could cause server crashes. ALTER VIEW is currently not supported when called from stored procedures or functions for related reasons and should also be disabled. This patch disables these DDL statements and adjusts the appropriate test cases accordingly. Additional tests has been added to reflect on the fact that we do support CREATE/ALTER/DROP TABLE for Prepared Statements (PS), Stored Procedures (SP) and PS within SP. mysql-test/r/ps_1general.result: - Updated test to reflect on the new policy to disallow ALTER VIEW within SP. mysql-test/r/sp-dynamic.result: - Added PS ALTER TABLE test from within SP-context to demonstrate that CREATE/ALTER/DROP TABLE statements is working. - Added PS CREATE/ALTER/DROP VIEW tests from within SP-context to show that ALTER VIEW is not supported, CREATE VIEW/DROP VIEW are supported. mysql-test/r/sp-error.result: - Updated test to reflect on the new policy to disallow VIEW DDL within SP. mysql-test/t/ps_1general.test: - Updated test to reflect on the new policy to disallow VIEW DDL within SP. mysql-test/t/sp-dynamic.test: - Add PS ALTER TABLE test from within SP to demonstrate that CREATE/ALTER/DROP TABLE statements are supported. mysql-test/t/sp-error.test: - Updated test to reflect on the new policy to disallow ALTER VIEW within SP-context. - Changed error code 1314 to the more abstract ER_SP_BADSTATEMENT. sql/sql_class.h: - Added comment for clarity sql/sql_parse.cc: - Added comment for clarity sql/sql_prepare.cc: - Disallow ALTER VIEW as prepared statements until they are properly supported. Note that SQLCOM_CREATE_VIEW also handles ALTER VIEW statements. sql/sql_view.cc: - converted to doxygen comments - Added comment for clarity sql/sql_yacc.yy: - Disallow ALTER VIEW statements within a SP. If the parser is operating within the SP context, this is shown on the sp->sphead pointer. If this flag is set for view DDL operations we stop parsing with the error 'ER_SP_BAD_STATEMENT'.
Diffstat (limited to 'mysql-test/t/sp-error.test')
-rw-r--r--mysql-test/t/sp-error.test10
1 files changed, 5 insertions, 5 deletions
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index ec91be13ba0..240cda67edc 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1087,12 +1087,12 @@ delimiter ;|
#
# BUG 12490 (Packets out of order if calling HELP CONTENTS from Stored Procedure)
#
---error 1314
+--error ER_SP_BADSTATEMENT
CREATE PROCEDURE BUG_12490() HELP CONTENTS;
---error 1314
+--error ER_SP_BADSTATEMENT
CREATE FUNCTION BUG_12490() RETURNS INT HELP CONTENTS;
CREATE TABLE t_bug_12490(a int);
---error 1314
+--error ER_SP_BADSTATEMENT
CREATE TRIGGER BUG_12490 BEFORE UPDATE ON t_bug_12490 FOR EACH ROW HELP CONTENTS;
DROP TABLE t_bug_12490;
@@ -1397,9 +1397,9 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create view v1 as sele
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
CREATE FUNCTION bug_13627_f() returns int BEGIN create view v1 as select 1; return 1; END |
--- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+-- error ER_SP_BADSTATEMENT
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN alter view v1 as select 1; END |
--- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
+-- error ER_SP_BADSTATEMENT
CREATE FUNCTION bug_13627_f() returns int BEGIN alter view v1 as select 1; return 1; END |
-- error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG