summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/maria/maria-autoinc.result
blob: 56b7c2e840fd286d000f3bda6723a03b0647f96b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#
# MDEV-15352 AUTO_INCREMENT breaks after updating a column value to a negative number
#
SET @engine='ARIA';
CREATE PROCEDURE autoinc_mdev15353_one(engine VARCHAR(64), t VARCHAR(64))
BEGIN
DECLARE query TEXT DEFAULT 'CREATE TABLE t1 ('
                             '  id TTT NOT NULL AUTO_INCREMENT,'
                             '  name CHAR(30) NOT NULL,'
                             '  PRIMARY KEY (id)) ENGINE=EEE';
EXECUTE IMMEDIATE REPLACE(REPLACE(query,'TTT', t), 'EEE', engine);
SHOW CREATE TABLE t1;
INSERT INTO t1 (name) VALUES ('dog');
SELECT * FROM t1;
UPDATE t1 SET id=-1 WHERE id=1;
SELECT * FROM t1;
INSERT INTO t1 (name) VALUES ('cat');
SELECT * FROM t1;
DROP TABLE t1;
END;
$$
CALL autoinc_mdev15353_one(@engine, 'tinyint');
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` tinyint(4) NOT NULL AUTO_INCREMENT,
  `name` char(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
id	name
1	dog
id	name
-1	dog
id	name
-1	dog
2	cat
CALL autoinc_mdev15353_one(@engine, 'smallint');
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` smallint(6) NOT NULL AUTO_INCREMENT,
  `name` char(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
id	name
1	dog
id	name
-1	dog
id	name
-1	dog
2	cat
CALL autoinc_mdev15353_one(@engine, 'mediumint');
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` mediumint(9) NOT NULL AUTO_INCREMENT,
  `name` char(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
id	name
1	dog
id	name
-1	dog
id	name
-1	dog
2	cat
CALL autoinc_mdev15353_one(@engine, 'int');
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` char(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
id	name
1	dog
id	name
-1	dog
id	name
-1	dog
2	cat
CALL autoinc_mdev15353_one(@engine, 'bigint');
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` char(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
id	name
1	dog
id	name
-1	dog
id	name
-1	dog
2	cat
CALL autoinc_mdev15353_one(@engine, 'float');
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` float NOT NULL AUTO_INCREMENT,
  `name` char(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
id	name
1	dog
id	name
-1	dog
id	name
-1	dog
2	cat
CALL autoinc_mdev15353_one(@engine, 'double');
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` double NOT NULL AUTO_INCREMENT,
  `name` char(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
id	name
1	dog
id	name
-1	dog
id	name
-1	dog
2	cat
DROP PROCEDURE autoinc_mdev15353_one;