Debian Codegraph @

mysql-test/suite/storage_engine/autoinc_vars.result

raw
1 DROP TABLE IF EXISTS t1;
2 SET auto_increment_offset = 200;
3 CREATE TABLE t1 (a <INT_COLUMN> AUTO_INCREMENT, b <CHAR_COLUMN>, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
4 INSERT INTO t1 (a,b) VALUES (NULL,'a'),(NULL,'b'),(NULL,'c');
5 SELECT LAST_INSERT_ID();
6 LAST_INSERT_ID()
7 1
8 SELECT a,b FROM t1;
9 a b
10 1 a
11 2 b
12 3 c
13 SET auto_increment_increment = 300;
14 INSERT INTO t1 (a,b) VALUES (NULL,'d'),(NULL,'e'),(NULL,'f');
15 SELECT LAST_INSERT_ID();
16 LAST_INSERT_ID()
17 200
18 SELECT a,b FROM t1;
19 a b
20 1 a
21 2 b
22 200 d
23 3 c
24 500 e
25 800 f
26 SET auto_increment_increment = 50;
27 INSERT INTO t1 (a,b) VALUES (NULL,'g'),(NULL,'h'),(NULL,'i');
28 SELECT LAST_INSERT_ID();
29 LAST_INSERT_ID()
30 850
31 SELECT a,b FROM t1;
32 a b
33 1 a
34 2 b
35 200 d
36 3 c
37 500 e
38 800 f
39 850 g
40 900 h
41 950 i
42 DROP TABLE t1;
43 SET auto_increment_increment = 500;
44 SET auto_increment_offset = 300;
45 CREATE TABLE t1 (a TINYINT <CUSTOM_COL_OPTIONS> AUTO_INCREMENT, <CUSTOM_INDEX>(a)) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
46 INSERT INTO t1 (a) VALUES (NULL);
47 ERROR 22003: Out of range value for column 'a' at row 1
48 SELECT LAST_INSERT_ID();
49 LAST_INSERT_ID()
50 850
51 SELECT a FROM t1;
52 a
53 DROP TABLE t1;