mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-11816 Disallow CREATE TEMPORARY TABLE…ROW_FORMAT=COMPRESSED
MySQL 5.7 allows temporary tables to be created in ROW_FORMAT=COMPRESSED. The usefulness of this is questionable. WL#7899 in MySQL 8.0.0 prevents the creation of such compressed tables, so that all InnoDB temporary tables will be located inside the predefined InnoDB temporary tablespace. Pick up and adjust some tests from MySQL 5.7 and 8.0. dict_tf_to_fsp_flags(): Remove the parameter is_temp. fsp_flags_init(): Remove the parameter is_temporary. row_mysql_drop_temp_tables(): Remove. There cannot be any temporary tables in InnoDB. (This never removed #sql* tables in the datadir which were created by DDL.) dict_table_t::dir_path_of_temp_table: Remove. create_table_info_t::m_temp_path: Remove. create_table_info_t::create_options_are_invalid(): Do not allow ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE for temporary tables. create_table_info_t::innobase_table_flags(): Do not unnecessarily prevent CREATE TEMPORARY TABLE with SPATIAL INDEX. (MySQL 5.7 does allow this.) fil_space_belongs_in_lru(): The only FIL_TYPE_TEMPORARY tablespace is never subjected to closing least-recently-used files.
This commit is contained in:
@ -1,598 +0,0 @@
|
||||
create temporary table t1
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb;
|
||||
create temporary table t2
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb;
|
||||
create procedure populate_t1()
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= 200) do
|
||||
insert into t1 values (i, 'a', 'b');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
create procedure populate_t1_small()
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= 20) do
|
||||
insert into t1 values (i, 'c', 'd');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
create procedure populate_t1_small2()
|
||||
begin
|
||||
declare i int default 30;
|
||||
while (i <= 50) do
|
||||
insert into t1 values (i, 'e', 'f');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
begin;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
1 a b
|
||||
2 a b
|
||||
3 a b
|
||||
4 a b
|
||||
5 a b
|
||||
6 a b
|
||||
7 a b
|
||||
8 a b
|
||||
9 a b
|
||||
10 a b
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
begin;
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
call populate_t1_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20
|
||||
truncate table t1;
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
delete from t1 where keyc <= 60;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
140
|
||||
call populate_t1_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
160
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
1 c d
|
||||
2 c d
|
||||
3 c d
|
||||
4 c d
|
||||
5 c d
|
||||
6 c d
|
||||
7 c d
|
||||
8 c d
|
||||
9 c d
|
||||
10 c d
|
||||
begin;
|
||||
call populate_t1_small2();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
181
|
||||
select * from t1 where keyc > 30 limit 10;
|
||||
keyc c1 c2
|
||||
31 e f
|
||||
32 e f
|
||||
33 e f
|
||||
34 e f
|
||||
35 e f
|
||||
36 e f
|
||||
37 e f
|
||||
38 e f
|
||||
39 e f
|
||||
40 e f
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
160
|
||||
select * from t1 where keyc > 30 limit 10;
|
||||
keyc c1 c2
|
||||
61 a b
|
||||
62 a b
|
||||
63 a b
|
||||
64 a b
|
||||
65 a b
|
||||
66 a b
|
||||
67 a b
|
||||
68 a b
|
||||
69 a b
|
||||
70 a b
|
||||
update t1 set keyc = keyc + 2000;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
rollback;
|
||||
begin;
|
||||
update t1 set keyc = keyc + 2000;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
4001 c d
|
||||
4002 c d
|
||||
4003 c d
|
||||
4004 c d
|
||||
4005 c d
|
||||
4006 c d
|
||||
4007 c d
|
||||
4008 c d
|
||||
4009 c d
|
||||
4010 c d
|
||||
rollback;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
commit;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
insert into t2 select * from t1 where keyc < 2101;
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
60
|
||||
drop procedure populate_t1;
|
||||
drop procedure populate_t1_small;
|
||||
drop procedure populate_t1_small2;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
create temporary table t1
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb key_block_size = 4;
|
||||
set innodb_strict_mode=off;
|
||||
create temporary table t2
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb key_block_size = 8;
|
||||
set innodb_strict_mode=default;
|
||||
create procedure populate_t1()
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= 200) do
|
||||
insert into t1 values (i, 'a', 'b');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
create procedure populate_t1_small()
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= 20) do
|
||||
insert into t1 values (i, 'c', 'd');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
create procedure populate_t1_small2()
|
||||
begin
|
||||
declare i int default 30;
|
||||
while (i <= 50) do
|
||||
insert into t1 values (i, 'e', 'f');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
begin;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
1 a b
|
||||
2 a b
|
||||
3 a b
|
||||
4 a b
|
||||
5 a b
|
||||
6 a b
|
||||
7 a b
|
||||
8 a b
|
||||
9 a b
|
||||
10 a b
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
begin;
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
call populate_t1_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20
|
||||
truncate table t1;
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
delete from t1 where keyc <= 60;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
140
|
||||
call populate_t1_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
160
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
1 c d
|
||||
2 c d
|
||||
3 c d
|
||||
4 c d
|
||||
5 c d
|
||||
6 c d
|
||||
7 c d
|
||||
8 c d
|
||||
9 c d
|
||||
10 c d
|
||||
begin;
|
||||
call populate_t1_small2();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
181
|
||||
select * from t1 where keyc > 30 limit 10;
|
||||
keyc c1 c2
|
||||
31 e f
|
||||
32 e f
|
||||
33 e f
|
||||
34 e f
|
||||
35 e f
|
||||
36 e f
|
||||
37 e f
|
||||
38 e f
|
||||
39 e f
|
||||
40 e f
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
160
|
||||
select * from t1 where keyc > 30 limit 10;
|
||||
keyc c1 c2
|
||||
61 a b
|
||||
62 a b
|
||||
63 a b
|
||||
64 a b
|
||||
65 a b
|
||||
66 a b
|
||||
67 a b
|
||||
68 a b
|
||||
69 a b
|
||||
70 a b
|
||||
update t1 set keyc = keyc + 2000;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
rollback;
|
||||
begin;
|
||||
update t1 set keyc = keyc + 2000;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
4001 c d
|
||||
4002 c d
|
||||
4003 c d
|
||||
4004 c d
|
||||
4005 c d
|
||||
4006 c d
|
||||
4007 c d
|
||||
4008 c d
|
||||
4009 c d
|
||||
4010 c d
|
||||
rollback;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
commit;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
insert into t2 select * from t1 where keyc < 2101;
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
60
|
||||
drop procedure populate_t1;
|
||||
drop procedure populate_t1_small;
|
||||
drop procedure populate_t1_small2;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
set global innodb_file_per_table = 0;
|
||||
create temporary table t1
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb;
|
||||
create temporary table t2
|
||||
(keyc int, c1 char(100), c2 char(100),
|
||||
primary key(keyc), index sec_index(c1)
|
||||
) engine = innodb;
|
||||
create procedure populate_t1()
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= 200) do
|
||||
insert into t1 values (i, 'a', 'b');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
create procedure populate_t1_small()
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= 20) do
|
||||
insert into t1 values (i, 'c', 'd');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
create procedure populate_t1_small2()
|
||||
begin
|
||||
declare i int default 30;
|
||||
while (i <= 50) do
|
||||
insert into t1 values (i, 'e', 'f');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
begin;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
1 a b
|
||||
2 a b
|
||||
3 a b
|
||||
4 a b
|
||||
5 a b
|
||||
6 a b
|
||||
7 a b
|
||||
8 a b
|
||||
9 a b
|
||||
10 a b
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
begin;
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
call populate_t1_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20
|
||||
truncate table t1;
|
||||
call populate_t1();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
200
|
||||
delete from t1 where keyc <= 60;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
140
|
||||
call populate_t1_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
160
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
1 c d
|
||||
2 c d
|
||||
3 c d
|
||||
4 c d
|
||||
5 c d
|
||||
6 c d
|
||||
7 c d
|
||||
8 c d
|
||||
9 c d
|
||||
10 c d
|
||||
begin;
|
||||
call populate_t1_small2();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
181
|
||||
select * from t1 where keyc > 30 limit 10;
|
||||
keyc c1 c2
|
||||
31 e f
|
||||
32 e f
|
||||
33 e f
|
||||
34 e f
|
||||
35 e f
|
||||
36 e f
|
||||
37 e f
|
||||
38 e f
|
||||
39 e f
|
||||
40 e f
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
160
|
||||
select * from t1 where keyc > 30 limit 10;
|
||||
keyc c1 c2
|
||||
61 a b
|
||||
62 a b
|
||||
63 a b
|
||||
64 a b
|
||||
65 a b
|
||||
66 a b
|
||||
67 a b
|
||||
68 a b
|
||||
69 a b
|
||||
70 a b
|
||||
update t1 set keyc = keyc + 2000;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
rollback;
|
||||
begin;
|
||||
update t1 set keyc = keyc + 2000;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
4001 c d
|
||||
4002 c d
|
||||
4003 c d
|
||||
4004 c d
|
||||
4005 c d
|
||||
4006 c d
|
||||
4007 c d
|
||||
4008 c d
|
||||
4009 c d
|
||||
4010 c d
|
||||
rollback;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
commit;
|
||||
select * from t1 limit 10;
|
||||
keyc c1 c2
|
||||
2001 c d
|
||||
2002 c d
|
||||
2003 c d
|
||||
2004 c d
|
||||
2005 c d
|
||||
2006 c d
|
||||
2007 c d
|
||||
2008 c d
|
||||
2009 c d
|
||||
2010 c d
|
||||
insert into t2 select * from t1 where keyc < 2101;
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
60
|
||||
drop procedure populate_t1;
|
||||
drop procedure populate_t1_small;
|
||||
drop procedure populate_t1_small2;
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
set global innodb_file_per_table = 1;
|
@ -1,667 +0,0 @@
|
||||
create procedure populate_tables()
|
||||
begin
|
||||
declare n int default 20;
|
||||
declare inner_loop int default 100;
|
||||
set global innodb_file_per_table=on;
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
create temporary table t1(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=redundant;
|
||||
create temporary table t2(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=compact;
|
||||
create temporary table t3(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=compressed key_block_size=4;
|
||||
create temporary table t4(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb row_format=dynamic;
|
||||
create temporary table t5(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
primary key (c1),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb;
|
||||
create temporary table t6 ( a int ) engine = innodb;
|
||||
insert into t6 values (50),(100),(150),(190);
|
||||
while (n > 0) do
|
||||
start transaction;
|
||||
insert into t1 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
insert into t2 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
insert into t3 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
insert into t4 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
insert into t5 values(n,n,repeat(concat(' tc3_',n),30),
|
||||
repeat(concat(' tc4_',n),800),repeat(concat(' tc_',n),800),
|
||||
repeat(concat(' tc6_',n),800),repeat(concat(' tc7_',n),800),
|
||||
now(),(100.55+n));
|
||||
if (n > 10) then
|
||||
commit;
|
||||
else
|
||||
delete from t1 where c1 > 10 ;
|
||||
delete from t2 where c1 > 10 ;
|
||||
delete from t3 where c1 > 10 ;
|
||||
delete from t4 where c1 > 10 ;
|
||||
delete from t5 where c1 > 10 ;
|
||||
rollback;
|
||||
start transaction;
|
||||
update t1 set c1 = c1 + 1000 where c1 > 10;
|
||||
update t2 set c1 = c1 + 1000 where c1 > 10;
|
||||
update t3 set c1 = c1 + 1000 where c1 > 10;
|
||||
update t4 set c1 = c1 + 1000 where c1 > 10;
|
||||
update t5 set c1 = c1 + 1000 where c1 > 10;
|
||||
rollback;
|
||||
end if;
|
||||
start transaction;
|
||||
insert into t1 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t2 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t3 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t4 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t5 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
delete from t1 where c1 between 100 and 110;
|
||||
delete from t2 where c1 between 100 and 110;
|
||||
delete from t3 where c1 between 100 and 110;
|
||||
delete from t4 where c1 between 100 and 110;
|
||||
delete from t5 where c1 between 100 and 110;
|
||||
update t1 set c1 = c1+1 where c1>110;
|
||||
update t2 set c1 = c1+1 where c1>110;
|
||||
update t3 set c1 = c1+1 where c1>110;
|
||||
update t4 set c1 = c1+1 where c1>110;
|
||||
update t5 set c1 = c1+1 where c1>110;
|
||||
savepoint a;
|
||||
insert into t1 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t2 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t3 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t4 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t5 values(300+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
savepoint b;
|
||||
insert into t1 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t2 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t3 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t4 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
insert into t5 values(400+n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
|
||||
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
|
||||
repeat(concat(' tc6_',n+inner_loop),245),repeat(concat(' tc7_',n+inner_loop),245),
|
||||
now(),(100.55+n+inner_loop));
|
||||
savepoint c;
|
||||
rollback to b;
|
||||
rollback to a;
|
||||
commit;
|
||||
commit;
|
||||
rollback;
|
||||
set n = n - 1;
|
||||
end while;
|
||||
end|
|
||||
connect con1,localhost,root,,;
|
||||
connect con2,localhost,root,,;
|
||||
#---client 1 : dml operation ---"
|
||||
connection con1;
|
||||
#---client 2 : dml operation ---"
|
||||
connection con2;
|
||||
# In connection 1
|
||||
connection con1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
20
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
20
|
||||
select count(*) from t4;
|
||||
count(*)
|
||||
20
|
||||
select count(*) from t5;
|
||||
count(*)
|
||||
20
|
||||
select c1 from t1;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
select c1 from t2;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
select c1 from t3;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
select c1 from t4;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
select c1 from t5;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
# In connection 2
|
||||
connection con2;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
20
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
20
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
20
|
||||
select count(*) from t4;
|
||||
count(*)
|
||||
20
|
||||
select count(*) from t5;
|
||||
count(*)
|
||||
20
|
||||
select c1 from t1;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
select c1 from t2;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
select c1 from t3;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
select c1 from t4;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
select c1 from t5;
|
||||
c1
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
122
|
||||
124
|
||||
126
|
||||
128
|
||||
130
|
||||
132
|
||||
134
|
||||
136
|
||||
138
|
||||
140
|
||||
# In connection 1
|
||||
connection con1;
|
||||
set autocommit = 0;
|
||||
insert into t1 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert ignore into t1 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t2 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert ignore into t2 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t3 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert ignore into t3 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t4 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert ignore into t4 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t5 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert ignore into t5 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t1 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t2 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t3 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t4 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
insert into t5 values (1,1,'a','a','a','a','a',now(),100.55),
|
||||
(20,1,'a','a','a','a','a',now(),100.55);
|
||||
ERROR 23000: Duplicate entry '20' for key 'PRIMARY'
|
||||
set autocommit = 1;
|
||||
select c1,c2 from t1 where c1 in (20,1);
|
||||
c1 c2
|
||||
20 20
|
||||
select c1,c2 from t2 where c1 in (20,1);
|
||||
c1 c2
|
||||
20 20
|
||||
select c1,c2 from t3 where c1 in (20,1);
|
||||
c1 c2
|
||||
20 20
|
||||
select c1,c2 from t4 where c1 in (20,1);
|
||||
c1 c2
|
||||
20 20
|
||||
select c1,c2 from t5 where c1 in (20,1);
|
||||
c1 c2
|
||||
20 20
|
||||
replace into t1 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
replace into t2 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
replace into t3 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
replace into t4 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
replace into t5 values (20,1,'a','a','a','a','a',now(),100.55);
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t1 where c1 = 20;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9
|
||||
20 1 a a a a a 100.550
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t2 where c1 = 20;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9
|
||||
20 1 a a a a a 100.550
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t3 where c1 = 20;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9
|
||||
20 1 a a a a a 100.550
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t4 where c1 = 20;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9
|
||||
20 1 a a a a a 100.550
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9 from t5 where c1 = 20;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9
|
||||
20 1 a a a a a 100.550
|
||||
update ignore t1 set c1 = 20 where c1 = 140 ;
|
||||
update ignore t2 set c1 = 20 where c1 = 140 ;
|
||||
update ignore t3 set c1 = 20 where c1 = 140 ;
|
||||
update ignore t4 set c1 = 20 where c1 = 140 ;
|
||||
update ignore t5 set c1 = 20 where c1 = 140 ;
|
||||
select count(*) from t1 where c1 = 140;
|
||||
count(*)
|
||||
1
|
||||
select count(*) from t2 where c1 = 140;
|
||||
count(*)
|
||||
1
|
||||
select count(*) from t3 where c1 = 140;
|
||||
count(*)
|
||||
1
|
||||
select count(*) from t4 where c1 = 140;
|
||||
count(*)
|
||||
1
|
||||
select count(*) from t5 where c1 = 140;
|
||||
count(*)
|
||||
1
|
||||
"running select * into outfile <file> from t1 ;
|
||||
create temporary table temp_1 engine = innodb as select * from t1 where 1=2;
|
||||
select count(*) from temp_1;
|
||||
count(*)
|
||||
0
|
||||
"running load data infile <file> into temp_1 ;
|
||||
select count(*) from temp_1;
|
||||
count(*)
|
||||
20
|
||||
alter table temp_1 add column c10 int default 99 ,
|
||||
add column c11 varchar(100) default 'test';
|
||||
alter table temp_1 add primary key (c1);
|
||||
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55);
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9 c10 c11
|
||||
-1 -1 a a a a a 100.550 99 test
|
||||
select count(*) from temp_1 where c10 = 99 and c11 like 'test';
|
||||
count(*)
|
||||
21
|
||||
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55)
|
||||
on duplicate key update c1=-2,c2=-2;
|
||||
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9 c10 c11
|
||||
-2 -2 a a a a a 100.550 99 test
|
||||
drop table t1 ,t2 ,t3,t4,t5,t6,temp_1;
|
||||
disconnect con1;
|
||||
connection con2;
|
||||
drop table t1 ,t2 ,t3,t4,t5,t6;
|
||||
disconnect con2;
|
||||
connection default;
|
||||
drop procedure populate_tables;
|
||||
create temporary table prep_1(c1 int not null,
|
||||
c2 int not null,
|
||||
c3 char(255) not null,
|
||||
c4 text(6000) not null,
|
||||
c5 blob(6000) not null,
|
||||
c6 varchar(2000) not null,
|
||||
c7 varchar(2000) not null,
|
||||
c8 datetime,
|
||||
c9 decimal(6,3),
|
||||
index (c3,c4(50),c5(50)),
|
||||
index (c2))
|
||||
engine=innodb;
|
||||
PREPARE stm FROM "insert into prep_1 values(?,?,repeat(concat(' tc3_',?),30),repeat(concat(' tc4_',?),800),repeat(concat(' tc_',?),800),repeat(concat(' tc6_',?),245),repeat(concat(' tc7_',?),245),now(),(100.55+?))";
|
||||
set @var = 5;
|
||||
set @var_static = 5;
|
||||
EXECUTE stm USING @var,@var,@var,@var,@var,@var,@var,@var;
|
||||
EXECUTE stm USING @var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static;
|
||||
set @var = @var - 1;
|
||||
EXECUTE stm USING @var,@var,@var,@var,@var,@var,@var,@var;
|
||||
EXECUTE stm USING @var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static;
|
||||
set @var = @var - 1;
|
||||
EXECUTE stm USING @var,@var,@var,@var,@var,@var,@var,@var;
|
||||
EXECUTE stm USING @var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static;
|
||||
set @var = @var - 1;
|
||||
EXECUTE stm USING @var,@var,@var,@var,@var,@var,@var,@var;
|
||||
EXECUTE stm USING @var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static;
|
||||
set @var = @var - 1;
|
||||
EXECUTE stm USING @var,@var,@var,@var,@var,@var,@var,@var;
|
||||
EXECUTE stm USING @var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static,@var_static;
|
||||
set @var = @var - 1;
|
||||
select c1,left(c3,15) from prep_1 order by c1 ;
|
||||
c1 left(c3,15)
|
||||
1 tc3_1 tc3_1 tc
|
||||
2 tc3_2 tc3_2 tc
|
||||
3 tc3_3 tc3_3 tc
|
||||
4 tc3_4 tc3_4 tc
|
||||
5 tc3_5 tc3_5 tc
|
||||
5 tc3_5 tc3_5 tc
|
||||
5 tc3_5 tc3_5 tc
|
||||
5 tc3_5 tc3_5 tc
|
||||
5 tc3_5 tc3_5 tc
|
||||
5 tc3_5 tc3_5 tc
|
||||
select count(*) from prep_1;
|
||||
count(*)
|
||||
10
|
||||
PREPARE stm_1 FROM "UPDATE prep_1 SET c1 = c1 + 1";
|
||||
EXECUTE stm_1;
|
||||
EXECUTE stm_1;
|
||||
select c1,left(c3,15) from prep_1 order by c1 ;
|
||||
c1 left(c3,15)
|
||||
3 tc3_1 tc3_1 tc
|
||||
4 tc3_2 tc3_2 tc
|
||||
5 tc3_3 tc3_3 tc
|
||||
6 tc3_4 tc3_4 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
select count(*) from prep_1;
|
||||
count(*)
|
||||
10
|
||||
PREPARE stm_2 FROM "DELETE FROM prep_1 ORDER BY c1 LIMIT 1";
|
||||
EXECUTE stm_2;
|
||||
EXECUTE stm_2;
|
||||
select c1,left(c3,15) from prep_1 order by c1 ;
|
||||
c1 left(c3,15)
|
||||
5 tc3_3 tc3_3 tc
|
||||
6 tc3_4 tc3_4 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
7 tc3_5 tc3_5 tc
|
||||
select count(*) from prep_1;
|
||||
count(*)
|
||||
8
|
||||
drop prepare stm;
|
||||
drop prepare stm_1;
|
||||
drop prepare stm_2;
|
||||
drop table prep_1;
|
@ -20,33 +20,143 @@ set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
set global innodb_file_per_table = 1;
|
||||
set global innodb_file_format = 'Antelope';
|
||||
Warnings:
|
||||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
create table tNUMBER
|
||||
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
|
||||
index cNUMBER_idx(cNUMBER))
|
||||
engine=innodb row_format=compact
|
||||
key_block_size=NUMBER;
|
||||
Warnings:
|
||||
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
|
||||
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER unless ROW_FORMAT=COMPRESSED.
|
||||
create table t2
|
||||
(i int, c1 char(100), c2 char(100),
|
||||
index c1_idx(c1))
|
||||
engine=innodb row_format=compact
|
||||
key_block_size=16;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
|
||||
create temporary table t3
|
||||
(i int, c1 char(100), c2 char(100),
|
||||
index c1_idx(c1))
|
||||
engine=innodb row_format=compact
|
||||
key_block_size=16;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
0
|
||||
begin;
|
||||
call populate();
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
5000
|
||||
truncate table t1;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
5000
|
||||
call populate_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
7000
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
7000
|
||||
truncate table t2;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
|
||||
# WL#7811/WL#7743/WL#7141 TODO: Remove the warnings!
|
||||
truncate table t3;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
0
|
||||
call populate_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
2000
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
drop procedure populate;
|
||||
drop procedure populate_small;
|
||||
set global innodb_file_per_table = 1;
|
||||
set innodb_strict_mode=OFF;
|
||||
create procedure populate()
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= 5000) do
|
||||
insert into t1 values (i, 'a', 'b');
|
||||
insert into t2 values (i, 'a', 'b');
|
||||
insert into t3 values (i, 'a', 'b');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
create procedure populate_small()
|
||||
begin
|
||||
declare i int default 10001;
|
||||
while (i <= 12000) do
|
||||
insert into t1 values (i, 'c', 'd');
|
||||
insert into t2 values (i, 'a', 'b');
|
||||
insert into t3 values (i, 'a', 'b');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
set global innodb_file_per_table = 1;
|
||||
create table tNUMBER
|
||||
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
|
||||
index cNUMBER_idx(cNUMBER))
|
||||
engine=innodb row_format=compressed
|
||||
key_block_size=NUMBER;
|
||||
create table t2
|
||||
(i int, c1 char(100), c2 char(100),
|
||||
index c1_idx(c1))
|
||||
engine=innodb row_format=compressed
|
||||
key_block_size=16;
|
||||
create temporary table t3
|
||||
(i int, c1 char(100), c2 char(100),
|
||||
index c1_idx(c1))
|
||||
engine=innodb row_format=compressed
|
||||
key_block_size=16;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
|
||||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED is ignored for TEMPORARY TABLE.
|
||||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
@ -89,7 +199,12 @@ select count(*) from t3;
|
||||
count(*)
|
||||
7000
|
||||
truncate table t2;
|
||||
# WL#7811/WL#7743/WL#7141 TODO: Remove the warnings!
|
||||
truncate table t3;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
|
||||
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED is ignored for TEMPORARY TABLE.
|
||||
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2000
|
||||
@ -114,120 +229,6 @@ drop table t2;
|
||||
drop table t3;
|
||||
drop procedure populate;
|
||||
drop procedure populate_small;
|
||||
set global innodb_file_format = Barracuda;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
set global innodb_file_per_table = 1;
|
||||
set innodb_strict_mode=OFF;
|
||||
create procedure populate()
|
||||
begin
|
||||
declare i int default 1;
|
||||
while (i <= 5000) do
|
||||
insert into t1 values (i, 'a', 'b');
|
||||
insert into t2 values (i, 'a', 'b');
|
||||
insert into t3 values (i, 'a', 'b');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
create procedure populate_small()
|
||||
begin
|
||||
declare i int default 10001;
|
||||
while (i <= 12000) do
|
||||
insert into t1 values (i, 'c', 'd');
|
||||
insert into t2 values (i, 'a', 'b');
|
||||
insert into t3 values (i, 'a', 'b');
|
||||
set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
set global innodb_file_per_table = 1;
|
||||
set global innodb_file_format = 'Barracuda';
|
||||
Warnings:
|
||||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
create table tNUMBER
|
||||
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
|
||||
index cNUMBER_idx(cNUMBER))
|
||||
engine=innodb row_format=compressed
|
||||
key_block_size=NUMBER;
|
||||
create table t2
|
||||
(i int, c1 char(100), c2 char(100),
|
||||
index c1_idx(c1))
|
||||
engine=innodb row_format=compressed
|
||||
key_block_size=16;
|
||||
create temporary table t3
|
||||
(i int, c1 char(100), c2 char(100),
|
||||
index c1_idx(c1))
|
||||
engine=innodb row_format=compressed
|
||||
key_block_size=16;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
0
|
||||
begin;
|
||||
call populate();
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
5000
|
||||
truncate table t1;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
5000
|
||||
call populate_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
7000
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
7000
|
||||
truncate table t2;
|
||||
truncate table t3;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
0
|
||||
call populate_small();
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4000
|
||||
select count(*) from t2;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from t3;
|
||||
count(*)
|
||||
2000
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
drop procedure populate;
|
||||
drop procedure populate_small;
|
||||
set global innodb_file_format = Barracuda;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
set global innodb_file_per_table = 1;
|
||||
set innodb_strict_mode=OFF;
|
||||
create procedure populate()
|
||||
@ -251,9 +252,6 @@ set i = i + 1;
|
||||
end while;
|
||||
end|
|
||||
set global innodb_file_per_table = 0;
|
||||
set global innodb_file_format = 'Antelope';
|
||||
Warnings:
|
||||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
create table tNUMBER
|
||||
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
|
||||
index cNUMBER_idx(cNUMBER))
|
||||
@ -261,7 +259,6 @@ engine=innodb row_format=compact
|
||||
key_block_size=NUMBER;
|
||||
Warnings:
|
||||
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
|
||||
create table t2
|
||||
(i int, c1 char(100), c2 char(100),
|
||||
@ -270,7 +267,6 @@ engine=innodb row_format=compact
|
||||
key_block_size=16;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
|
||||
create temporary table t3
|
||||
(i int, c1 char(100), c2 char(100),
|
||||
@ -278,9 +274,7 @@ index c1_idx(c1))
|
||||
engine=innodb row_format=compact
|
||||
key_block_size=16;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
@ -303,6 +297,9 @@ select count(*) from t3;
|
||||
count(*)
|
||||
5000
|
||||
truncate table t1;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
@ -323,7 +320,13 @@ select count(*) from t3;
|
||||
count(*)
|
||||
7000
|
||||
truncate table t2;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
|
||||
# WL#7811/WL#7743/WL#7141 TODO: Remove the warnings!
|
||||
truncate table t3;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
2000
|
||||
@ -348,7 +351,4 @@ drop table t2;
|
||||
drop table t3;
|
||||
drop procedure populate;
|
||||
drop procedure populate_small;
|
||||
set global innodb_file_format = Barracuda;
|
||||
Warnings:
|
||||
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
|
||||
set global innodb_file_per_table = 1;
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user