Commit 97cbcbb0 authored by unknown's avatar unknown

After merge fixes for WL#1218 "Triggers"


mysql-test/t/trigger.test:
  After merge fix, error codes corrected.
sql/sp_head.cc:
  After mrege fix. Fixed typo.
sql/sql_trigger.cc:
  After merge fix. wait_if_gloabl_read_lock has one more argument now.
parent eb75a9fd
...@@ -151,15 +151,15 @@ drop table t1; ...@@ -151,15 +151,15 @@ drop table t1;
# #
create table t1 (i int); create table t1 (i int);
--error 1362 --error 1363
create trigger trg before insert on t1 for each row set @a:= old.i; create trigger trg before insert on t1 for each row set @a:= old.i;
--error 1362 --error 1363
create trigger trg before delete on t1 for each row set @a:= new.i; create trigger trg before delete on t1 for each row set @a:= new.i;
--error 1361
create trigger trg before update on t1 for each row set old.i:=1;
--error 1362 --error 1362
create trigger trg before update on t1 for each row set old.i:=1;
--error 1363
create trigger trg before delete on t1 for each row set new.i:=1; create trigger trg before delete on t1 for each row set new.i:=1;
--error 1361 --error 1362
create trigger trg after update on t1 for each row set new.i:=1; create trigger trg after update on t1 for each row set new.i:=1;
# TODO: We should also test wrong field names here, we don't do it now # TODO: We should also test wrong field names here, we don't do it now
# because proper error handling is not in place yet. # because proper error handling is not in place yet.
...@@ -173,23 +173,23 @@ create trigger trg after update on t1 for each row set new.i:=1; ...@@ -173,23 +173,23 @@ create trigger trg after update on t1 for each row set new.i:=1;
create trigger trg before insert on t2 for each row set @a:=1; create trigger trg before insert on t2 for each row set @a:=1;
create trigger trg before insert on t1 for each row set @a:=1; create trigger trg before insert on t1 for each row set @a:=1;
--error 1358 --error 1359
create trigger trg after insert on t1 for each row set @a:=1; create trigger trg after insert on t1 for each row set @a:=1;
--error 1358 --error 1359
create trigger trg2 before insert on t1 for each row set @a:=1; create trigger trg2 before insert on t1 for each row set @a:=1;
drop trigger t1.trg; drop trigger t1.trg;
--error 1359 --error 1360
drop trigger t1.trg; drop trigger t1.trg;
create view v1 as select * from t1; create view v1 as select * from t1;
--error 1360 --error 1361
create trigger trg before insert on v1 for each row set @a:=1; create trigger trg before insert on v1 for each row set @a:=1;
drop view v1; drop view v1;
drop table t1; drop table t1;
create temporary table t1 (i int); create temporary table t1 (i int);
--error 1360 --error 1361
create trigger trg before insert on t1 for each row set @a:=1; create trigger trg before insert on t1 for each row set @a:=1;
drop table t1; drop table t1;
...@@ -311,9 +311,8 @@ sp_head::init_strings(THD *thd, LEX *lex, sp_name *name) ...@@ -311,9 +311,8 @@ sp_head::init_strings(THD *thd, LEX *lex, sp_name *name)
} }
else if (thd->db) else if (thd->db)
{ {
m_db.length= thd->db_length m_db.length= thd->db_length;
m_db.str= strmake_root(root, thd->db, m_db.length); m_db.str= strmake_root(root, thd->db, m_db.length);
} }
if (m_param_begin && m_param_end) if (m_param_begin && m_param_end)
......
...@@ -88,7 +88,7 @@ int mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) ...@@ -88,7 +88,7 @@ int mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
again until we are done. (Acquiring LOCK_open is not enough because again until we are done. (Acquiring LOCK_open is not enough because
global read lock is held without helding LOCK_open). global read lock is held without helding LOCK_open).
*/ */
if (wait_if_global_read_lock(thd, 0)) if (wait_if_global_read_lock(thd, 0, 0))
DBUG_RETURN(-1); DBUG_RETURN(-1);
VOID(pthread_mutex_lock(&LOCK_open)); VOID(pthread_mutex_lock(&LOCK_open));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment