1
1
--source include/have_innodb.inc
2
- --source include/have_innodb_max_16k.inc
3
2
--source include/no_valgrind_without_big.inc
4
3
5
4
####################################################################
6
5
# TC to test temp-table DML optimization changes for correctness #
7
6
# Sceanrio covered in single testcase : #
8
- # - Tables with row format(redundant,compressed, dynamic,compact #
7
+ # - Tables with row format(redundant,dynamic,compact) #
9
8
# - Table with primary,composite,prefix,secondary index #
10
9
# - Insert/delete/update with transactioons #
11
10
# - Transaction with commit,rollback,savepoint statements #
14
13
# - Inserting data using #
15
14
# - Insert into .. , Load data infile..,insert ignore #
16
15
# - Insert into .. on duplicate update #
17
- # - Check basic delete and upadte [ignore] #
16
+ # - Check basic delete and update [ignore] #
18
17
# - Check constraints like duplicate key,default value #
19
18
# - Alter add column , add primary key #
20
19
# - with prepare and execute statement #
@@ -28,22 +27,16 @@ if (`SELECT COUNT(*) = 0 FROM performance_schema.global_status WHERE LOWER(varia
28
27
}
29
28
--enable_warnings
30
29
31
-
32
- # Save initial values of server variable
33
- --disable_query_log
34
- let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
35
30
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
36
- --enable_query_log
37
31
38
- # Create procedure to perform
32
+ # Create procedure to perform
39
33
# 1. Create temp table with row types , index , sufficent data types
40
- # 2. Perform DML with transaction
34
+ # 2. Perform DML with transaction
41
35
delimiter |;
42
36
create procedure populate_tables()
43
37
begin
44
38
declare n int default 20;
45
39
declare inner_loop int default 100;
46
- set global innodb_file_per_table=on;
47
40
48
41
create temporary table t1(c1 int not null,
49
42
c2 int not null,
@@ -55,7 +48,7 @@ create procedure populate_tables()
55
48
c8 datetime,
56
49
c9 decimal(6,3),
57
50
primary key (c1),
58
- index (c3,c4(50),c5(50)),
51
+ index (c3,c4(50),c5(50)),
59
52
index (c2))
60
53
engine=innodb row_format=redundant;
61
54
@@ -138,7 +131,7 @@ create procedure populate_tables()
138
131
update t4 set c1 = c1 + 1000 where c1 > 10;
139
132
update t5 set c1 = c1 + 1000 where c1 > 10;
140
133
rollback;
141
- end if;
134
+ end if;
142
135
143
136
start transaction;
144
137
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()
210
203
commit;
211
204
commit;
212
205
rollback;
213
- set n = n - 1;
206
+ set n = n - 1;
214
207
end while;
215
208
end|
216
209
delimiter ;|
@@ -222,19 +215,13 @@ connect (con2,localhost,root,,);
222
215
--echo #---client 1 : dml operation ---"
223
216
connection con1;
224
217
-- disable_query_log
225
- eval set global innodb_file_per_table=$innodb_file_per_table_orig;
226
- -- enable_query_log
227
- -- disable_query_log
228
218
# call procedure
229
219
--send call populate_tables();
230
220
-- enable_query_log
231
221
232
222
--echo #---client 2 : dml operation ---"
233
223
connection con2;
234
224
-- disable_query_log
235
- eval set global innodb_file_per_table=$innodb_file_per_table_orig;
236
- -- enable_query_log
237
- -- disable_query_log
238
225
# call procedure
239
226
--send call populate_tables();
240
227
-- enable_query_log
@@ -327,7 +314,7 @@ select count(*) from t2 where c1 = 140;
327
314
select count(*) from t4 where c1 = 140;
328
315
select count(*) from t5 where c1 = 140;
329
316
330
- # Load data infile
317
+ # Load data infile
331
318
--echo "running select * into outfile <file> from t1 ;
332
319
--disable_query_log
333
320
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;
342
329
select count(*) from temp_1;
343
330
344
331
# 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 ,
346
333
add column c11 varchar(100) default 'test';
347
334
alter table temp_1 add primary key (c1);
348
335
insert into temp_1 (c1,c2,c3,c4,c5,c6,c7,c8,c9) values (-1,-1,'a','a','a','a','a',now(),100.55);
349
336
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
350
337
select count(*) from temp_1 where c10 = 99 and c11 like 'test';
351
338
# 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)
353
340
on duplicate key update c1=-2,c2=-2;
354
341
select c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 from temp_1 where c1 < 0;
355
342
@@ -410,9 +397,3 @@ drop prepare stm_2;
410
397
drop table prep_1;
411
398
412
399
--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