File: create_drop_temp_table_perf_debug.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (94 lines) | stat: -rw-r--r-- 2,855 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#
# WL#6469: Optimizing CREATE/DROP performance for temporary tables
#


# Must have debug code to use SET SESSION debug
--source include/have_debug.inc

# Valgrind can hang or return spurious messages on DBUG_SUICIDE
--source include/not_valgrind.inc


#########################################################################
#									#
# Will test following scenarios:					#
# 1. Effect of errors on temp-table					#
#########################################################################


#-------------------------------------------------------------
#
# create test-bed.
#
let $per_table = `select @@innodb_file_per_table`;
set global innodb_file_per_table = 0;

#------------------------------------------------------------
#
# 1. Effect of errors on temp-table
#
set global innodb_file_per_table = 1;
call mtr.add_suppression("No space left on device");
call mtr.add_suppression("table.+ full");
call mtr.add_suppression("Cannot create file");

# In the test scenario, there can be orphaned .frm files.
# These are expected.  So suppressing the associated warnings.
call mtr.add_suppression("\\[ERROR\\] .*MY-\\d+.* table .* does not exist "
			 "in the InnoDB internal");

#
--exec echo "restart " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
set session debug="+d,ib_ddl_crash_during_tablespace_alloc";
--error 2013
create temporary table t1
	(a int, b int, primary key(a), index(b)) engine = innodb;
#
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
create temporary table t1
	(a int, b int, primary key(a), index(b)) engine = innodb;
insert into t1 values (10, 11);
select * from t1;
drop table t1;
#
#
set session debug="+d,ib_create_table_fail_at_create_index";
--error ER_INDEX_COLUMN_TOO_LONG
create temporary table t1
	(a int, b int, primary key(a), index(b)) engine = innodb;
--error ER_NO_SUCH_TABLE
insert into t1 values (10, 11);
set session debug="-d,ib_create_table_fail_at_create_index";
create temporary table t1
	(a int, b int, primary key(a), index(b)) engine = innodb;
insert into t1 values (10, 11);
drop table t1;


#-------------------------------------------------------------
#
# Temp table with PK-FK -FK constraint is igonered for temp
# tables

--disable_warnings
drop table if exists parent,child;
--enable_warnings
create temporary table parent ( i int primary key ) engine = innodb;
create table child ( j int references parent(i)) engine = innodb;
insert into parent values (1),(2),(3),(4);
insert into child values (1),(2),(3),(4);
# We can insert non referencing values as constraint is ignored for temp table
insert into child values (5),(6);
select * from parent;
select * from child;
#
--source include/restart_mysqld.inc
#
# parent table will be removed on restart as its temp table
--error ER_NO_SUCH_TABLE
select * from parent ;
select * from child ;
drop table child;