Skip to content

Commit cfce4cb

Browse files
author
Marko Mäkelä
committed
WL#7899 after-fix: Move some innodb_zip tests to innodb.
innodb.temp_table: Renamed from innodb_zip.wl6470_1. innodb.temp_table_savepoint: Renamed from innodb_zip.wl6470_2. Also, remove some unnecessary statements. Since WL#7899, innodb_file_per_table has no effect on temporary tables. Reviewed-by: Debarun Banerjee <debarun.banerjee@oracle.com> RB: 12984
1 parent 73b0430 commit cfce4cb

File tree

5 files changed

+25
-59
lines changed

5 files changed

+25
-59
lines changed

mysql-test/suite/innodb_zip/r/wl6470_1.result renamed to mysql-test/suite/innodb/r/temp_table.result

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ count(*)
194194
drop procedure populate_t1;
195195
drop procedure populate_t1_small;
196196
drop procedure populate_t1_small2;
197-
drop table t1;
198-
drop table t2;
197+
drop temporary table t1,t2;
199198
create temporary table t1
200199
(keyc int, c1 char(100), c2 char(100),
201200
primary key(keyc), index sec_index(c1)
@@ -210,7 +209,7 @@ create temporary table t2
210209
(keyc int, c1 char(100), c2 char(100),
211210
primary key(keyc), index sec_index(c1)
212211
) engine = innodb key_block_size = 8;
213-
set innodb_strict_mode=default;
212+
set innodb_strict_mode=on;
214213
create procedure populate_t1()
215214
begin
216215
declare i int default 1;
@@ -399,9 +398,7 @@ count(*)
399398
drop procedure populate_t1;
400399
drop procedure populate_t1_small;
401400
drop procedure populate_t1_small2;
402-
drop table t1;
403-
drop table t2;
404-
set global innodb_file_per_table = 0;
401+
drop temporary table t1, t2;
405402
create temporary table t1
406403
(keyc int, c1 char(100), c2 char(100),
407404
primary key(keyc), index sec_index(c1)
@@ -598,6 +595,3 @@ count(*)
598595
drop procedure populate_t1;
599596
drop procedure populate_t1_small;
600597
drop procedure populate_t1_small2;
601-
drop table t1;
602-
drop table t2;
603-
set global innodb_file_per_table = 1;

mysql-test/suite/innodb_zip/r/wl6470_2.result renamed to mysql-test/suite/innodb/r/temp_table_savepoint.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
12
Warnings:
23
Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
34
create procedure populate_tables()
45
begin
56
declare n int default 20;
67
declare inner_loop int default 100;
7-
set global innodb_file_per_table=on;
88
create temporary table t1(c1 int not null,
99
c2 int not null,
1010
c3 char(255) not null,
@@ -15,7 +15,7 @@ c7 varchar(2000) not null,
1515
c8 datetime,
1616
c9 decimal(6,3),
1717
primary key (c1),
18-
index (c3,c4(50),c5(50)),
18+
index (c3,c4(50),c5(50)),
1919
index (c2))
2020
engine=innodb row_format=redundant;
2121
create temporary table t2(c1 int not null,
@@ -91,7 +91,7 @@ update t2 set c1 = c1 + 1000 where c1 > 10;
9191
update t4 set c1 = c1 + 1000 where c1 > 10;
9292
update t5 set c1 = c1 + 1000 where c1 > 10;
9393
rollback;
94-
end if;
94+
end if;
9595
start transaction;
9696
insert into t1 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
9797
repeat(concat(' tc4_',n+inner_loop),800),repeat(concat(' tc_',n+inner_loop),800),
@@ -157,7 +157,7 @@ rollback to a;
157157
commit;
158158
commit;
159159
rollback;
160-
set n = n - 1;
160+
set n = n - 1;
161161
end while;
162162
end|
163163
#---client 1 : dml operation ---"
@@ -460,7 +460,7 @@ count(*)
460460
select count(*) from temp_1;
461461
count(*)
462462
20
463-
alter table temp_1 add column c10 int default 99 ,
463+
alter table temp_1 add column c10 int default 99 ,
464464
add column c11 varchar(100) default 'test';
465465
alter table temp_1 add primary key (c1);
466466
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55);
@@ -470,7 +470,7 @@ c1 c2 c3 c4 c5 c6 c7 c9 c10 c11
470470
select count(*) from temp_1 where c10 = 99 and c11 like 'test';
471471
count(*)
472472
21
473-
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55)
473+
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55)
474474
on duplicate key update c1=-2,c2=-2;
475475
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
476476
c1 c2 c3 c4 c5 c6 c7 c9 c10 c11

