summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2006-06-27 17:16:02 -0700
committerunknown <jimw@mysql.com>2006-06-27 17:16:02 -0700
commit88afd72b47973afa087a34299f1a3a9e12d143ca (patch)
tree01d1b2354252ecf262d2bb8ba58fc308c1d3d828 /sql/sql_trigger.cc
parentc3cb46908c30895e0aafa0f7602370240a3c5a98 (diff)
downloadmariadb-git-88afd72b47973afa087a34299f1a3a9e12d143ca.tar.gz
Bug #18005: Creating a trigger on mysql.event leads to server crash on scheduler startup
Bug #18361: Triggers on mysql.user table cause server crash Because they do not work, we do not allow creating triggers on tables within the 'mysql' schema. (They may be made to work and re-enabled at some later date, but not in 5.0 or 5.1.) mysql-test/r/trigger.result: Add new results mysql-test/t/trigger.test: Add new regression test for creating triggers on system schema sql/share/errmsg.txt: Add new error message sql/sql_trigger.cc: Disallow creating triggers on tables in the 'mysql' schema
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r--sql/sql_trigger.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index f943b014118..74e36de500c 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -183,6 +183,15 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
!(tables= add_table_for_trigger(thd, thd->lex->spname)))
DBUG_RETURN(TRUE);
+ /*
+ We don't allow creating triggers on tables in the 'mysql' schema
+ */
+ if (create && !my_strcasecmp(system_charset_info, "mysql", tables->db))
+ {
+ my_error(ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
+
/* We should have only one table in table list. */
DBUG_ASSERT(tables->next_global == 0);