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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
945ffb2f
Commit
945ffb2f
authored
Aug 18, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB-504 test insert select with various triggers to make sure that bulk fetch will work
parent
56126798
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
401 additions
and
0 deletions
+401
-0
mysql-test/suite/tokudb/r/bf_insert_select_trigger.result
mysql-test/suite/tokudb/r/bf_insert_select_trigger.result
+45
-0
mysql-test/suite/tokudb/r/bf_insert_select_update_trigger.result
...est/suite/tokudb/r/bf_insert_select_update_trigger.result
+121
-0
mysql-test/suite/tokudb/t/bf_insert_select_trigger.test
mysql-test/suite/tokudb/t/bf_insert_select_trigger.test
+65
-0
mysql-test/suite/tokudb/t/bf_insert_select_update_trigger.test
...-test/suite/tokudb/t/bf_insert_select_update_trigger.test
+170
-0
No files found.
mysql-test/suite/tokudb/r/bf_insert_select_trigger.result
0 → 100644
View file @
945ffb2f
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;
insert into t select * from s;
rollback;
create trigger t_trigger before insert on t for each row insert into s values (1000000,0);
begin;
insert 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 insert into s values (1000000,0);
begin;
insert 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;
insert 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;
insert 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;
insert 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;
insert 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/r/bf_insert_select_update_trigger.result
0 → 100644
View file @
945ffb2f
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;
insert into t select * from s;
rollback;
create trigger t_trigger before insert on t for each row insert into s values (1000000,0);
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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 insert into s values (1000000,0);
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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;
insert into t select * from s on duplicate key update x=t.x+1;
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;
insert into t select * from s on duplicate key update x=t.x+1;
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;
insert into t select * from s on duplicate key update x=t.x+1;
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;
insert into t select * from s on duplicate key update x=t.x+1;
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,0);
create trigger t_trigger before insert on t for each row insert into s values (1000000,0);
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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 insert into s values (1000000,0);
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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;
insert into t select * from s on duplicate key update x=t.x+1;
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;
insert into t select * from s on duplicate key update x=t.x+1;
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;
insert into t select * from s on duplicate key update x=t.x+1;
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;
insert into t select * from s on duplicate key update x=t.x+1;
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,0);
create trigger t_trigger before update on t for each row insert into s values (1000000,0);
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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 update on t for each row insert into s values (1000000,0);
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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 update on t for each row delete from s where id=1000000;
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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 update on t for each row delete from s where id=1000000;
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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 update on t for each row update s set x=x+1 where id=1000000;
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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 update on t for each row update s set x=x+1 where id=1000000;
begin;
insert into t select * from s on duplicate key update x=t.x+1;
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_insert_select_trigger.test
0 → 100644
View file @
945ffb2f
# verify that various insert triggers can not execute on the source table for an insert 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
;
insert
into
t
select
*
from
s
;
rollback
;
# verify that before insert triggers can not insert into the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
insert
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
insert
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not insert into the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
insert
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
insert
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
;
insert
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
;
insert
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
;
insert
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
;
insert
into
t
select
*
from
s
;
rollback
;
drop
trigger
t_trigger
;
drop
table
s
,
t
;
mysql-test/suite/tokudb/t/bf_insert_select_update_trigger.test
0 → 100644
View file @
945ffb2f
# verify that various insert triggers can not execute on the source table for an insert 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
;
insert
into
t
select
*
from
s
;
rollback
;
# insert into t values (1,0);
# verify that before insert triggers can not insert into the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
insert
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not insert into the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
insert
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# force duplicate keys
truncate
table
t
;
insert
into
t
values
(
1
,
0
);
# verify that before insert triggers can not insert into the source table
create
trigger
t_trigger
before
insert
on
t
for
each
row
insert
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not insert into the source table
create
trigger
t_trigger
after
insert
on
t
for
each
row
insert
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# force duplicate keys
truncate
table
t
;
insert
into
t
values
(
1
,
0
);
# verify that before insert triggers can not insert into the source table
create
trigger
t_trigger
before
update
on
t
for
each
row
insert
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not insert into the source table
create
trigger
t_trigger
after
update
on
t
for
each
row
insert
into
s
values
(
1000000
,
0
);
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# verify that before update triggers can not delete from the source table
create
trigger
t_trigger
before
update
on
t
for
each
row
delete
from
s
where
id
=
1000000
;
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not delete from the source table
create
trigger
t_trigger
after
update
on
t
for
each
row
delete
from
s
where
id
=
1000000
;
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# verify that before update triggers can not update the source table
create
trigger
t_trigger
before
update
on
t
for
each
row
update
s
set
x
=
x
+
1
where
id
=
1000000
;
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
rollback
;
drop
trigger
t_trigger
;
# verify that after insert triggers can not update the source table
create
trigger
t_trigger
after
update
on
t
for
each
row
update
s
set
x
=
x
+
1
where
id
=
1000000
;
begin
;
error
1442
;
insert
into
t
select
*
from
s
on
duplicate
key
update
x
=
t
.
x
+
1
;
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