diff options
author | unknown <dlenev@mysql.com> | 2005-07-13 23:51:09 +0400 |
---|---|---|
committer | unknown <dlenev@mysql.com> | 2005-07-13 23:51:09 +0400 |
commit | 4c197d99a108c03ea15a50f137e08c31179c3d10 (patch) | |
tree | d328741cf1b76e15b7a48083f5fe1872bd7a130c /sql/sql_trigger.cc | |
parent | 7001961e255dd454fe79311d5721dc9223f662e0 (diff) | |
download | mariadb-git-4c197d99a108c03ea15a50f137e08c31179c3d10.tar.gz |
Now when we create or drop trigger we will open only subject table and not
all tables suggested by prelocking algorithm.
Added test for bug #11889 "Server crashes when dropping trigger using stored
routine" (which was fixed by previous patch).
mysql-test/r/trigger.result:
Since we are using open_ltable() now to open table for trigger creation, code
for error when we try to create trigger on view has changed to equivalent one.
Added test for bug #11889 "Server crashes when dropping trigger using stored
routine".
mysql-test/t/trigger.test:
Since we are using open_ltable() now to open table for trigger creation, code
for error when we try to create trigger on view has changed to equivalent one.
Added test for bug #11889 "Server crashes when dropping trigger using stored
routine".
sql/sql_trigger.cc:
mysql_create_or_drop_trigger():
It is better to open only table for which we are going to create or drop
trigger with open_ltable() since we don't really need working prelocking
in this case.
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r-- | sql/sql_trigger.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index f058c306d42..fd79fc8b878 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -69,7 +69,10 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) But do we want this ? */ - if (open_and_lock_tables(thd, tables)) + /* We should have only one table in table list. */ + DBUG_ASSERT(tables->next_global == 0); + + if (!(table= open_ltable(thd, tables, tables->lock_type))) DBUG_RETURN(TRUE); /* @@ -80,8 +83,6 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) if (check_global_access(thd, SUPER_ACL)) DBUG_RETURN(TRUE); - table= tables->table; - /* We do not allow creation of triggers on views or temporary tables. We have to do this check here and not in |