Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
adf1e56e
Commit
adf1e56e
authored
Aug 18, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB-504 test replace select triggers for bulk fetch
parent
401e0e5d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
290 additions
and
0 deletions
+290
-0
mysql-test/suite/tokudb/r/bf_replace_select_trigger.result
mysql-test/suite/tokudb/r/bf_replace_select_trigger.result
+121
-0
mysql-test/suite/tokudb/t/bf_replace_select_trigger.test
mysql-test/suite/tokudb/t/bf_replace_select_trigger.test
+169
-0
No files found.
mysql-test/suite/tokudb/r/bf_replace_select_trigger.result
0 → 100644
View file @
adf1e56e
set default_storage_engine='tokudb';
drop table if exists s,t;
create table s (id bigint not null primary key, x bigint);
insert into s values (1,0),(2,0),(3,0),(4,0);
create table t like s;
begin;
replace into t select * from s;
rollback;
create trigger t_trigger before insert on t for each row replace into s values (1000000,0);
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after insert on t for each row replace into s values (1000000,0);
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger before insert on t for each row delete from s where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after insert on t for each row delete from s where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger before insert on t for each row update s set x=x+1 where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after insert on t for each row update s set x=x+1 where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
truncate table t;
insert into t values (1,1);
create trigger t_trigger before insert on t for each row replace into s values (1000000,0);
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after insert on t for each row replace into s values (1000000,0);
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger before insert on t for each row delete from s where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after insert on t for each row delete from s where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger before insert on t for each row update s set x=x+1 where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after insert on t for each row update s set x=x+1 where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
truncate table t;
insert into t values (1,1);
create trigger t_trigger before delete on t for each row replace into s values (1000000,0);
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after delete on t for each row replace into s values (1000000,0);
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger before delete on t for each row delete from s where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after delete on t for each row delete from s where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger before delete on t for each row update s set x=x+1 where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
create trigger t_trigger after delete on t for each row update s set x=x+1 where id=1000000;
begin;
replace into t select * from s;
ERROR HY000: Can't update table 's' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
rollback;
drop trigger t_trigger;
drop table s,t;
mysql-test/suite/tokudb/t/bf_replace_select_trigger.test
0 → 100644
View file @
adf1e56e
# verify that various insert and update triggers can not execute on the source table
# for a replace select statement
source
include
/
have_tokudb
.
inc
;
set
default_storage_engine
=
'tokudb'
;
disable_warnings
;
drop
table
if
exists
s
,
t
;
enable_warnings
;
create
table
s
(
id
bigint
not
null
primary
key
,
x
bigint
);
insert
into
s
values
(
1
,
0
),(
2
,
0
),(
3
,
0
),(
4
,
0
);
create
table
t
like
s
;
begin
;
replace
into
t
select
*
from
s
;
rollback
;
# verify that before insert triggers can not replace into the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
replace
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not replace into the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
replace
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that before insert triggers can not delete from the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
delete
from
s
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not delete from the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
delete
from
s
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that before insert triggers can not update the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
update
s
set
x
=
x
+
1
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not update the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
update
s
set
x
=
x
+
1
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
truncate
table
t
;
insert
into
t
values
(
1
,
1
);
# verify that before insert triggers can not replace into the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
replace
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not replace into the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
replace
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that before insert triggers can not delete from the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
delete
from
s
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not delete from the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
delete
from
s
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that before insert triggers can not update the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
update
s
set
x
=
x
+
1
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not update the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
update
s
set
x
=
x
+
1
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
truncate
table
t
;
insert
into
t
values
(
1
,
1
);
# verify that before delete triggers can not replace into the source table
create
trigger
t_trigger
before
delete
on
t
for
each
row
replace
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after delete triggers can not replace into the source table
create
trigger
t_trigger
after
delete
on
t
for
each
row
replace
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that before delete triggers can not delete from the source table
create
trigger
t_trigger
before
delete
on
t
for
each
row
delete
from
s
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after delete triggers can not delete from the source table
create
trigger
t_trigger
after
delete
on
t
for
each
row
delete
from
s
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that before delete triggers can not update the source table
create
trigger
t_trigger
before
delete
on
t
for
each
row
update
s
set
x
=
x
+
1
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after delete triggers can not update the source table
create
trigger
t_trigger
after
delete
on
t
for
each
row
update
s
set
x
=
x
+
1
where
id
=
1000000
;
begin
;
error
1442
;
replace
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
drop
table
s
,
t
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment