Commit 5f462f96 authored by unknown's avatar unknown

Add a test case for Bug#27248 Triggers: error if insert affects temporary

table.
The bug itself is yet another manifestation of Bug 26141.


mysql-test/r/trigger.result:
  Update results.
mysql-test/t/trigger.test:
  Add a test case for Bug#27248 Triggers: error if insert affects temporary
  table
parent cff1088d
...@@ -1933,4 +1933,32 @@ Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi ...@@ -1933,4 +1933,32 @@ Before UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi
After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE After UPDATE, new=multi-UPDATE, SET for t2, but the trigger is fired, old=multi-UPDATE
drop view v1; drop view v1;
drop table t1, t2, t1_op_log; drop table t1, t2, t1_op_log;
Bug#27248 Triggers: error if insert affects temporary table
The bug was fixed by the fix for Bug#26141
drop table if exists t1;
drop temporary table if exists t2;
create table t1 (s1 int);
create temporary table t2 (s1 int);
create trigger t1_bi before insert on t1 for each row insert into t2 values (0);
create trigger t1_bd before delete on t1 for each row delete from t2;
insert into t1 values (0);
insert into t1 values (0);
select * from t1;
s1
0
0
select * from t2;
s1
0
0
delete from t1;
select * from t1;
s1
select * from t2;
s1
drop table t1;
drop temporary table t2;
End of 5.0 tests End of 5.0 tests
...@@ -2194,4 +2194,27 @@ drop table t1, t2, t1_op_log; ...@@ -2194,4 +2194,27 @@ drop table t1, t2, t1_op_log;
# #
# TODO: test LOAD DATA INFILE # TODO: test LOAD DATA INFILE
#
--echo
--echo Bug#27248 Triggers: error if insert affects temporary table
--echo
--echo The bug was fixed by the fix for Bug#26141
--echo
--disable_warnings
drop table if exists t1;
drop temporary table if exists t2;
--enable_warnings
create table t1 (s1 int);
create temporary table t2 (s1 int);
create trigger t1_bi before insert on t1 for each row insert into t2 values (0);
create trigger t1_bd before delete on t1 for each row delete from t2;
insert into t1 values (0);
insert into t1 values (0);
select * from t1;
select * from t2;
delete from t1;
select * from t1;
select * from t2;
drop table t1;
drop temporary table t2;
--echo End of 5.0 tests --echo End of 5.0 tests
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