Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1958 05/06/09 01:09:05 konstantin@stripped +3 -0
Disable dynamic SQL in stored routines.
This is to close Bug#10975, Bug#7115, Bug#10605
This feature will be implemented in a future release.
sql/sql_yacc.yy
1.394 05/06/09 01:09:00 konstantin@stripped +15 -0
Disable dynamic SQL in stored routines.
mysql-test/t/sp-error.test
1.73 05/06/09 01:09:00 konstantin@stripped +21 -0
Test coverage to disable Dynamic SQL in stored routines.
mysql-test/r/sp-error.result
1.71 05/06/09 01:09:00 konstantin@stripped +14 -0
Test results fixed (test coverage for disabled Dynamic SQL in SP).
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: konstantin
# Host: dragonfly.local
# Root: /opt/local/work/mysql-5.0-10975
--- 1.393/sql/sql_yacc.yy 2005-06-08 10:37:33 +04:00
+++ 1.394/sql/sql_yacc.yy 2005-06-09 01:09:00 +04:00
@@ -919,6 +919,11 @@
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "DEALLOCATE");
+ YYABORT;
+ }
lex->sql_command= SQLCOM_DEALLOCATE_PREPARE;
lex->prepared_stmt_name= $3;
};
@@ -939,6 +944,11 @@
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "PREPARE");
+ YYABORT;
+ }
lex->sql_command= SQLCOM_PREPARE;
lex->prepared_stmt_name= $2;
};
@@ -969,6 +979,11 @@
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
+ if (lex->sphead)
+ {
+ my_error(ER_SP_BADSTATEMENT, MYF(0), "EXECUTE");
+ YYABORT;
+ }
lex->sql_command= SQLCOM_EXECUTE;
lex->prepared_stmt_name= $2;
}
--- 1.70/mysql-test/r/sp-error.result 2005-06-01 17:42:34 +04:00
+++ 1.71/mysql-test/r/sp-error.result 2005-06-09 01:09:00 +04:00
@@ -672,3 +672,17 @@
end|
drop procedure bug10969|
drop table t1|
+prepare stmt from "select 1";
+create procedure p() deallocate prepare stmt;
+ERROR 0A000: DEALLOCATE is not allowed in stored procedures
+create function f() returns int begin deallocate prepare stmt;
+ERROR 0A000: DEALLOCATE is not allowed in stored procedures
+create procedure p() prepare stmt from "select 1";
+ERROR 0A000: PREPARE is not allowed in stored procedures
+create function f() returns int begin prepare stmt from "select 1";
+ERROR 0A000: PREPARE is not allowed in stored procedures
+create procedure p() execute stmt;
+ERROR 0A000: EXECUTE is not allowed in stored procedures
+create function f() returns int begin execute stmt;
+ERROR 0A000: EXECUTE is not allowed in stored procedures
+deallocate prepare stmt;
--- 1.72/mysql-test/t/sp-error.test 2005-06-01 17:42:34 +04:00
+++ 1.73/mysql-test/t/sp-error.test 2005-06-09 01:09:00 +04:00
@@ -965,3 +965,24 @@
drop table t1|
delimiter ;|
+
+#
+# Bug#10975, #10605, #7115: Dynamic SQL by means of
+# PREPARE/EXECUTE/DEALLOCATE is not supported yet.
+# Check that an error message is returned.
+#
+prepare stmt from "select 1";
+--error ER_SP_BADSTATEMENT
+create procedure p() deallocate prepare stmt;
+--error ER_SP_BADSTATEMENT
+create function f() returns int begin deallocate prepare stmt;
+--error ER_SP_BADSTATEMENT
+create procedure p() prepare stmt from "select 1";
+--error ER_SP_BADSTATEMENT
+create function f() returns int begin prepare stmt from "select 1";
+--error ER_SP_BADSTATEMENT
+create procedure p() execute stmt;
+--error ER_SP_BADSTATEMENT
+create function f() returns int begin execute stmt;
+deallocate prepare stmt;
+
| Thread |
|---|
| • bk commit into 5.0 tree (konstantin:1.1958) BUG#10605 | konstantin | 8 Jun |