mysql-test/suite/innodb_zip/t/wl6470_1.test renamed to mysql-test/suite/innodb/t/temp_table.test

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ create temporary table t2
2020
(keyc int, c1 char(100), c2 char(100),
2121
primary key(keyc), index sec_index(c1)
2222
) engine = innodb;
23-
--source suite/innodb_zip/include/innodb_dml_ops.inc
24-
drop table t1;
25-
drop table t2;
23+
--source suite/innodb/include/dml_ops.inc
24+
drop temporary table t1,t2;
2625
#
2726
--error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
2827
create temporary table t1
@@ -39,14 +38,11 @@ create temporary table t2
3938
(keyc int, c1 char(100), c2 char(100),
4039
primary key(keyc), index sec_index(c1)
4140
) engine = innodb key_block_size = 8;
42-
set innodb_strict_mode=default;
41+
set innodb_strict_mode=on;
4342
--enable_warnings
44-
--source suite/innodb_zip/include/innodb_dml_ops.inc
45-
drop table t1;
46-
drop table t2;
43+
--source suite/innodb/include/dml_ops.inc
44+
drop temporary table t1, t2;
4745
#
48-
let $file_per_table = `select @@innodb_file_per_table`;
49-
set global innodb_file_per_table = 0;
5046
create temporary table t1
5147
(keyc int, c1 char(100), c2 char(100),
5248
primary key(keyc), index sec_index(c1)
@@ -55,9 +51,4 @@ create temporary table t2
5551
(keyc int, c1 char(100), c2 char(100),
5652
primary key(keyc), index sec_index(c1)
5753
) engine = innodb;
58-
--source suite/innodb_zip/include/innodb_dml_ops.inc
59-
drop table t1;
60-
drop table t2;
61-
eval set global innodb_file_per_table = $file_per_table;
62-
#
63-
54+
--source suite/innodb/include/dml_ops.inc

mysql-test/suite/innodb_zip/t/wl6470_2.test renamed to mysql-test/suite/innodb/t/temp_table_savepoint.test

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
--source include/have_innodb.inc
2-
--source include/have_innodb_max_16k.inc
32
--source include/no_valgrind_without_big.inc
43

54
####################################################################
65
# TC to test temp-table DML optimization changes for correctness #
76
# Sceanrio covered in single testcase : #
8-
# - Tables with row format(redundant,compressed,dynamic,compact #
7+
# - Tables with row format(redundant,dynamic,compact) #
98
# - Table with primary,composite,prefix,secondary index #
109
# - Insert/delete/update with transactioons #
1110
# - Transaction with commit,rollback,savepoint statements #
@@ -14,7 +13,7 @@
1413
# - Inserting data using #
1514
# - Insert into .. , Load data infile..,insert ignore #
1615
# - Insert into .. on duplicate update #
17-
# - Check basic delete and upadte [ignore] #
16+
# - Check basic delete and update [ignore] #
1817
# - Check constraints like duplicate key,default value #
1918
# - Alter add column , add primary key #
2019
# - with prepare and execute statement #
@@ -28,22 +27,16 @@ if (`SELECT COUNT(*) = 0 FROM performance_schema.global_status WHERE LOWER(varia
2827
}
2928
--enable_warnings
3029

31-
32-
# Save initial values of server variable
33-
--disable_query_log
34-
let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
3530
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
36-
--enable_query_log
3731

38-
# Create procedure to perform
32+
# Create procedure to perform
3933
# 1. Create temp table with row types , index , sufficent data types
40-
# 2. Perform DML with transaction
34+
# 2. Perform DML with transaction
4135
delimiter |;
4236
create procedure populate_tables()
4337
begin
4438
declare n int default 20;
4539
declare inner_loop int default 100;
46-
set global innodb_file_per_table=on;
4740

4841
create temporary table t1(c1 int not null,
4942
c2 int not null,
@@ -55,7 +48,7 @@ create procedure populate_tables()
5548
c8 datetime,
5649
c9 decimal(6,3),
5750
primary key (c1),
58-
index (c3,c4(50),c5(50)),
51+
index (c3,c4(50),c5(50)),
5952
index (c2))
6053
engine=innodb row_format=redundant;
6154

@@ -138,7 +131,7 @@ create procedure populate_tables()
138131
update t4 set c1 = c1 + 1000 where c1 > 10;
139132
update t5 set c1 = c1 + 1000 where c1 > 10;
140133
rollback;
141-
end if;
134+
end if;
142135

143136
start transaction;
144137
insert into t1 values(n+inner_loop,n+inner_loop,repeat(concat(' tc3_',n+inner_loop),30),
@@ -210,7 +203,7 @@ create procedure populate_tables()
210203
commit;
211204
commit;
212205
rollback;
213-
set n = n - 1;
206+
set n = n - 1;
214207
end while;
215208
end|
216209
delimiter ;|
@@ -222,19 +215,13 @@ connect (con2,localhost,root,,);
222215
--echo #---client 1 : dml operation ---"
223216
connection con1;
224217
-- disable_query_log
225-
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
226-
-- enable_query_log
227-
-- disable_query_log
228218
# call procedure
229219
--send call populate_tables();
230220
-- enable_query_log
231221

232222
--echo #---client 2 : dml operation ---"
233223
connection con2;
234224
-- disable_query_log
235-
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
236-
-- enable_query_log
237-
-- disable_query_log
238225
# call procedure
239226
--send call populate_tables();
240227
-- enable_query_log
@@ -327,7 +314,7 @@ select count(*) from t2 where c1 = 140;
327314
select count(*) from t4 where c1 = 140;
328315
select count(*) from t5 where c1 = 140;
329316

330-
# Load data infile
317+
# Load data infile
331318
--echo "running select * into outfile <file> from t1 ;
332319
--disable_query_log
333320
eval select * into outfile "$MYSQLTEST_VARDIR/tmp/t1.outfile" from t1;
@@ -342,14 +329,14 @@ eval load data infile '$MYSQLTEST_VARDIR/tmp/t1.outfile' into table temp_1;
342329
select count(*) from temp_1;
343330

344331
# Alter table to add column and primary key
345-
alter table temp_1 add column c10 int default 99 ,
332+
alter table temp_1 add column c10 int default 99 ,
346333
add column c11 varchar(100) default 'test';
347334
alter table temp_1 add primary key (c1);
348335
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55);
349336
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
350337
select count(*) from temp_1 where c10 = 99 and c11 like 'test';
351338
# insert on duplicate key update
352-
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55)
339+
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55)
353340
on duplicate key update c1=-2,c2=-2;
354341
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
355342

@@ -410,9 +397,3 @@ drop prepare stm_2;
410397
drop table prep_1;
411398

412399
--remove_file $MYSQLTEST_VARDIR/tmp/t1.outfile
413-
414-
-- disable_query_log
415-
eval set global innodb_file_per_table=$innodb_file_per_table_orig;
416-
SET sql_mode = default;
417-
-- enable_query_log
418-

0 commit comments

Comments
 (0)