File: lowercase_table4.test

package info (click to toggle)
mysql-5.1 5.1.73-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 197,132 kB
  • ctags: 93,377
  • sloc: cpp: 579,952; ansic: 429,462; perl: 49,053; sh: 21,692; pascal: 21,272; yacc: 12,801; makefile: 4,545; xml: 4,114; sql: 3,297; lex: 1,265; asm: 1,023
file content (56 lines) | stat: -rw-r--r-- 1,423 bytes parent folder | download | duplicates (2)
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
--source include/have_case_insensitive_file_system.inc
--source include/have_innodb.inc

--echo #
--echo # Bug#46941 crash with lower_case_table_names=2 and
--echo #           foreign data dictionary confusion
--echo #

CREATE DATABASE XY;
USE XY;

#
# Logs are disabled, since the number of creates tables
# and subsequent select statements may vary between
# versions
#
--disable_query_log
--disable_result_log

let $tcs = `SELECT @@table_open_cache + 1`;

let $i = $tcs;

while ($i)
{
  eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, 
                             primary key(a, b), unique(b)) ENGINE=InnoDB;
  dec $i;
}

eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b), 
                           ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b);
                   
eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b),
                           ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a);
 
let $i = $tcs;
while ($i)
{
  eval SELECT * FROM XY.T_$i LIMIT 1;
  dec $i;
}

DROP DATABASE XY;
CREATE DATABASE XY;
USE XY;
eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, 
                             PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB;
#
# The bug causes this SELECT to err
eval SELECT * FROM XY.T_$tcs LIMIT 1;

--enable_query_log
--enable_result_log
DROP DATABASE XY;