summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/foreign_key_not_windows.test
blob: 0e1e25d64b362792fce87b3e4d89fb62f3ac758b (plain)
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
--source include/have_innodb.inc
# On Microsoft Windows, there is an additional limit of MAX_PATH
--source include/not_windows.inc
# The embedded server prepends --datadir or --innodb-data-home-dir
# to the path names, which reduces the maximum length of names further.
--source include/not_embedded.inc

--echo #
--echo # MDEV-28980 InnoDB: Failing assertion: len <= MAX_TABLE_NAME_LEN
--echo #

# The main test is innodb.foreign_key. This is an additional test that
# the maximum length cannot be exceeded for implicitly created
# constraint names. On Microsoft Windows, MAX_PATH is a much stricter
# limit than the 255-byte maximum path component length on many other systems,
# including Linux and IBM AIX.

CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB;

# The maximum identifier length is 64 characters.
# my_charset_filename will expand some characters to 5 characters,
# e.g., # to @0023.
# Many operating systems (such as Linux) or file systems
# limit the path component length to 255 bytes,
# corresponding to the 51 characters below: 5*51=255.
let $d255=###################################################;
let $d250=##################################################;
--replace_result $d255 d255
eval CREATE DATABASE `$d255`;
--replace_result $d255 d255
--error ER_IDENT_CAUSES_TOO_LONG_PATH
eval CREATE TABLE `$d255`.`$d255`
(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB;
--replace_result $d255 d255
--error ER_IDENT_CAUSES_TOO_LONG_PATH
eval CREATE TABLE `$d255`.`_$d250`
(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB;
--replace_result $d255 d255
eval CREATE TABLE `$d255`.`$d250`
(a INT PRIMARY KEY, FOREIGN KEY(a) REFERENCES test.t(a)) ENGINE=InnoDB;

--echo #
--echo # MDEV-29258 Failing assertion for name length on RENAME TABLE
--echo #

let $d245=-------------------------------------------------;
--replace_result $d245 d245 $d255 d255
eval CREATE TABLE `$d255`.`$d245` (x INT) ENGINE=InnoDB;
--replace_result $d250 d250 $d255 d255
eval DROP TABLE `$d255`.`$d250`;

--replace_result $d245 d245 $d250 d250 d255 d255
eval RENAME TABLE `$d255`.`$d245` TO `$d255`.`$d250`;
--replace_result $d250 d250 $d255 d255
eval RENAME TABLE `$d255`.`$d250` TO a;
--replace_result $d255 d255
eval DROP DATABASE `$d255`;
DROP TABLE a,t;

--echo # End of 10.3 tests