mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
XtraDB after-merge fixes.
The original XtraDB (and InnoDB plugin) is shipped as a separate source tree which is copied into the MySQL source, after which a setup.sh script must be run to move things into place. Now that XtraDB is part of the MariaDB source tree, this commit fixes these things up once and for all: - New innodb build scripts. - Test suite fixes (new tests and patches to existing). - Remove files no longer needed due to this.
This commit is contained in:
@ -111,7 +111,7 @@ count(*)
|
||||
explain select count(*) from t1 where
|
||||
key1a = 2 and key1b is null and key2a = 2 and key2b is null;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 4 Using intersect(i1,i2); Using where; Using index
|
||||
1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 3 Using intersect(i1,i2); Using where; Using index
|
||||
select count(*) from t1 where
|
||||
key1a = 2 and key1b is null and key2a = 2 and key2b is null;
|
||||
count(*)
|
||||
@ -119,7 +119,7 @@ count(*)
|
||||
explain select count(*) from t1 where
|
||||
key1a = 2 and key1b is null and key3a = 2 and key3b is null;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 4 Using intersect(i1,i3); Using where; Using index
|
||||
1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 3 Using intersect(i1,i3); Using where; Using index
|
||||
select count(*) from t1 where
|
||||
key1a = 2 and key1b is null and key3a = 2 and key3b is null;
|
||||
count(*)
|
||||
|
@ -197,7 +197,7 @@ c1 c2
|
||||
5 9
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 100
|
||||
auto_increment_offset 10
|
||||
@ -230,7 +230,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -269,7 +269,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -282,7 +282,7 @@ SELECT * FROM t1;
|
||||
c1
|
||||
-1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 100
|
||||
auto_increment_offset 10
|
||||
@ -315,7 +315,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -330,7 +330,7 @@ SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 100
|
||||
auto_increment_offset 10
|
||||
@ -370,7 +370,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -385,7 +385,7 @@ SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 100
|
||||
auto_increment_offset 10
|
||||
@ -419,7 +419,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -434,7 +434,7 @@ c1
|
||||
1
|
||||
9223372036854775794
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 2
|
||||
auto_increment_offset 10
|
||||
@ -452,7 +452,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -467,7 +467,7 @@ c1
|
||||
1
|
||||
18446744073709551603
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 2
|
||||
auto_increment_offset 10
|
||||
@ -485,7 +485,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -500,7 +500,7 @@ c1
|
||||
1
|
||||
18446744073709551603
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 5
|
||||
auto_increment_offset 7
|
||||
@ -514,7 +514,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -533,7 +533,7 @@ c1
|
||||
-9223372036854775806
|
||||
1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 3
|
||||
auto_increment_offset 3
|
||||
@ -550,7 +550,7 @@ c1
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
@ -568,7 +568,7 @@ SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCRE
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976'
|
||||
Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976'
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 65535
|
||||
auto_increment_offset 65535
|
||||
@ -579,3 +579,291 @@ c1
|
||||
18446744073709551610
|
||||
18446744073709551615
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL, 1);
|
||||
INSERT INTO t1 VALUES(NULL, 2);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
INSERT INTO t1 VALUES(NULL, 3);
|
||||
INSERT INTO t1 VALUES(NULL, 4);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL, 1);
|
||||
INSERT INTO t1 VALUES(NULL, 2);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
INSERT INTO t1 VALUES(NULL, 3);
|
||||
INSERT INTO t1 VALUES(NULL, 4);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
DROP TABLE IF EXISTS t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
CREATE TABLE t1 (
|
||||
a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
b INT(10) UNSIGNED NOT NULL,
|
||||
c ENUM('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (a)) ENGINE = InnoDB;
|
||||
CREATE TABLE t2 (
|
||||
m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
n INT(10) UNSIGNED NOT NULL,
|
||||
o enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (m)) ENGINE = InnoDB;
|
||||
INSERT INTO t2 (n,o) VALUES
|
||||
(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'),
|
||||
(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false');
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`m` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`n` int(10) unsigned NOT NULL,
|
||||
`o` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`m`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
13 1 TRUE
|
||||
14 1 FALSE
|
||||
15 2 TRUE
|
||||
16 2 FALSE
|
||||
17 3 TRUE
|
||||
18 3 FALSE
|
||||
19 4 TRUE
|
||||
20 4 FALSE
|
||||
21 5 TRUE
|
||||
22 5 FALSE
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
13 1 TRUE
|
||||
14 1 FALSE
|
||||
15 2 TRUE
|
||||
16 2 FALSE
|
||||
17 3 TRUE
|
||||
18 3 FALSE
|
||||
19 4 TRUE
|
||||
20 4 FALSE
|
||||
21 5 TRUE
|
||||
22 5 FALSE
|
||||
23 1 FALSE
|
||||
24 2 FALSE
|
||||
25 3 FALSE
|
||||
26 4 FALSE
|
||||
27 5 FALSE
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
13 1 TRUE
|
||||
14 1 FALSE
|
||||
15 2 TRUE
|
||||
16 2 FALSE
|
||||
17 3 TRUE
|
||||
18 3 FALSE
|
||||
19 4 TRUE
|
||||
20 4 FALSE
|
||||
21 5 TRUE
|
||||
22 5 FALSE
|
||||
23 1 FALSE
|
||||
24 2 FALSE
|
||||
25 3 FALSE
|
||||
26 4 FALSE
|
||||
27 5 FALSE
|
||||
30 1 FALSE
|
||||
31 2 FALSE
|
||||
32 3 FALSE
|
||||
33 4 FALSE
|
||||
34 5 FALSE
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
13 1 TRUE
|
||||
14 1 FALSE
|
||||
15 2 TRUE
|
||||
16 2 FALSE
|
||||
17 3 TRUE
|
||||
18 3 FALSE
|
||||
19 4 TRUE
|
||||
20 4 FALSE
|
||||
21 5 TRUE
|
||||
22 5 FALSE
|
||||
23 1 FALSE
|
||||
24 2 FALSE
|
||||
25 3 FALSE
|
||||
26 4 FALSE
|
||||
27 5 FALSE
|
||||
30 1 FALSE
|
||||
31 2 FALSE
|
||||
32 3 FALSE
|
||||
33 4 FALSE
|
||||
34 5 FALSE
|
||||
37 1 FALSE
|
||||
38 2 FALSE
|
||||
39 3 FALSE
|
||||
40 4 FALSE
|
||||
41 5 FALSE
|
||||
44 1 FALSE
|
||||
45 2 FALSE
|
||||
46 3 FALSE
|
||||
47 4 FALSE
|
||||
48 5 FALSE
|
||||
51 1 FALSE
|
||||
52 2 FALSE
|
||||
53 3 FALSE
|
||||
54 4 FALSE
|
||||
55 5 FALSE
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
DROP TABLE IF EXISTS t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
CREATE TABLE t1(
|
||||
c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
CREATE TABLE t2(
|
||||
c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t2 SELECT c1 FROM t1;
|
||||
Got one of the listed errors
|
||||
INSERT INTO t2 SELECT NULL FROM t1;
|
||||
Got one of the listed errors
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
@ -1433,7 +1433,7 @@ insert t2 select * from t1;
|
||||
insert t3 select * from t1;
|
||||
checksum table t1, t2, t3, t4 quick;
|
||||
Table Checksum
|
||||
test.t1 3442722830
|
||||
test.t1 2948697075
|
||||
test.t2 NULL
|
||||
test.t3 NULL
|
||||
test.t4 NULL
|
||||
@ -1441,17 +1441,17 @@ Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
checksum table t1, t2, t3, t4;
|
||||
Table Checksum
|
||||
test.t1 3442722830
|
||||
test.t2 3442722830
|
||||
test.t3 3442722830
|
||||
test.t1 2948697075
|
||||
test.t2 2948697075
|
||||
test.t3 2948697075
|
||||
test.t4 NULL
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
checksum table t1, t2, t3, t4 extended;
|
||||
Table Checksum
|
||||
test.t1 3442722830
|
||||
test.t2 3442722830
|
||||
test.t3 3442722830
|
||||
test.t1 2948697075
|
||||
test.t2 2948697075
|
||||
test.t3 2948697075
|
||||
test.t4 NULL
|
||||
Warnings:
|
||||
Error 1146 Table 'test.t4' doesn't exist
|
||||
@ -1508,7 +1508,7 @@ t2 CREATE TABLE `t2` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop index id2 on t2;
|
||||
drop index id on t2;
|
||||
Got one of the listed errors
|
||||
ERROR HY000: Cannot drop index 'id': needed in a foreign key constraint
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
@ -1738,7 +1738,7 @@ count(*)
|
||||
drop table t1;
|
||||
show status like "Innodb_buffer_pool_pages_total";
|
||||
Variable_name Value
|
||||
Innodb_buffer_pool_pages_total 512
|
||||
Innodb_buffer_pool_pages_total 511
|
||||
show status like "Innodb_page_size";
|
||||
Variable_name Value
|
||||
Innodb_page_size 16384
|
||||
@ -1781,10 +1781,9 @@ set global innodb_sync_spin_loops=20;
|
||||
show variables like "innodb_sync_spin_loops";
|
||||
Variable_name Value
|
||||
innodb_sync_spin_loops 20
|
||||
SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
|
||||
show variables like "innodb_thread_concurrency";
|
||||
Variable_name Value
|
||||
innodb_thread_concurrency 8
|
||||
innodb_thread_concurrency 0
|
||||
set global innodb_thread_concurrency=1001;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect thread_concurrency value: '1001'
|
||||
@ -1799,7 +1798,6 @@ set global innodb_thread_concurrency=16;
|
||||
show variables like "innodb_thread_concurrency";
|
||||
Variable_name Value
|
||||
innodb_thread_concurrency 16
|
||||
SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
|
||||
show variables like "innodb_concurrency_tickets";
|
||||
Variable_name Value
|
||||
innodb_concurrency_tickets 500
|
||||
@ -1970,7 +1968,7 @@ explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a '
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 13 const # Using where; Using index
|
||||
alter table t1 add unique(v);
|
||||
ERROR 23000: Duplicate entry '{ ' for key 'v_2'
|
||||
ERROR 23000: Duplicate entry 'v' for key 'v_2'
|
||||
alter table t1 add key(v);
|
||||
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
|
||||
qq
|
||||
@ -2377,6 +2375,8 @@ t1 CREATE TABLE `t1` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (v varchar(10), c char(10)) row_format=fixed;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
@ -3190,6 +3190,7 @@ t1 CREATE TABLE `t1` (
|
||||
CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1,t2;
|
||||
set innodb_strict_mode=on;
|
||||
CREATE TABLE t1 (
|
||||
c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
|
||||
c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
|
||||
|
@ -1,8 +1,4 @@
|
||||
SELECT f4, f8 FROM bug34300;
|
||||
f4 f8
|
||||
xxx zzz
|
||||
ALTER TABLE bug34300 ADD COLUMN (f10 INT);
|
||||
SELECT f4, f8 FROM bug34300;
|
||||
f4 f8
|
||||
xxx zzz
|
||||
DROP TABLE bug34300;
|
||||
|
@ -300,14 +300,14 @@ set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
||||
select ROUND(RAND(),5);
|
||||
ROUND(RAND(),5)
|
||||
0.02887
|
||||
show variables like '%alloc%';
|
||||
show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
Variable_name Value
|
||||
query_alloc_block_size 8192
|
||||
query_prealloc_size 8192
|
||||
range_alloc_block_size 4096
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 8192
|
||||
QUERY_PREALLOC_SIZE 8192
|
||||
@ -322,14 +322,14 @@ set @@transaction_prealloc_size=1024*21-1;
|
||||
select @@query_alloc_block_size;
|
||||
@@query_alloc_block_size
|
||||
17408
|
||||
show variables like '%alloc%';
|
||||
show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
Variable_name Value
|
||||
query_alloc_block_size 17408
|
||||
query_prealloc_size 18432
|
||||
range_alloc_block_size 16384
|
||||
transaction_alloc_block_size 19456
|
||||
transaction_prealloc_size 20480
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 17408
|
||||
QUERY_PREALLOC_SIZE 18432
|
||||
@ -339,14 +339,14 @@ TRANSACTION_PREALLOC_SIZE 20480
|
||||
set @@range_alloc_block_size=default;
|
||||
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
|
||||
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
|
||||
show variables like '%alloc%';
|
||||
show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
Variable_name Value
|
||||
query_alloc_block_size 8192
|
||||
query_prealloc_size 8192
|
||||
range_alloc_block_size 4096
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 8192
|
||||
QUERY_PREALLOC_SIZE 8192
|
||||
|
@ -156,7 +156,7 @@ DROP TABLE t1;
|
||||
#
|
||||
# Test changes to AUTOINC next value calculation
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL),(5),(NULL);
|
||||
@ -173,7 +173,7 @@ DROP TABLE t1;
|
||||
# Reset the AUTOINC session variables
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(0);
|
||||
@ -193,13 +193,13 @@ DROP TABLE t1;
|
||||
# Reset the AUTOINC session variables
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
@ -214,13 +214,13 @@ DROP TABLE t1;
|
||||
# Reset the AUTOINC session variables
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
INSERT INTO t1 VALUES (-2);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
@ -240,13 +240,13 @@ DROP TABLE t1;
|
||||
# Reset the AUTOINC session variables
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
@ -262,7 +262,7 @@ DROP TABLE t1;
|
||||
# Check for overflow handling when increment is > 1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
@ -271,7 +271,7 @@ INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (9223372036854775794); #-- 2^63 - 14
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
# This should just fit
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
@ -281,7 +281,7 @@ DROP TABLE t1;
|
||||
# Check for overflow handling when increment and offser are > 1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
@ -290,7 +290,7 @@ INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
# This should fail because of overflow but it doesn't, it seems to be
|
||||
# a MySQL server bug. It wraps around to 0 for the last value.
|
||||
# See MySQL Bug# 39828
|
||||
@ -313,7 +313,7 @@ DROP TABLE t1;
|
||||
# Check for overflow handling when increment and offset are odd numbers
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
@ -322,7 +322,7 @@ INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
# This should fail because of overflow but it doesn't. It fails with
|
||||
# a duplicate entry message because of a MySQL server bug, it wraps
|
||||
# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace
|
||||
@ -344,7 +344,7 @@ DROP TABLE t1;
|
||||
# and check for large -ve numbers
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
@ -355,7 +355,7 @@ INSERT INTO t1 VALUES(-9223372036854775807); #-- -2^63 + 1
|
||||
INSERT INTO t1 VALUES(-9223372036854775808); #-- -2^63
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@ -364,7 +364,7 @@ DROP TABLE t1;
|
||||
# large numbers 2^60
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
@ -373,7 +373,7 @@ INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
|
||||
SHOW VARIABLES LIKE "auto_inc%";
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
# This should fail because of overflow but it doesn't. It wraps around
|
||||
# and the autoinc values look bogus too.
|
||||
# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error
|
||||
@ -390,3 +390,91 @@ INSERT INTO t1 VALUES (NULL);
|
||||
#endif
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Check for floating point autoinc column handling
|
||||
#
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL, 1);
|
||||
INSERT INTO t1 VALUES(NULL, 2);
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES(NULL, 3);
|
||||
INSERT INTO t1 VALUES(NULL, 4);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL, 1);
|
||||
INSERT INTO t1 VALUES(NULL, 2);
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES(NULL, 3);
|
||||
INSERT INTO t1 VALUES(NULL, 4);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug# 42714: AUTOINC column calculated next value not greater than highest
|
||||
# value stored in table.
|
||||
#
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 (
|
||||
a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
b INT(10) UNSIGNED NOT NULL,
|
||||
c ENUM('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (a)) ENGINE = InnoDB;
|
||||
CREATE TABLE t2 (
|
||||
m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
n INT(10) UNSIGNED NOT NULL,
|
||||
o enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (m)) ENGINE = InnoDB;
|
||||
INSERT INTO t2 (n,o) VALUES
|
||||
(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'),
|
||||
(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false');
|
||||
SHOW CREATE TABLE t2;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
#
|
||||
# 43203: Overflow from auto incrementing causes server segv
|
||||
#
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1(
|
||||
c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
CREATE TABLE t2(
|
||||
c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t2 SELECT c1 FROM t1;
|
||||
-- error ER_DUP_ENTRY,1467
|
||||
INSERT INTO t2 SELECT NULL FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
@ -1126,7 +1126,7 @@ show create table t2;
|
||||
create index id2 on t2 (id);
|
||||
show create table t2;
|
||||
drop index id2 on t2;
|
||||
--error 1025,1025
|
||||
--error ER_DROP_INDEX_FK
|
||||
drop index id on t2;
|
||||
show create table t2;
|
||||
drop table t2;
|
||||
@ -1163,7 +1163,7 @@ drop table t2;
|
||||
# Test error handling
|
||||
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
--error ER_WRONG_FK_DEF
|
||||
create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
|
||||
|
||||
@ -1294,6 +1294,7 @@ drop table t1;
|
||||
|
||||
# Test for testable InnoDB status variables. This test
|
||||
# uses previous ones(pages_created, rows_deleted, ...).
|
||||
--replace_result 512 511
|
||||
show status like "Innodb_buffer_pool_pages_total";
|
||||
show status like "Innodb_page_size";
|
||||
show status like "Innodb_rows_deleted";
|
||||
@ -1317,7 +1318,6 @@ set global innodb_sync_spin_loops=20;
|
||||
show variables like "innodb_sync_spin_loops";
|
||||
|
||||
# Test for innodb_thread_concurrency variable
|
||||
SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
|
||||
show variables like "innodb_thread_concurrency";
|
||||
set global innodb_thread_concurrency=1001;
|
||||
show variables like "innodb_thread_concurrency";
|
||||
@ -1325,7 +1325,6 @@ set global innodb_thread_concurrency=0;
|
||||
show variables like "innodb_thread_concurrency";
|
||||
set global innodb_thread_concurrency=16;
|
||||
show variables like "innodb_thread_concurrency";
|
||||
SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
|
||||
|
||||
# Test for innodb_concurrency_tickets variable
|
||||
show variables like "innodb_concurrency_tickets";
|
||||
@ -1358,7 +1357,7 @@ source include/varchar.inc;
|
||||
#
|
||||
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
create table t1 (v varchar(65530), key(v));
|
||||
drop table t1;
|
||||
create table t1 (v varchar(65536));
|
||||
@ -1633,7 +1632,7 @@ disconnect b;
|
||||
set foreign_key_checks=0;
|
||||
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
-- error 1005
|
||||
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
|
||||
set foreign_key_checks=1;
|
||||
@ -1645,7 +1644,7 @@ drop table t2;
|
||||
set foreign_key_checks=0;
|
||||
create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
-- error 1005
|
||||
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
|
||||
set foreign_key_checks=1;
|
||||
@ -1676,7 +1675,7 @@ set foreign_key_checks=0;
|
||||
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
|
||||
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
-- error 1025
|
||||
rename table t3 to t1;
|
||||
set foreign_key_checks=1;
|
||||
@ -2316,7 +2315,7 @@ ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
|
||||
# mysqltest first does replace_regex, then replace_result
|
||||
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
|
||||
# Embedded server doesn't chdir to data directory
|
||||
--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
|
||||
--replace_result $MYSQLTEST_VARDIR . master-data/ ''
|
||||
--error 1025
|
||||
ALTER TABLE t2 MODIFY a INT NOT NULL;
|
||||
DELETE FROM t1;
|
||||
@ -2357,6 +2356,7 @@ DROP TABLE t1,t2;
|
||||
#
|
||||
# Bug #21101 (Prints wrong error message if max row size is too large)
|
||||
#
|
||||
set innodb_strict_mode=on;
|
||||
--error 1118
|
||||
CREATE TABLE t1 (
|
||||
c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
|
||||
|
@ -21,7 +21,6 @@ CREATE TABLE bug34300 (
|
||||
|
||||
INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz');
|
||||
|
||||
-- enable_query_log
|
||||
-- enable_result_log
|
||||
|
||||
SELECT f4, f8 FROM bug34300;
|
||||
@ -31,11 +30,3 @@ ALTER TABLE bug34300 ADD COLUMN (f10 INT);
|
||||
SELECT f4, f8 FROM bug34300;
|
||||
|
||||
DROP TABLE bug34300;
|
||||
|
||||
disconnect newconn;
|
||||
connection default;
|
||||
--disable_result_log
|
||||
--disable_query_log
|
||||
SET @@global.max_allowed_packet=default;
|
||||
--enable_result_log
|
||||
--enable_query_log
|
||||
|
@ -27,14 +27,14 @@ UPDATE t1 SET DATA = data*2 WHERE id = 3;
|
||||
|
||||
# grouping/referencing in replace_regex is very slow on long strings,
|
||||
# removing all before/after the interesting row before grouping/referencing
|
||||
--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
||||
--replace_regex /.*---TRANSACTION [0-9A-F]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
|
||||
UPDATE t1 SET data = data*2 WHERE data = 2;
|
||||
|
||||
# grouping/referencing in replace_regex is very slow on long strings,
|
||||
# removing all before/after the interesting row before grouping/referencing
|
||||
--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
||||
--replace_regex /.*---TRANSACTION [0-9A-F]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
|
||||
SET @@session.tx_isolation = @old_tx_isolation;
|
||||
|
@ -40,6 +40,7 @@ drop table t1;
|
||||
create table t1 (a bit) engine=innodb;
|
||||
insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001');
|
||||
select hex(a) from t1;
|
||||
--replace_regex /entry '(.*)' for/entry '' for/
|
||||
--error ER_DUP_ENTRY
|
||||
alter table t1 add unique (a);
|
||||
drop table t1;
|
||||
|
@ -174,21 +174,21 @@ select @@timestamp>0;
|
||||
set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
||||
select ROUND(RAND(),5);
|
||||
|
||||
show variables like '%alloc%';
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
set @@range_alloc_block_size=1024*16;
|
||||
set @@query_alloc_block_size=1024*17+2;
|
||||
set @@query_prealloc_size=1024*18;
|
||||
set @@transaction_alloc_block_size=1024*20-1;
|
||||
set @@transaction_prealloc_size=1024*21-1;
|
||||
select @@query_alloc_block_size;
|
||||
show variables like '%alloc%';
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
set @@range_alloc_block_size=default;
|
||||
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
|
||||
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
|
||||
show variables like '%alloc%';
|
||||
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
|
||||
#
|
||||
# Bug #10904 Illegal mix of collations between
|
||||
|
@ -1,29 +0,0 @@
|
||||
This is the source of the InnoDB Plugin 1.0.3 for MySQL 5.1
|
||||
===========================================================
|
||||
|
||||
Instructions for compiling the plugin:
|
||||
--------------------------------------
|
||||
|
||||
1. Get the latest MySQL 5.1 sources from
|
||||
http://dev.mysql.com/downloads/mysql/5.1.html#source
|
||||
|
||||
2. Replace the contents of the mysql-5.1.N/storage/innobase/ directory
|
||||
with the contents of this directory.
|
||||
|
||||
3. Optional (only necessary if you are going to run tests from the
|
||||
mysql-test suite): cd into the innobase directory and run ./setup.sh
|
||||
|
||||
4. Compile MySQL as usual.
|
||||
|
||||
5. Enjoy!
|
||||
|
||||
See the online documentation for more detailed instructions:
|
||||
http://www.innodb.com/doc/innodb_plugin-1.0/innodb-plugin-installation.html
|
||||
|
||||
For more information about InnoDB visit
|
||||
http://www.innodb.com
|
||||
|
||||
Please report any problems or issues with the plugin in the InnoDB Forums
|
||||
http://forums.innodb.com/ or in the MySQL Bugs database http://bugs.mysql.com
|
||||
|
||||
Thank you for using the InnoDB plugin!
|
@ -1,21 +0,0 @@
|
||||
#
|
||||
# Bug#11650: LIKE pattern matching using prefix index
|
||||
# doesn't return correct result
|
||||
#
|
||||
--disable_warnings
|
||||
#
|
||||
# This query creates a column using
|
||||
# character_set_connection and
|
||||
# collation_connection.
|
||||
#
|
||||
create table t1 engine=innodb select repeat('a',50) as c1;
|
||||
--enable_warnings
|
||||
alter table t1 add index(c1(5));
|
||||
|
||||
insert into t1 values ('abcdefg'),('abcde100'),('abcde110'),('abcde111');
|
||||
select collation(c1) from t1 limit 1;
|
||||
select c1 from t1 where c1 like 'abcdef%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde1%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde11%' order by c1;
|
||||
select c1 from t1 where c1 like 'abcde111%' order by c1;
|
||||
drop table t1;
|
@ -1,4 +0,0 @@
|
||||
disable_query_log;
|
||||
--require r/true.require
|
||||
select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'innodb';
|
||||
enable_query_log;
|
@ -1,869 +0,0 @@
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (9223372036854775807, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
9223372036854775807 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (127, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
127 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (255, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
255 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (32767, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
32767 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (65535, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
65535 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (8388607, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
8388607 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (16777215, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
16777215 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (2147483647, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
2147483647 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (4294967295, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
4294967295 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (9223372036854775807, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
9223372036854775807 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (18446744073709551615, null);
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
18446744073709551615 NULL
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
SELECT c1 FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
|
||||
TRUNCATE TABLE t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
SELECT c1 FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
SELECT c1 FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
|
||||
DELETE FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
SELECT c1 FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
3
|
||||
7
|
||||
8
|
||||
9
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
||||
PRIMARY KEY (`c1`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL, 1);
|
||||
DELETE FROM t1 WHERE c1 = 1;
|
||||
INSERT INTO t1 VALUES (2,1);
|
||||
INSERT INTO t1 VALUES (NULL,8);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
2 1
|
||||
3 8
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL, 1);
|
||||
DELETE FROM t1 WHERE c1 = 1;
|
||||
INSERT INTO t1 VALUES (2,1), (NULL, 8);
|
||||
INSERT INTO t1 VALUES (NULL,9);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
2 1
|
||||
3 8
|
||||
5 9
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 100
|
||||
auto_increment_offset 10
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL),(5),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
5
|
||||
10
|
||||
110
|
||||
250
|
||||
310
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SET @@INSERT_ID=400;
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
5
|
||||
10
|
||||
110
|
||||
250
|
||||
310
|
||||
400
|
||||
410
|
||||
1000
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(0);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-1
|
||||
1
|
||||
2
|
||||
10
|
||||
110
|
||||
250
|
||||
410
|
||||
SET @@INSERT_ID=400;
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-1
|
||||
1
|
||||
2
|
||||
10
|
||||
110
|
||||
250
|
||||
410
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 100
|
||||
auto_increment_offset 10
|
||||
INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-2
|
||||
-1
|
||||
1
|
||||
2
|
||||
10
|
||||
250
|
||||
310
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SET @@INSERT_ID=400;
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-2
|
||||
-1
|
||||
1
|
||||
2
|
||||
10
|
||||
250
|
||||
310
|
||||
400
|
||||
410
|
||||
1000
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 100
|
||||
auto_increment_offset 10
|
||||
INSERT INTO t1 VALUES (-2);
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (250);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
10
|
||||
110
|
||||
210
|
||||
250
|
||||
310
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SET @@INSERT_ID=400;
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
10
|
||||
110
|
||||
210
|
||||
250
|
||||
310
|
||||
400
|
||||
1000
|
||||
1010
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 100
|
||||
auto_increment_offset 10
|
||||
INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
|
||||
Warnings:
|
||||
Warning 1264 Out of range value for column 'c1' at row 1
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
10
|
||||
110
|
||||
210
|
||||
250
|
||||
410
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SET @@INSERT_ID=400;
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
Got one of the listed errors
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
2
|
||||
10
|
||||
110
|
||||
210
|
||||
250
|
||||
410
|
||||
1000
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (9223372036854775794);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
9223372036854775794
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 2
|
||||
auto_increment_offset 10
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
9223372036854775794
|
||||
9223372036854775796
|
||||
9223372036854775798
|
||||
9223372036854775800
|
||||
9223372036854775802
|
||||
9223372036854775804
|
||||
9223372036854775806
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551603);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
18446744073709551603
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 2
|
||||
auto_increment_offset 10
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
18446744073709551603
|
||||
18446744073709551604
|
||||
18446744073709551606
|
||||
18446744073709551608
|
||||
18446744073709551610
|
||||
18446744073709551612
|
||||
18446744073709551614
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551603);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
18446744073709551603
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 5
|
||||
auto_increment_offset 7
|
||||
INSERT INTO t1 VALUES (NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
18446744073709551603
|
||||
18446744073709551607
|
||||
18446744073709551612
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES(-9223372036854775806);
|
||||
INSERT INTO t1 VALUES(-9223372036854775807);
|
||||
INSERT INTO t1 VALUES(-9223372036854775808);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-9223372036854775808
|
||||
-9223372036854775807
|
||||
-9223372036854775806
|
||||
1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 3
|
||||
auto_increment_offset 3
|
||||
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
-9223372036854775808
|
||||
-9223372036854775807
|
||||
-9223372036854775806
|
||||
1
|
||||
3
|
||||
6
|
||||
9
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551610);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
18446744073709551610
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976'
|
||||
Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976'
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 65535
|
||||
auto_increment_offset 65535
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SELECT * FROM t1;
|
||||
c1
|
||||
1
|
||||
18446744073709551610
|
||||
18446744073709551615
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
Variable_name Value
|
||||
auto_increment_increment 1
|
||||
auto_increment_offset 1
|
||||
CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL, 1);
|
||||
INSERT INTO t1 VALUES(NULL, 2);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
INSERT INTO t1 VALUES(NULL, 3);
|
||||
INSERT INTO t1 VALUES(NULL, 4);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL, 1);
|
||||
INSERT INTO t1 VALUES(NULL, 2);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
INSERT INTO t1 VALUES(NULL, 3);
|
||||
INSERT INTO t1 VALUES(NULL, 4);
|
||||
SELECT * FROM t1;
|
||||
c1 c2
|
||||
1 1
|
||||
2 2
|
||||
3 3
|
||||
4 4
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
DROP TABLE IF EXISTS t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
CREATE TABLE t1 (
|
||||
a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
b INT(10) UNSIGNED NOT NULL,
|
||||
c ENUM('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (a)) ENGINE = InnoDB;
|
||||
CREATE TABLE t2 (
|
||||
m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
n INT(10) UNSIGNED NOT NULL,
|
||||
o enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (m)) ENGINE = InnoDB;
|
||||
INSERT INTO t2 (n,o) VALUES
|
||||
(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'),
|
||||
(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false');
|
||||
SHOW CREATE TABLE t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`m` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`n` int(10) unsigned NOT NULL,
|
||||
`o` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`m`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
13 1 TRUE
|
||||
14 1 FALSE
|
||||
15 2 TRUE
|
||||
16 2 FALSE
|
||||
17 3 TRUE
|
||||
18 3 FALSE
|
||||
19 4 TRUE
|
||||
20 4 FALSE
|
||||
21 5 TRUE
|
||||
22 5 FALSE
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
13 1 TRUE
|
||||
14 1 FALSE
|
||||
15 2 TRUE
|
||||
16 2 FALSE
|
||||
17 3 TRUE
|
||||
18 3 FALSE
|
||||
19 4 TRUE
|
||||
20 4 FALSE
|
||||
21 5 TRUE
|
||||
22 5 FALSE
|
||||
23 1 FALSE
|
||||
24 2 FALSE
|
||||
25 3 FALSE
|
||||
26 4 FALSE
|
||||
27 5 FALSE
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
13 1 TRUE
|
||||
14 1 FALSE
|
||||
15 2 TRUE
|
||||
16 2 FALSE
|
||||
17 3 TRUE
|
||||
18 3 FALSE
|
||||
19 4 TRUE
|
||||
20 4 FALSE
|
||||
21 5 TRUE
|
||||
22 5 FALSE
|
||||
23 1 FALSE
|
||||
24 2 FALSE
|
||||
25 3 FALSE
|
||||
26 4 FALSE
|
||||
27 5 FALSE
|
||||
30 1 FALSE
|
||||
31 2 FALSE
|
||||
32 3 FALSE
|
||||
33 4 FALSE
|
||||
34 5 FALSE
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
a b c
|
||||
1 1 TRUE
|
||||
2 1 FALSE
|
||||
3 2 TRUE
|
||||
4 2 FALSE
|
||||
5 3 TRUE
|
||||
6 3 FALSE
|
||||
7 4 TRUE
|
||||
8 4 FALSE
|
||||
9 5 TRUE
|
||||
10 5 FALSE
|
||||
13 1 TRUE
|
||||
14 1 FALSE
|
||||
15 2 TRUE
|
||||
16 2 FALSE
|
||||
17 3 TRUE
|
||||
18 3 FALSE
|
||||
19 4 TRUE
|
||||
20 4 FALSE
|
||||
21 5 TRUE
|
||||
22 5 FALSE
|
||||
23 1 FALSE
|
||||
24 2 FALSE
|
||||
25 3 FALSE
|
||||
26 4 FALSE
|
||||
27 5 FALSE
|
||||
30 1 FALSE
|
||||
31 2 FALSE
|
||||
32 3 FALSE
|
||||
33 4 FALSE
|
||||
34 5 FALSE
|
||||
37 1 FALSE
|
||||
38 2 FALSE
|
||||
39 3 FALSE
|
||||
40 4 FALSE
|
||||
41 5 FALSE
|
||||
44 1 FALSE
|
||||
45 2 FALSE
|
||||
46 3 FALSE
|
||||
47 4 FALSE
|
||||
48 5 FALSE
|
||||
51 1 FALSE
|
||||
52 2 FALSE
|
||||
53 3 FALSE
|
||||
54 4 FALSE
|
||||
55 5 FALSE
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`b` int(10) unsigned NOT NULL,
|
||||
`c` enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
DROP TABLE IF EXISTS t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
CREATE TABLE t1(
|
||||
c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
CREATE TABLE t2(
|
||||
c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t2 SELECT c1 FROM t1;
|
||||
Got one of the listed errors
|
||||
INSERT INTO t2 SELECT NULL FROM t1;
|
||||
Got one of the listed errors
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
@ -1,480 +0,0 @@
|
||||
-- source include/have_innodb.inc
|
||||
# embedded server ignores 'delayed', so skip this
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug #34335
|
||||
#
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (9223372036854775807, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
## Test AUTOINC overflow
|
||||
##
|
||||
|
||||
# TINYINT
|
||||
CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (127, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (255, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# SMALLINT
|
||||
#
|
||||
CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (32767, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (65535, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MEDIUMINT
|
||||
#
|
||||
CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (8388607, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (16777215, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# INT
|
||||
#
|
||||
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (2147483647, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (4294967295, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BIGINT
|
||||
#
|
||||
CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (9223372036854775807, null);
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (18446744073709551615, null);
|
||||
-- error ER_AUTOINC_READ_FAILED,1467
|
||||
INSERT INTO t1 (c2) VALUES ('innodb');
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug 37531
|
||||
# After truncate, auto_increment behaves incorrectly for InnoDB
|
||||
#
|
||||
CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
SELECT c1 FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
TRUNCATE TABLE t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
SELECT c1 FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Deleting all records should not reset the AUTOINC counter.
|
||||
#
|
||||
CREATE TABLE t1(c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
SELECT c1 FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DELETE FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
|
||||
SELECT c1 FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug 38839
|
||||
# Reset the last value generated at end of statement
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL, 1);
|
||||
DELETE FROM t1 WHERE c1 = 1;
|
||||
INSERT INTO t1 VALUES (2,1);
|
||||
INSERT INTO t1 VALUES (NULL,8);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
# Bug 38839 -- same as above but for multi value insert
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL, 1);
|
||||
DELETE FROM t1 WHERE c1 = 1;
|
||||
INSERT INTO t1 VALUES (2,1), (NULL, 8);
|
||||
INSERT INTO t1 VALUES (NULL,9);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Test changes to AUTOINC next value calculation
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL),(5),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SET @@INSERT_ID=400;
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Test with SIGNED INT column, by inserting a 0 for the first column value
|
||||
# 0 is treated in the same was NULL.
|
||||
# Reset the AUTOINC session variables
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(0);
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
INSERT INTO t1 VALUES (-1), (NULL),(2),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
SET @@INSERT_ID=400;
|
||||
# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Test with SIGNED INT column
|
||||
# Reset the AUTOINC session variables
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SET @@INSERT_ID=400;
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Test with UNSIGNED INT column, single insert
|
||||
# The sign in the value is ignored and a new column value is generated
|
||||
# Reset the AUTOINC session variables
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
INSERT INTO t1 VALUES (-2);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
INSERT INTO t1 VALUES (250);
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SET @@INSERT_ID=400;
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Test with UNSIGNED INT column, multi-value inserts
|
||||
# The sign in the value is ignored and a new column value is generated
|
||||
# Reset the AUTOINC session variables
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(-1);
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL);
|
||||
INSERT INTO t1 VALUES (250),(NULL);
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES (1000);
|
||||
SET @@INSERT_ID=400;
|
||||
# Duplicate error expected here for autoinc_lock_mode != TRADITIONAL
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Check for overflow handling when increment is > 1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
# We have to do this because of a bug in the AUTOINC init code.
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (9223372036854775794); #-- 2^63 - 14
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
# This should just fit
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Check for overflow handling when increment and offser are > 1
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
# We have to do this because of a bug in the AUTOINC init code.
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
# This should fail because of overflow but it doesn't, it seems to be
|
||||
# a MySQL server bug. It wraps around to 0 for the last value.
|
||||
# See MySQL Bug# 39828
|
||||
#
|
||||
# Instead of wrapping around, it asserts when MySQL is compiled --with-debug
|
||||
# (see sql/handler.cc:handler::update_auto_increment()). Don't test for
|
||||
# overflow until Bug #39828 is fixed.
|
||||
#
|
||||
# Since this asserts when compiled --with-debug, we can't properly test this
|
||||
# until Bug #39828 is fixed. For now, this test is meaningless.
|
||||
#if Bug #39828 is fixed
|
||||
#INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
#else
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
#endif
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Check for overflow handling when increment and offset are odd numbers
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
# We have to do this because of a bug in the AUTOINC init code.
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
# This should fail because of overflow but it doesn't. It fails with
|
||||
# a duplicate entry message because of a MySQL server bug, it wraps
|
||||
# around. See MySQL Bug# 39828, once MySQL fix the bug we can replace
|
||||
# the ER_DUP_ENTRY, 1062 below with the appropriate error message
|
||||
#
|
||||
# Since this asserts when compiled --with-debug, we can't properly test this
|
||||
# until Bug #39828 is fixed. For now, this test is meaningless.
|
||||
#if Bug #39828 is fixed
|
||||
# Still need to fix this error code, error should mention overflow
|
||||
#-- error ER_DUP_ENTRY,1062
|
||||
#INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
|
||||
#else
|
||||
INSERT INTO t1 VALUES (NULL),(NULL);
|
||||
#endif
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# Check for overflow handling when increment and offset are odd numbers
|
||||
# and check for large -ve numbers
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
# We have to do this because of a bug in the AUTOINC init code.
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES(-9223372036854775806); #-- -2^63 + 2
|
||||
INSERT INTO t1 VALUES(-9223372036854775807); #-- -2^63 + 1
|
||||
INSERT INTO t1 VALUES(-9223372036854775808); #-- -2^63
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
INSERT INTO t1 VALUES (NULL),(NULL), (NULL);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Check for overflow handling when increment and offset are very
|
||||
# large numbers 2^60
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB;
|
||||
# TODO: Fix the autoinc init code
|
||||
# We have to do this because of a bug in the AUTOINC init code.
|
||||
INSERT INTO t1 VALUES(NULL);
|
||||
INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2
|
||||
SELECT * FROM t1;
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
# This should fail because of overflow but it doesn't. It wraps around
|
||||
# and the autoinc values look bogus too.
|
||||
# See MySQL Bug# 39828, once MySQL fix the bug we can enable the error
|
||||
# code expected test.
|
||||
# -- error ER_AUTOINC_READ_FAILED,1467
|
||||
#
|
||||
# Since this asserts when compiled --with-debug, we can't properly test this
|
||||
# until Bug #39828 is fixed. For now, this test is meaningless.
|
||||
#if Bug #39828 is fixed
|
||||
#-- error ER_AUTOINC_READ_FAILED,1467
|
||||
#INSERT INTO t1 VALUES (NULL),(NULL);
|
||||
#else
|
||||
INSERT INTO t1 VALUES (NULL);
|
||||
#endif
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Check for floating point autoinc column handling
|
||||
#
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
|
||||
SET @@INSERT_ID=1;
|
||||
SHOW VARIABLES LIKE "%auto_inc%";
|
||||
CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL, 1);
|
||||
INSERT INTO t1 VALUES(NULL, 2);
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES(NULL, 3);
|
||||
INSERT INTO t1 VALUES(NULL, 4);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(NULL, 1);
|
||||
INSERT INTO t1 VALUES(NULL, 2);
|
||||
SELECT * FROM t1;
|
||||
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
|
||||
SELECT * FROM t1;
|
||||
INSERT INTO t1 VALUES(NULL, 3);
|
||||
INSERT INTO t1 VALUES(NULL, 4);
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug# 42714: AUTOINC column calculated next value not greater than highest
|
||||
# value stored in table.
|
||||
#
|
||||
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 (
|
||||
a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
b INT(10) UNSIGNED NOT NULL,
|
||||
c ENUM('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (a)) ENGINE = InnoDB;
|
||||
CREATE TABLE t2 (
|
||||
m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
n INT(10) UNSIGNED NOT NULL,
|
||||
o enum('FALSE','TRUE') DEFAULT NULL,
|
||||
PRIMARY KEY (m)) ENGINE = InnoDB;
|
||||
INSERT INTO t2 (n,o) VALUES
|
||||
(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'),
|
||||
(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false');
|
||||
SHOW CREATE TABLE t2;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SHOW CREATE TABLE t1;
|
||||
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
|
||||
SELECT * FROM t1;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
#
|
||||
# 43203: Overflow from auto incrementing causes server segv
|
||||
#
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1(
|
||||
c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
|
||||
CREATE TABLE t2(
|
||||
c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT
|
||||
PRIMARY KEY) ENGINE=InnoDB;
|
||||
-- error ER_DUP_ENTRY,1062
|
||||
INSERT INTO t2 SELECT c1 FROM t1;
|
||||
-- error ER_DUP_ENTRY,1467
|
||||
INSERT INTO t2 SELECT NULL FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
@ -1,57 +0,0 @@
|
||||
set global innodb_table_locks=1;
|
||||
select @@innodb_table_locks;
|
||||
@@innodb_table_locks
|
||||
1
|
||||
drop table if exists t1;
|
||||
set @@innodb_table_locks=1;
|
||||
create table t1 (id integer, x integer) engine=INNODB;
|
||||
insert into t1 values(0, 0);
|
||||
set autocommit=0;
|
||||
SELECT * from t1 where id = 0 FOR UPDATE;
|
||||
id x
|
||||
0 0
|
||||
set autocommit=0;
|
||||
lock table t1 write;
|
||||
update t1 set x=1 where id = 0;
|
||||
select * from t1;
|
||||
id x
|
||||
0 1
|
||||
commit;
|
||||
update t1 set x=2 where id = 0;
|
||||
commit;
|
||||
unlock tables;
|
||||
select * from t1;
|
||||
id x
|
||||
0 2
|
||||
commit;
|
||||
drop table t1;
|
||||
set @@innodb_table_locks=0;
|
||||
create table t1 (id integer primary key, x integer) engine=INNODB;
|
||||
insert into t1 values(0, 0),(1,1),(2,2);
|
||||
commit;
|
||||
SELECT * from t1 where id = 0 FOR UPDATE;
|
||||
id x
|
||||
0 0
|
||||
set autocommit=0;
|
||||
set @@innodb_table_locks=0;
|
||||
lock table t1 write;
|
||||
update t1 set x=10 where id = 2;
|
||||
SELECT * from t1 where id = 2;
|
||||
id x
|
||||
2 2
|
||||
UPDATE t1 set x=3 where id = 2;
|
||||
commit;
|
||||
SELECT * from t1;
|
||||
id x
|
||||
0 0
|
||||
1 1
|
||||
2 3
|
||||
commit;
|
||||
unlock tables;
|
||||
commit;
|
||||
select * from t1;
|
||||
id x
|
||||
0 0
|
||||
1 1
|
||||
2 10
|
||||
drop table t1;
|
@ -1,102 +0,0 @@
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# Check and select innodb lock type
|
||||
#
|
||||
|
||||
set global innodb_table_locks=1;
|
||||
|
||||
select @@innodb_table_locks;
|
||||
|
||||
#
|
||||
# Testing of explicit table locks with enforced table locks
|
||||
#
|
||||
|
||||
connect (con1,localhost,root,,);
|
||||
connect (con2,localhost,root,,);
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Testing of explicit table locks with enforced table locks
|
||||
#
|
||||
|
||||
set @@innodb_table_locks=1;
|
||||
|
||||
connection con1;
|
||||
create table t1 (id integer, x integer) engine=INNODB;
|
||||
insert into t1 values(0, 0);
|
||||
set autocommit=0;
|
||||
SELECT * from t1 where id = 0 FOR UPDATE;
|
||||
|
||||
connection con2;
|
||||
set autocommit=0;
|
||||
|
||||
# The following statement should hang because con1 is locking the page
|
||||
--send
|
||||
lock table t1 write;
|
||||
--sleep 2
|
||||
|
||||
connection con1;
|
||||
update t1 set x=1 where id = 0;
|
||||
select * from t1;
|
||||
commit;
|
||||
|
||||
connection con2;
|
||||
reap;
|
||||
update t1 set x=2 where id = 0;
|
||||
commit;
|
||||
unlock tables;
|
||||
|
||||
connection con1;
|
||||
select * from t1;
|
||||
commit;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Try with old lock method (where LOCK TABLE is ignored by InnoDB)
|
||||
#
|
||||
|
||||
set @@innodb_table_locks=0;
|
||||
|
||||
create table t1 (id integer primary key, x integer) engine=INNODB;
|
||||
insert into t1 values(0, 0),(1,1),(2,2);
|
||||
commit;
|
||||
SELECT * from t1 where id = 0 FOR UPDATE;
|
||||
|
||||
connection con2;
|
||||
set autocommit=0;
|
||||
set @@innodb_table_locks=0;
|
||||
|
||||
# The following statement should work becase innodb doesn't check table locks
|
||||
lock table t1 write;
|
||||
|
||||
connection con1;
|
||||
|
||||
# This will be locked by MySQL
|
||||
--send
|
||||
update t1 set x=10 where id = 2;
|
||||
--sleep 2
|
||||
|
||||
connection con2;
|
||||
|
||||
# Note that we will get a deadlock if we try to select any rows marked
|
||||
# for update by con1 !
|
||||
|
||||
SELECT * from t1 where id = 2;
|
||||
UPDATE t1 set x=3 where id = 2;
|
||||
commit;
|
||||
SELECT * from t1;
|
||||
commit;
|
||||
unlock tables;
|
||||
|
||||
connection con1;
|
||||
reap;
|
||||
commit;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
@ -1 +0,0 @@
|
||||
--binlog_cache_size=32768 --innodb_lock_wait_timeout=1
|
@ -1,13 +0,0 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb;
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
replace delayed into t1 (c1, c2) values ( "text1","11");
|
||||
ERROR HY000: DELAYED option not supported for table 't1'
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
replace delayed into t1 (c1, c2) values ( "text1","12");
|
||||
ERROR HY000: DELAYED option not supported for table 't1'
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
drop table t1;
|
@ -1,22 +0,0 @@
|
||||
-- source include/have_innodb.inc
|
||||
# embedded server ignores 'delayed', so skip this
|
||||
-- source include/not_embedded.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Bug #1078
|
||||
#
|
||||
create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb;
|
||||
select * from t1;
|
||||
--error ER_DELAYED_NOT_SUPPORTED
|
||||
replace delayed into t1 (c1, c2) values ( "text1","11");
|
||||
select * from t1;
|
||||
--error ER_DELAYED_NOT_SUPPORTED
|
||||
replace delayed into t1 (c1, c2) values ( "text1","12");
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
@ -1 +0,0 @@
|
||||
--innodb_lock_wait_timeout=2
|
@ -1,40 +0,0 @@
|
||||
drop table if exists t1;
|
||||
set binlog_format=mixed;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
|
||||
set autocommit=0;
|
||||
select * from t1 where a=3 lock in share mode;
|
||||
a
|
||||
3
|
||||
set binlog_format=mixed;
|
||||
set session transaction isolation level repeatable read;
|
||||
set autocommit=0;
|
||||
update t1 set a=10 where a=5;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
set session transaction isolation level read committed;
|
||||
update t1 set a=10 where a=5;
|
||||
select * from t1 where a=2 for update;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
select * from t1 where a=2 limit 1 for update;
|
||||
a
|
||||
2
|
||||
update t1 set a=11 where a=6;
|
||||
update t1 set a=12 where a=2;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
update t1 set a=13 where a=1;
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
commit;
|
||||
update t1 set a=14 where a=1;
|
||||
commit;
|
||||
select * from t1;
|
||||
a
|
||||
14
|
||||
2
|
||||
3
|
||||
4
|
||||
10
|
||||
11
|
||||
7
|
||||
drop table t1;
|
@ -1,55 +0,0 @@
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
# basic tests of semi-consistent reads
|
||||
|
||||
connect (a,localhost,root,,);
|
||||
connect (b,localhost,root,,);
|
||||
connection a;
|
||||
set binlog_format=mixed;
|
||||
set session transaction isolation level repeatable read;
|
||||
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
|
||||
set autocommit=0;
|
||||
# this should lock the entire table
|
||||
select * from t1 where a=3 lock in share mode;
|
||||
connection b;
|
||||
set binlog_format=mixed;
|
||||
set session transaction isolation level repeatable read;
|
||||
set autocommit=0;
|
||||
-- error ER_LOCK_WAIT_TIMEOUT
|
||||
update t1 set a=10 where a=5;
|
||||
connection a;
|
||||
commit;
|
||||
connection b;
|
||||
# perform a semi-consisent read (and unlock non-matching rows)
|
||||
set session transaction isolation level read committed;
|
||||
update t1 set a=10 where a=5;
|
||||
connection a;
|
||||
-- error ER_LOCK_WAIT_TIMEOUT
|
||||
select * from t1 where a=2 for update;
|
||||
# this should lock the records (1),(2)
|
||||
select * from t1 where a=2 limit 1 for update;
|
||||
connection b;
|
||||
# semi-consistent read will skip non-matching locked rows a=1, a=2
|
||||
update t1 set a=11 where a=6;
|
||||
-- error ER_LOCK_WAIT_TIMEOUT
|
||||
update t1 set a=12 where a=2;
|
||||
-- error ER_LOCK_WAIT_TIMEOUT
|
||||
update t1 set a=13 where a=1;
|
||||
connection a;
|
||||
commit;
|
||||
connection b;
|
||||
update t1 set a=14 where a=1;
|
||||
commit;
|
||||
connection a;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
connection default;
|
||||
disconnect a;
|
||||
disconnect b;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
SET storage_engine=InnoDB;
|
@ -1,50 +0,0 @@
|
||||
#
|
||||
# Make sure http://bugs.mysql.com/34053 remains fixed.
|
||||
#
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
SET storage_engine=InnoDB;
|
||||
|
||||
# we do not really care about what gets printed, we are only
|
||||
# interested in getting success or failure according to our
|
||||
# expectations
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
|
||||
GRANT USAGE ON *.* TO 'shane'@'localhost' IDENTIFIED BY '12345';
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
-- connect (con1,localhost,shane,12345,)
|
||||
|
||||
-- connection con1
|
||||
-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;
|
||||
-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB;
|
||||
CREATE TABLE innodb_monitorx (a INT) ENGINE=INNODB;
|
||||
DROP TABLE innodb_monitorx;
|
||||
CREATE TABLE innodb_monito (a INT) ENGINE=INNODB;
|
||||
DROP TABLE innodb_monito;
|
||||
CREATE TABLE xinnodb_monitor (a INT) ENGINE=INNODB;
|
||||
DROP TABLE xinnodb_monitor;
|
||||
CREATE TABLE nnodb_monitor (a INT) ENGINE=INNODB;
|
||||
DROP TABLE nnodb_monitor;
|
||||
|
||||
-- connection default
|
||||
CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB;
|
||||
CREATE TABLE innodb_mem_validate (a INT) ENGINE=INNODB;
|
||||
|
||||
-- connection con1
|
||||
-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
DROP TABLE innodb_monitor;
|
||||
-- error ER_SPECIFIC_ACCESS_DENIED_ERROR
|
||||
DROP TABLE innodb_mem_validate;
|
||||
|
||||
-- connection default
|
||||
DROP TABLE innodb_monitor;
|
||||
DROP TABLE innodb_mem_validate;
|
||||
DROP USER 'shane'@'localhost';
|
||||
|
||||
-- disconnect con1
|
@ -1,4 +0,0 @@
|
||||
f4 f8
|
||||
xxx zzz
|
||||
f4 f8
|
||||
xxx zzz
|
@ -1,32 +0,0 @@
|
||||
#
|
||||
# Bug#34300 Tinyblob & tinytext fields currupted after export/import and alter in 5.1
|
||||
# http://bugs.mysql.com/34300
|
||||
#
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
|
||||
# set packet size and reconnect
|
||||
SET @@global.max_allowed_packet=16777216;
|
||||
--connect (newconn, localhost, root,,)
|
||||
|
||||
DROP TABLE IF EXISTS bug34300;
|
||||
CREATE TABLE bug34300 (
|
||||
f4 TINYTEXT,
|
||||
f6 MEDIUMTEXT,
|
||||
f8 TINYBLOB
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO bug34300 VALUES ('xxx', repeat('a', 8459264), 'zzz');
|
||||
|
||||
-- enable_result_log
|
||||
|
||||
SELECT f4, f8 FROM bug34300;
|
||||
|
||||
ALTER TABLE bug34300 ADD COLUMN (f10 INT);
|
||||
|
||||
SELECT f4, f8 FROM bug34300;
|
||||
|
||||
DROP TABLE bug34300;
|
@ -1 +0,0 @@
|
||||
SET storage_engine=InnoDB;
|
@ -1,16 +0,0 @@
|
||||
#
|
||||
# Bug#35220 ALTER TABLE too picky on reserved word "foreign"
|
||||
# http://bugs.mysql.com/35220
|
||||
#
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
SET storage_engine=InnoDB;
|
||||
|
||||
# we care only that the following SQL commands do not produce errors
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
|
||||
CREATE TABLE bug35220 (foreign_col INT, dummy_cant_delete_all_columns INT);
|
||||
ALTER TABLE bug35220 DROP foreign_col;
|
||||
DROP TABLE bug35220;
|
@ -1,51 +0,0 @@
|
||||
-- connect (con1,localhost,root,,)
|
||||
-- connect (con2,localhost,root,,)
|
||||
|
||||
-- connection con1
|
||||
SET autocommit=0;
|
||||
SELECT * FROM t1 FOR UPDATE;
|
||||
-- if ($con1_extra_sql_present) {
|
||||
-- eval $con1_extra_sql
|
||||
-- }
|
||||
|
||||
-- connection con2
|
||||
SET autocommit=0;
|
||||
SELECT * FROM t2 FOR UPDATE;
|
||||
-- if ($con2_extra_sql_present) {
|
||||
-- eval $con2_extra_sql
|
||||
-- }
|
||||
|
||||
-- if ($con1_should_be_rolledback) {
|
||||
-- connection con1
|
||||
-- send
|
||||
INSERT INTO t2 VALUES (0);
|
||||
|
||||
-- connection con2
|
||||
INSERT INTO t1 VALUES (0);
|
||||
ROLLBACK;
|
||||
|
||||
-- connection con1
|
||||
-- error ER_LOCK_DEADLOCK
|
||||
-- reap
|
||||
-- }
|
||||
# else
|
||||
-- if (!$con1_should_be_rolledback) {
|
||||
-- connection con2
|
||||
-- send
|
||||
INSERT INTO t1 VALUES (0);
|
||||
|
||||
-- connection con1
|
||||
INSERT INTO t2 VALUES (0);
|
||||
ROLLBACK;
|
||||
|
||||
-- connection con2
|
||||
-- error ER_LOCK_DEADLOCK
|
||||
-- reap
|
||||
-- }
|
||||
|
||||
-- connection default
|
||||
|
||||
DELETE FROM t5_nontrans;
|
||||
|
||||
-- disconnect con1
|
||||
-- disconnect con2
|
@ -1 +0,0 @@
|
||||
SET storage_engine=InnoDB;
|
@ -1,108 +0,0 @@
|
||||
#
|
||||
# Ensure that the number of locks (SELECT FOR UPDATE for example) is
|
||||
# added to the number of altered rows when choosing the smallest
|
||||
# transaction to kill as a victim when a deadlock is detected.
|
||||
# Also transactions what had edited non-transactional tables should
|
||||
# be heavier than ones that had not.
|
||||
#
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
SET storage_engine=InnoDB;
|
||||
|
||||
# we do not really care about what gets printed, we are only
|
||||
# interested in getting the deadlock resolved according to our
|
||||
# expectations
|
||||
-- disable_query_log
|
||||
-- disable_result_log
|
||||
|
||||
# we want to use "-- eval statement1; statement2" which does not work with
|
||||
# prepared statements. Because this test should not behave differently with
|
||||
# or without prepared statements we disable them so the test does not fail
|
||||
# if someone runs ./mysql-test-run.pl --ps-protocol
|
||||
-- disable_ps_protocol
|
||||
|
||||
-- disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2, t3, t4, t5_nontrans;
|
||||
-- enable_warnings
|
||||
|
||||
# we will create a simple deadlock with t1, t2 and two connections
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 (a INT);
|
||||
|
||||
# auxiliary table with a bulk of rows which will be locked by a
|
||||
# transaction to increase its weight
|
||||
CREATE TABLE t3 (a INT);
|
||||
|
||||
# auxiliary empty table which will be inserted by a
|
||||
# transaction to increase its weight
|
||||
CREATE TABLE t4 (a INT);
|
||||
|
||||
# auxiliary non-transactional table which will be edited by a
|
||||
# transaction to tremendously increase its weight
|
||||
CREATE TABLE t5_nontrans (a INT) ENGINE=MyISAM;
|
||||
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t2 VALUES (1);
|
||||
# insert a lot of rows in t3
|
||||
INSERT INTO t3 VALUES (1);
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
INSERT INTO t3 SELECT * FROM t3;
|
||||
|
||||
# test locking weight
|
||||
|
||||
-- let $con1_extra_sql =
|
||||
-- let $con1_extra_sql_present = 0
|
||||
-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
|
||||
-- let $con2_extra_sql_present = 1
|
||||
-- let $con1_should_be_rolledback = 1
|
||||
-- source include/innodb_trx_weight.inc
|
||||
|
||||
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1)
|
||||
-- let $con1_extra_sql_present = 1
|
||||
-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
|
||||
-- let $con2_extra_sql_present = 1
|
||||
-- let $con1_should_be_rolledback = 1
|
||||
-- source include/innodb_trx_weight.inc
|
||||
|
||||
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1), (1), (1), (1)
|
||||
-- let $con1_extra_sql_present = 1
|
||||
-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
|
||||
-- let $con2_extra_sql_present = 1
|
||||
-- let $con1_should_be_rolledback = 0
|
||||
-- source include/innodb_trx_weight.inc
|
||||
|
||||
# test weight when non-transactional tables are edited
|
||||
|
||||
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
|
||||
-- let $con1_extra_sql_present = 1
|
||||
-- let $con2_extra_sql =
|
||||
-- let $con2_extra_sql_present = 0
|
||||
-- let $con1_should_be_rolledback = 0
|
||||
-- source include/innodb_trx_weight.inc
|
||||
|
||||
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
|
||||
-- let $con1_extra_sql_present = 1
|
||||
-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1)
|
||||
-- let $con2_extra_sql_present = 1
|
||||
-- let $con1_should_be_rolledback = 1
|
||||
-- source include/innodb_trx_weight.inc
|
||||
|
||||
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
|
||||
-- let $con1_extra_sql = $con1_extra_sql; INSERT INTO t5_nontrans VALUES (1)
|
||||
-- let $con1_extra_sql_present = 1
|
||||
-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1)
|
||||
-- let $con2_extra_sql_present = 1
|
||||
-- let $con1_should_be_rolledback = 0
|
||||
-- source include/innodb_trx_weight.inc
|
||||
|
||||
DROP TABLE t1, t2, t3, t4, t5_nontrans;
|
@ -1,30 +0,0 @@
|
||||
This directory contains patches that need to be applied to the MySQL
|
||||
source tree in order to get the mysql-test suite to succeed (when
|
||||
storage/innobase is replaced with this InnoDB branch). Things to keep
|
||||
in mind when adding new patches here:
|
||||
|
||||
* The patch must be appliable from the mysql top-level source directory.
|
||||
|
||||
* The patch filename must end in ".diff".
|
||||
|
||||
* All patches here are expected to apply cleanly to the latest MySQL 5.1
|
||||
tree when storage/innobase is replaced with this InnoDB branch. If
|
||||
changes to either of those cause the patch to fail, then please check
|
||||
whether the patch is still needed and, if yes, adjust it so it applies
|
||||
cleanly.
|
||||
|
||||
* If applicable, always submit the patch at http://bugs.mysql.com and
|
||||
name the file here like bug%d.diff. Once the patch is committed to
|
||||
MySQL remove the file from here.
|
||||
|
||||
* If the patch cannot be proposed for inclusion in the MySQL source tree
|
||||
(via http://bugs.mysql.com) then add a comment at the beginning of the
|
||||
patch, explaining the problem it is solving, how it does solve it and
|
||||
why it is not applicable for inclusion in the MySQL source tree.
|
||||
Obviously this is a very bad situation and should be avoided at all
|
||||
costs, especially for files that are in the MySQL source repository
|
||||
(not in storage/innobase).
|
||||
|
||||
* If you ever need to add a patch here that is not related to mysql-test
|
||||
suite, then please move this directory from ./mysql-test/patches to
|
||||
./patches and remove this text.
|
@ -1,10 +0,0 @@
|
||||
--- mysql-test/t/type_bit_innodb.test.orig 2008-10-07 11:32:32.000000000 +0300
|
||||
+++ mysql-test/t/type_bit_innodb.test 2008-10-07 11:56:40.000000000 +0300
|
||||
@@ -40,6 +40,7 @@
|
||||
create table t1 (a bit) engine=innodb;
|
||||
insert into t1 values (b'0'), (b'1'), (b'000'), (b'100'), (b'001');
|
||||
select hex(a) from t1;
|
||||
+--replace_regex /entry '(.*)' for/entry '' for/
|
||||
--error ER_DUP_ENTRY
|
||||
alter table t1 add unique (a);
|
||||
drop table t1;
|
@ -1,87 +0,0 @@
|
||||
=== modified file 'mysql-test/r/variables.result'
|
||||
--- mysql-test/r/variables.result 2008-11-27 10:50:28 +0000
|
||||
+++ mysql-test/r/variables.result 2009-01-06 07:33:27 +0000
|
||||
@@ -297,14 +297,14 @@
|
||||
select ROUND(RAND(),5);
|
||||
ROUND(RAND(),5)
|
||||
0.02887
|
||||
-show variables like '%alloc%';
|
||||
+show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
Variable_name Value
|
||||
query_alloc_block_size 8192
|
||||
query_prealloc_size 8192
|
||||
range_alloc_block_size 4096
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
-select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
+select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 8192
|
||||
QUERY_PREALLOC_SIZE 8192
|
||||
@@ -319,14 +319,14 @@
|
||||
select @@query_alloc_block_size;
|
||||
@@query_alloc_block_size
|
||||
17408
|
||||
-show variables like '%alloc%';
|
||||
+show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
Variable_name Value
|
||||
query_alloc_block_size 17408
|
||||
query_prealloc_size 18432
|
||||
range_alloc_block_size 16384
|
||||
transaction_alloc_block_size 19456
|
||||
transaction_prealloc_size 20480
|
||||
-select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
+select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 17408
|
||||
QUERY_PREALLOC_SIZE 18432
|
||||
@@ -336,14 +336,14 @@
|
||||
set @@range_alloc_block_size=default;
|
||||
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
|
||||
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
|
||||
-show variables like '%alloc%';
|
||||
+show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
Variable_name Value
|
||||
query_alloc_block_size 8192
|
||||
query_prealloc_size 8192
|
||||
range_alloc_block_size 4096
|
||||
transaction_alloc_block_size 8192
|
||||
transaction_prealloc_size 4096
|
||||
-select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
+select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
QUERY_ALLOC_BLOCK_SIZE 8192
|
||||
QUERY_PREALLOC_SIZE 8192
|
||||
|
||||
=== modified file 'mysql-test/t/variables.test'
|
||||
--- mysql-test/t/variables.test 2008-11-27 10:50:28 +0000
|
||||
+++ mysql-test/t/variables.test 2009-01-06 07:28:12 +0000
|
||||
@@ -172,21 +172,21 @@
|
||||
set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
||||
select ROUND(RAND(),5);
|
||||
|
||||
-show variables like '%alloc%';
|
||||
-select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
+show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
+select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
set @@range_alloc_block_size=1024*16;
|
||||
set @@query_alloc_block_size=1024*17+2;
|
||||
set @@query_prealloc_size=1024*18;
|
||||
set @@transaction_alloc_block_size=1024*20-1;
|
||||
set @@transaction_prealloc_size=1024*21-1;
|
||||
select @@query_alloc_block_size;
|
||||
-show variables like '%alloc%';
|
||||
-select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
+show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
+select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
set @@range_alloc_block_size=default;
|
||||
set @@query_alloc_block_size=default, @@query_prealloc_size=default;
|
||||
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
|
||||
-show variables like '%alloc%';
|
||||
-select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
|
||||
+show variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size');
|
||||
+select * from information_schema.session_variables where variable_name in ('query_alloc_block_size', 'query_prealloc_size', 'range_alloc_block_size', 'transaction_alloc_block_size', 'transaction_prealloc_size') order by 1;
|
||||
|
||||
#
|
||||
# Bug #10904 Illegal mix of collations between
|
||||
|
@ -1,31 +0,0 @@
|
||||
InnoDB's estimate for the index cardinality depends on a pseudo random
|
||||
number generator (it picks up random pages to sample). After an
|
||||
optimization that was made in r2625 the following EXPLAINs started
|
||||
returning a different number of rows (3 instead of 4).
|
||||
|
||||
This patch adjusts the result file.
|
||||
|
||||
This patch cannot be proposed to MySQL because the failures occur only
|
||||
in this tree and do not occur in the standard InnoDB 5.1. Furthermore,
|
||||
the file index_merge2.inc is used by other engines too.
|
||||
|
||||
--- mysql-test/r/index_merge_innodb.result.orig 2008-09-30 18:32:13.000000000 +0300
|
||||
+++ mysql-test/r/index_merge_innodb.result 2008-09-30 18:33:01.000000000 +0300
|
||||
@@ -111,7 +111,7 @@
|
||||
explain select count(*) from t1 where
|
||||
key1a = 2 and key1b is null and key2a = 2 and key2b is null;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
-1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 4 Using intersect(i1,i2); Using where; Using index
|
||||
+1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 3 Using intersect(i1,i2); Using where; Using index
|
||||
select count(*) from t1 where
|
||||
key1a = 2 and key1b is null and key2a = 2 and key2b is null;
|
||||
count(*)
|
||||
@@ -119,7 +119,7 @@
|
||||
explain select count(*) from t1 where
|
||||
key1a = 2 and key1b is null and key3a = 2 and key3b is null;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
-1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 4 Using intersect(i1,i3); Using where; Using index
|
||||
+1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 3 Using intersect(i1,i3); Using where; Using index
|
||||
select count(*) from t1 where
|
||||
key1a = 2 and key1b is null and key3a = 2 and key3b is null;
|
||||
count(*)
|
@ -1,124 +0,0 @@
|
||||
--- mysql-test/r/information_schema.result.orig 2009-01-31 03:38:50.000000000 +0200
|
||||
+++ mysql-test/r/information_schema.result 2009-01-31 07:51:58.000000000 +0200
|
||||
@@ -71,6 +71,13 @@
|
||||
TRIGGERS
|
||||
USER_PRIVILEGES
|
||||
VIEWS
|
||||
+INNODB_CMP_RESET
|
||||
+INNODB_TRX
|
||||
+INNODB_CMPMEM_RESET
|
||||
+INNODB_LOCK_WAITS
|
||||
+INNODB_CMPMEM
|
||||
+INNODB_CMP
|
||||
+INNODB_LOCKS
|
||||
columns_priv
|
||||
db
|
||||
event
|
||||
@@ -799,6 +806,8 @@
|
||||
TABLES UPDATE_TIME datetime
|
||||
TABLES CHECK_TIME datetime
|
||||
TRIGGERS CREATED datetime
|
||||
+INNODB_TRX trx_started datetime
|
||||
+INNODB_TRX trx_wait_started datetime
|
||||
event execute_at datetime
|
||||
event last_executed datetime
|
||||
event starts datetime
|
||||
@@ -852,7 +861,7 @@
|
||||
flush privileges;
|
||||
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
|
||||
table_schema count(*)
|
||||
-information_schema 28
|
||||
+information_schema 35
|
||||
mysql 22
|
||||
create table t1 (i int, j int);
|
||||
create trigger trg1 before insert on t1 for each row
|
||||
@@ -1267,6 +1276,13 @@
|
||||
TRIGGERS TRIGGER_SCHEMA
|
||||
USER_PRIVILEGES GRANTEE
|
||||
VIEWS TABLE_SCHEMA
|
||||
+INNODB_CMP_RESET page_size
|
||||
+INNODB_TRX trx_id
|
||||
+INNODB_CMPMEM_RESET page_size
|
||||
+INNODB_LOCK_WAITS requesting_trx_id
|
||||
+INNODB_CMPMEM page_size
|
||||
+INNODB_CMP page_size
|
||||
+INNODB_LOCKS lock_id
|
||||
SELECT t.table_name, c1.column_name
|
||||
FROM information_schema.tables t
|
||||
INNER JOIN
|
||||
@@ -1310,6 +1326,13 @@
|
||||
TRIGGERS TRIGGER_SCHEMA
|
||||
USER_PRIVILEGES GRANTEE
|
||||
VIEWS TABLE_SCHEMA
|
||||
+INNODB_CMP_RESET page_size
|
||||
+INNODB_TRX trx_id
|
||||
+INNODB_CMPMEM_RESET page_size
|
||||
+INNODB_LOCK_WAITS requesting_trx_id
|
||||
+INNODB_CMPMEM page_size
|
||||
+INNODB_CMP page_size
|
||||
+INNODB_LOCKS lock_id
|
||||
SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
|
||||
MAX(table_name)
|
||||
VIEWS
|
||||
@@ -1386,6 +1409,13 @@
|
||||
FILES information_schema.FILES 1
|
||||
GLOBAL_STATUS information_schema.GLOBAL_STATUS 1
|
||||
GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
|
||||
+INNODB_CMP information_schema.INNODB_CMP 1
|
||||
+INNODB_CMPMEM information_schema.INNODB_CMPMEM 1
|
||||
+INNODB_CMPMEM_RESET information_schema.INNODB_CMPMEM_RESET 1
|
||||
+INNODB_CMP_RESET information_schema.INNODB_CMP_RESET 1
|
||||
+INNODB_LOCKS information_schema.INNODB_LOCKS 1
|
||||
+INNODB_LOCK_WAITS information_schema.INNODB_LOCK_WAITS 1
|
||||
+INNODB_TRX information_schema.INNODB_TRX 1
|
||||
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
|
||||
PARTITIONS information_schema.PARTITIONS 1
|
||||
PLUGINS information_schema.PLUGINS 1
|
||||
diff mysql-test/r/information_schema_db.result.orig mysql-test/r/information_schema_db.result
|
||||
--- mysql-test/r/information_schema_db.result.orig 2008-08-04 09:27:49.000000000 +0300
|
||||
+++ mysql-test/r/information_schema_db.result 2008-10-07 12:26:31.000000000 +0300
|
||||
@@ -33,6 +33,13 @@
|
||||
TRIGGERS
|
||||
USER_PRIVILEGES
|
||||
VIEWS
|
||||
+INNODB_CMP_RESET
|
||||
+INNODB_TRX
|
||||
+INNODB_CMPMEM_RESET
|
||||
+INNODB_LOCK_WAITS
|
||||
+INNODB_CMPMEM
|
||||
+INNODB_CMP
|
||||
+INNODB_LOCKS
|
||||
show tables from INFORMATION_SCHEMA like 'T%';
|
||||
Tables_in_information_schema (T%)
|
||||
TABLES
|
||||
diff mysql-test/r/mysqlshow.result.orig mysql-test/r/mysqlshow.result
|
||||
--- mysql-test/r/mysqlshow.result.orig 2008-08-04 09:27:51.000000000 +0300
|
||||
+++ mysql-test/r/mysqlshow.result 2008-10-07 12:35:39.000000000 +0300
|
||||
@@ -107,6 +107,13 @@
|
||||
| TRIGGERS |
|
||||
| USER_PRIVILEGES |
|
||||
| VIEWS |
|
||||
+| INNODB_CMP_RESET |
|
||||
+| INNODB_TRX |
|
||||
+| INNODB_CMPMEM_RESET |
|
||||
+| INNODB_LOCK_WAITS |
|
||||
+| INNODB_CMPMEM |
|
||||
+| INNODB_CMP |
|
||||
+| INNODB_LOCKS |
|
||||
+---------------------------------------+
|
||||
Database: INFORMATION_SCHEMA
|
||||
+---------------------------------------+
|
||||
@@ -140,6 +147,13 @@
|
||||
| TRIGGERS |
|
||||
| USER_PRIVILEGES |
|
||||
| VIEWS |
|
||||
+| INNODB_CMP_RESET |
|
||||
+| INNODB_TRX |
|
||||
+| INNODB_CMPMEM_RESET |
|
||||
+| INNODB_LOCK_WAITS |
|
||||
+| INNODB_CMPMEM |
|
||||
+| INNODB_CMP |
|
||||
+| INNODB_LOCKS |
|
||||
+---------------------------------------+
|
||||
Wildcard: inf_rmation_schema
|
||||
+--------------------+
|
@ -1,62 +0,0 @@
|
||||
This part of the innodb-index test causes mysqld to print some warnings
|
||||
and subsequently the whole mysql-test suite to fail.
|
||||
|
||||
A permanent solution is probably to remove the printouts from the source
|
||||
code or to somehow tell the mysql-test suite that warnings are expected.
|
||||
Currently we simply do not execute the problematic tests. Please
|
||||
coordinate a permanent solution with Marko, who added those tests.
|
||||
|
||||
This cannot be proposed to MySQL because it touches files that are not
|
||||
in the MySQL source repository.
|
||||
|
||||
Index: storage/innobase/mysql-test/innodb-index.result
|
||||
===================================================================
|
||||
--- storage/innobase/mysql-test/innodb-index.result (revision 2870)
|
||||
+++ storage/innobase/mysql-test/innodb-index.result (working copy)
|
||||
@@ -43,19 +43,12 @@ t1 CREATE TABLE `t1` (
|
||||
`b` int(11) DEFAULT NULL,
|
||||
`c` char(10) NOT NULL,
|
||||
`d` varchar(20) DEFAULT NULL,
|
||||
KEY `d2` (`d`),
|
||||
KEY `b` (`b`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
-CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
-alter table t1 add unique index (c), add index (d);
|
||||
-ERROR HY000: Table 'test.t1#1' already exists
|
||||
-rename table `t1#1` to `t1#2`;
|
||||
-alter table t1 add unique index (c), add index (d);
|
||||
-ERROR HY000: Table 'test.t1#2' already exists
|
||||
-drop table `t1#2`;
|
||||
alter table t1 add unique index (c), add index (d);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL,
|
||||
`b` int(11) DEFAULT NULL,
|
||||
Index: storage/innobase/mysql-test/innodb-index.test
|
||||
===================================================================
|
||||
--- storage/innobase/mysql-test/innodb-index.test (revision 2870)
|
||||
+++ storage/innobase/mysql-test/innodb-index.test (working copy)
|
||||
@@ -14,22 +14,12 @@ select * from t1 force index (d2) order
|
||||
--error ER_DUP_ENTRY
|
||||
alter table t1 add unique index (b);
|
||||
show create table t1;
|
||||
alter table t1 add index (b);
|
||||
show create table t1;
|
||||
|
||||
-# Check how existing tables interfere with temporary tables.
|
||||
-CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
-
|
||||
---error 156
|
||||
-alter table t1 add unique index (c), add index (d);
|
||||
-rename table `t1#1` to `t1#2`;
|
||||
---error 156
|
||||
-alter table t1 add unique index (c), add index (d);
|
||||
-drop table `t1#2`;
|
||||
-
|
||||
alter table t1 add unique index (c), add index (d);
|
||||
show create table t1;
|
||||
explain select * from t1 force index(c) order by c;
|
||||
alter table t1 add primary key (a), drop index c;
|
||||
show create table t1;
|
||||
--error ER_MULTIPLE_PRI_KEY
|
@ -1,59 +0,0 @@
|
||||
The partition_innodb test only fails if run immediately after innodb_trx_weight.
|
||||
The reason for this failure is that innodb_trx_weight creates deadlocks and
|
||||
leaves something like this in the SHOW ENGINE INNODB STATUS output:
|
||||
|
||||
------------------------
|
||||
LATEST DETECTED DEADLOCK
|
||||
------------------------
|
||||
090213 10:26:25
|
||||
*** (1) TRANSACTION:
|
||||
TRANSACTION 313, ACTIVE 0 sec, OS thread id 13644672 inserting
|
||||
mysql tables in use 1, locked 1
|
||||
LOCK WAIT 4 lock struct(s), heap size 488, 3 row lock(s)
|
||||
MySQL thread id 3, query id 36 localhost root update
|
||||
|
||||
The regular expressions that partition_innodb is using are intended to extract
|
||||
the lock structs and row locks numbers from another part of the output:
|
||||
|
||||
------------
|
||||
TRANSACTIONS
|
||||
------------
|
||||
Trx id counter 31D
|
||||
Purge done for trx's n:o < 0 undo n:o < 0
|
||||
History list length 4
|
||||
LIST OF TRANSACTIONS FOR EACH SESSION:
|
||||
---TRANSACTION 0, not started, OS thread id 13645056
|
||||
0 lock struct(s), heap size 488, 0 row lock(s)
|
||||
MySQL thread id 8, query id 81 localhost root
|
||||
|
||||
In the InnoDB Plugin a transaction id is not printed as 2 consecutive
|
||||
decimal integers (as it is in InnoDB 5.1) but rather as a single
|
||||
hexadecimal integer. Thus the regular expressions somehow pick the wrong
|
||||
part of the SHOW ENGINE INNODB STATUS output.
|
||||
|
||||
So after the regular expressions are adjusted to the InnoDB Plugin's variant
|
||||
of trx_id prinout, then they pick the expected part of the output.
|
||||
|
||||
This patch cannot be proposed to MySQL because the failures occur only
|
||||
in this tree and do not occur in the standard InnoDB 5.1.
|
||||
|
||||
--- mysql-test/t/partition_innodb.test 2008-11-14 22:51:17 +0000
|
||||
+++ mysql-test/t/partition_innodb.test 2009-02-13 07:36:07 +0000
|
||||
@@ -27,14 +27,14 @@
|
||||
|
||||
# grouping/referencing in replace_regex is very slow on long strings,
|
||||
# removing all before/after the interesting row before grouping/referencing
|
||||
---replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
||||
+--replace_regex /.*---TRANSACTION [0-9A-F]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
|
||||
UPDATE t1 SET data = data*2 WHERE data = 2;
|
||||
|
||||
# grouping/referencing in replace_regex is very slow on long strings,
|
||||
# removing all before/after the interesting row before grouping/referencing
|
||||
---replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
||||
+--replace_regex /.*---TRANSACTION [0-9A-F]+, .*, OS thread id [0-9]+// /MySQL thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
|
||||
SHOW ENGINE InnoDB STATUS;
|
||||
|
||||
SET @@session.tx_isolation = @old_tx_isolation;
|
||||
|
Reference in New Issue
Block a user