summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorunknown <anozdrin@mysql.com>2005-10-25 00:54:04 +0400
committerunknown <anozdrin@mysql.com>2005-10-25 00:54:04 +0400
commit33d5d4ad99e8314d3e5f2be0cfd96b53a3ced05a (patch)
treec838d6ebef039a3f3e64690c5775689686bbf606 /sql/sql_prepare.cc
parentd29ecd5e91adf6eaeb4f2afef0db30648fe08065 (diff)
downloadmariadb-git-33d5d4ad99e8314d3e5f2be0cfd96b53a3ced05a.tar.gz
Fix for BUG#13095: Cannot create VIEWs in prepared statements
- allow CREATE VIEW as well as DROP VIEW to use in prepared statements; - fix CREATE VIEW implementation to make it work in prepared statements. mysql-test/r/sp.result: Results file for the test case for BUG#13095. mysql-test/t/sp.test: Test case for BUG#13095. sql/sql_lex.h: Added a variable to remember start of whole CREATE VIEW statement as well as start of its SELECT part. sql/sql_prepare.cc: Allow CREATE VIEW and DROP VIEW to use in prepared statements. sql/sql_view.cc: Use stored start of whole CREATE VIEW statement instead of thd->query, which differs from the original when prepared statement is executing. sql/sql_yacc.yy: Remember start of whole CREATE VIEW statement as well as start of its SELECT part.
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 5f3539ca1e9..865c597e00d 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1742,6 +1742,8 @@ static bool check_prepared_statement(Prepared_statement *stmt,
case SQLCOM_ROLLBACK:
case SQLCOM_TRUNCATE:
case SQLCOM_CALL:
+ case SQLCOM_CREATE_VIEW:
+ case SQLCOM_DROP_VIEW:
break;
default: