summaryrefslogtreecommitdiff
path: root/sql/sql_view.h
diff options
context:
space:
mode:
authorunknown <davi@mysql.com/endora.local>2008-02-21 14:58:29 -0300
committerunknown <davi@mysql.com/endora.local>2008-02-21 14:58:29 -0300
commit315665cf67dd4e56922955b051eff2c384f2298e (patch)
tree09d15a0c10b54a7ad010fa850101c4816d4e0d16 /sql/sql_view.h
parentfa08b280857fde69a70c68bd07797624a52ef262 (diff)
downloadmariadb-git-315665cf67dd4e56922955b051eff2c384f2298e.tar.gz
Bug#32890 Crash after repeated create and drop of tables and views
The problem is that CREATE VIEW statements inside prepared statements weren't being expanded during the prepare phase, which leads to objects not being allocated in the appropriate memory arenas. The solution is to perform the validation of CREATE VIEW statements during the prepare phase of a prepared statement. The validation during the prepare phase assures that transformations of the parsed tree will use the permanent arena of the prepared statement. mysql-test/r/ps.result: Add test case result for Bug#32890 mysql-test/t/ps.test: Add test case for Bug#32890 sql/item.h: Restore original field name if name is auto generated. sql/sql_prepare.cc: Validate and prepare a CREATE VIEW statement for execution. sql/sql_view.cc: Move privileges check to it's own function. sql/sql_view.h: Export function which check privileges of a CREATE VIEW statement.
Diffstat (limited to 'sql/sql_view.h')
-rw-r--r--sql/sql_view.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_view.h b/sql/sql_view.h
index ab0920e0bf2..1d45283352b 100644
--- a/sql/sql_view.h
+++ b/sql/sql_view.h
@@ -15,6 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
+ enum_view_create_mode mode);
+
bool mysql_create_view(THD *thd, TABLE_LIST *view,
enum_view_create_mode mode);