1
by brian
clean slate |
1 |
drop table if exists t1;
|
2 |
drop table if exists t2;
|
|
3 |
SET SQL_WARNINGS=1;
|
|
1063.9.3
by Brian Aker
Partial fix for tests for tmp |
4 |
create TEMPORARY table t1 (a int not null auto_increment,b int, primary key (a)) engine=myisam auto_increment=3;
|
1
by brian
clean slate |
5 |
insert into t1 values (1,1),(NULL,3),(NULL,4);
|
6 |
delete from t1 where a=4;
|
|
7 |
insert into t1 values (NULL,5),(NULL,6);
|
|
8 |
select * from t1;
|
|
9 |
a b
|
|
10 |
1 1
|
|
11 |
3 3
|
|
12 |
5 5
|
|
13 |
6 6
|
|
14 |
delete from t1 where a=6;
|
|
1273.19.12
by Brian Aker
Enabled more tests. |
15 |
show table status like "t1";
|
1320.1.18
by Brian Aker
Overhaul of SHOW TABLE STATUS. |
16 |
Session Schema Name Type Engine Version Rows Avg_row_length Table_size Auto_increment
|
17 |
# test t1 TEMPORARY MyISAM # # # # #
|
|
1
by brian
clean slate |
18 |
replace t1 values (3,1);
|
19 |
ALTER TABLE t1 add c int;
|
|
20 |
replace t1 values (3,3,3);
|
|
21 |
insert into t1 values (NULL,7,7);
|
|
22 |
update t1 set a=8,b=b+1,c=c+1 where a=7;
|
|
23 |
insert into t1 values (NULL,9,9);
|
|
24 |
select * from t1;
|
|
25 |
a b c
|
|
26 |
1 1 NULL
|
|
27 |
3 3 3
|
|
28 |
5 5 NULL
|
|
29 |
8 8 8
|
|
30 |
9 9 9
|
|
31 |
drop table t1;
|
|
32 |
create table t1 (
|
|
642.1.71
by Lee
merge with latest from the trunk |
33 |
skey int NOT NULL auto_increment PRIMARY KEY,
|
1
by brian
clean slate |
34 |
sval char(20)
|
35 |
);
|
|
36 |
insert into t1 values (NULL, "hello");
|
|
37 |
insert into t1 values (NULL, "hey");
|
|
38 |
select * from t1;
|
|
39 |
skey sval
|
|
40 |
1 hello
|
|
41 |
2 hey
|
|
42 |
select _rowid,t1._rowid,skey,sval from t1;
|
|
43 |
_rowid _rowid skey sval
|
|
44 |
1 1 1 hello
|
|
45 |
2 2 2 hey
|
|
46 |
drop table t1;
|
|
47 |
create table t1 (a int not null primary key auto_increment);
|
|
48 |
insert into t1 values (0);
|
|
49 |
update t1 set a=0;
|
|
50 |
select * from t1;
|
|
51 |
a
|
|
52 |
0
|
|
53 |
check table t1;
|
|
54 |
Table Op Msg_type Msg_text
|
|
55 |
test.t1 check status OK
|
|
56 |
drop table t1;
|
|
57 |
create table t1 (a int not null auto_increment primary key);
|
|
58 |
insert into t1 values (NULL);
|
|
59 |
insert into t1 values (-1);
|
|
60 |
select last_insert_id();
|
|
61 |
last_insert_id()
|
|
62 |
1
|
|
63 |
insert into t1 values (NULL);
|
|
64 |
select * from t1;
|
|
65 |
a
|
|
66 |
-1
|
|
67 |
1
|
|
68 |
2
|
|
69 |
drop table t1;
|
|
1233.2.1
by Monty Taylor
Renamed instances of HEAP engine to MEMORY. Removed the alias. |
70 |
create temporary table t1 (a int not null auto_increment primary key) /*!40102 engine=MEMORY */;
|
1
by brian
clean slate |
71 |
insert into t1 values (NULL);
|
72 |
insert into t1 values (-1);
|
|
73 |
select last_insert_id();
|
|
74 |
last_insert_id()
|
|
75 |
1
|
|
76 |
insert into t1 values (NULL);
|
|
77 |
select * from t1;
|
|
78 |
a
|
|
79 |
1
|
|
80 |
-1
|
|
81 |
2
|
|
82 |
drop table t1;
|
|
642.1.71
by Lee
merge with latest from the trunk |
83 |
create table t1 (i int not null auto_increment, key (i));
|
84 |
insert into t1 set i = 254;
|
|
85 |
insert into t1 set i = null;
|
|
86 |
select last_insert_id();
|
|
87 |
last_insert_id()
|
|
88 |
255
|
|
89 |
insert into t1 set i = null;
|
|
90 |
select last_insert_id();
|
|
91 |
last_insert_id()
|
|
92 |
256
|
|
93 |
drop table t1;
|
|
94 |
create table t1 (i int not null auto_increment primary key, b int, unique (b));
|
|
1
by brian
clean slate |
95 |
insert into t1 values (NULL, 10);
|
96 |
select last_insert_id();
|
|
97 |
last_insert_id()
|
|
98 |
1
|
|
99 |
insert into t1 values (NULL, 15);
|
|
100 |
select last_insert_id();
|
|
101 |
last_insert_id()
|
|
102 |
2
|
|
103 |
insert into t1 values (NULL, 10);
|
|
104 |
ERROR 23000: Duplicate entry '10' for key 'b'
|
|
105 |
select last_insert_id();
|
|
106 |
last_insert_id()
|
|
107 |
2
|
|
108 |
drop table t1;
|
|
109 |
create table t1(a int auto_increment,b int null,primary key(a));
|
|
110 |
insert into t1(a,b)values(NULL,1);
|
|
111 |
insert into t1(a,b)values(200,2);
|
|
112 |
insert into t1(a,b)values(0,3);
|
|
113 |
insert into t1(b)values(4);
|
|
114 |
insert into t1(b)values(5);
|
|
115 |
insert into t1(b)values(6);
|
|
116 |
insert into t1(b)values(7);
|
|
117 |
select * from t1 order by b;
|
|
118 |
a b
|
|
119 |
1 1
|
|
120 |
200 2
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
121 |
0 3
|
122 |
201 4
|
|
123 |
202 5
|
|
124 |
203 6
|
|
125 |
204 7
|
|
642.1.71
by Lee
merge with latest from the trunk |
126 |
alter table t1 modify b int;
|
1
by brian
clean slate |
127 |
select * from t1 order by b;
|
128 |
a b
|
|
129 |
1 1
|
|
130 |
200 2
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
131 |
0 3
|
132 |
201 4
|
|
133 |
202 5
|
|
134 |
203 6
|
|
135 |
204 7
|
|
1
by brian
clean slate |
136 |
create table t2 (a int);
|
137 |
insert t2 values (1),(2);
|
|
138 |
alter table t2 add b int auto_increment primary key;
|
|
139 |
select * from t2;
|
|
140 |
a b
|
|
141 |
1 1
|
|
142 |
2 2
|
|
143 |
drop table t2;
|
|
144 |
delete from t1 where a=0;
|
|
145 |
update t1 set a=0 where b=5;
|
|
146 |
select * from t1 order by b;
|
|
147 |
a b
|
|
148 |
1 1
|
|
149 |
200 2
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
150 |
201 4
|
1
by brian
clean slate |
151 |
0 5
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
152 |
203 6
|
153 |
204 7
|
|
1
by brian
clean slate |
154 |
delete from t1 where a=0;
|
155 |
update t1 set a=NULL where b=6;
|
|
156 |
ERROR 23000: Column 'a' cannot be null
|
|
157 |
update t1 set a=300 where b=7;
|
|
158 |
insert into t1(a,b)values(NULL,8);
|
|
159 |
insert into t1(a,b)values(400,9);
|
|
160 |
insert into t1(a,b)values(0,10);
|
|
161 |
insert into t1(b)values(11);
|
|
162 |
insert into t1(b)values(12);
|
|
163 |
insert into t1(b)values(13);
|
|
164 |
insert into t1(b)values(14);
|
|
165 |
select * from t1 order by b;
|
|
166 |
a b
|
|
167 |
1 1
|
|
168 |
200 2
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
169 |
201 4
|
170 |
203 6
|
|
1
by brian
clean slate |
171 |
300 7
|
1578.3.1
by Stewart Smith
Make innobase auto_increment behaviour be the same as MyISAM on UPDATE. We also fix up auto_increment.result as the previous result was incorrect (we now match the mysql myisam test result). Also add a basic test (from the bug report) for the correct functionality |
172 |
301 8
|
1
by brian
clean slate |
173 |
400 9
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
174 |
0 10
|
175 |
401 11
|
|
176 |
402 12
|
|
177 |
403 13
|
|
178 |
404 14
|
|
1
by brian
clean slate |
179 |
delete from t1 where a=0;
|
180 |
update t1 set a=0 where b=12;
|
|
181 |
select * from t1 order by b;
|
|
182 |
a b
|
|
183 |
1 1
|
|
184 |
200 2
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
185 |
201 4
|
186 |
203 6
|
|
1
by brian
clean slate |
187 |
300 7
|
1578.3.1
by Stewart Smith
Make innobase auto_increment behaviour be the same as MyISAM on UPDATE. We also fix up auto_increment.result as the previous result was incorrect (we now match the mysql myisam test result). Also add a basic test (from the bug report) for the correct functionality |
188 |
301 8
|
1
by brian
clean slate |
189 |
400 9
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
190 |
401 11
|
1
by brian
clean slate |
191 |
0 12
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
192 |
403 13
|
193 |
404 14
|
|
1
by brian
clean slate |
194 |
delete from t1 where a=0;
|
195 |
update t1 set a=NULL where b=13;
|
|
196 |
ERROR 23000: Column 'a' cannot be null
|
|
197 |
update t1 set a=500 where b=14;
|
|
198 |
select * from t1 order by b;
|
|
199 |
a b
|
|
200 |
1 1
|
|
201 |
200 2
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
202 |
201 4
|
203 |
203 6
|
|
1
by brian
clean slate |
204 |
300 7
|
1578.3.1
by Stewart Smith
Make innobase auto_increment behaviour be the same as MyISAM on UPDATE. We also fix up auto_increment.result as the previous result was incorrect (we now match the mysql myisam test result). Also add a basic test (from the bug report) for the correct functionality |
205 |
301 8
|
1
by brian
clean slate |
206 |
400 9
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
207 |
401 11
|
208 |
403 13
|
|
1
by brian
clean slate |
209 |
500 14
|
210 |
drop table t1;
|
|
211 |
create table t1 (a bigint);
|
|
212 |
insert into t1 values (1), (2), (3), (NULL), (NULL);
|
|
213 |
alter table t1 modify a bigint not null auto_increment primary key;
|
|
214 |
select * from t1;
|
|
215 |
a
|
|
216 |
1
|
|
217 |
2
|
|
218 |
3
|
|
219 |
4
|
|
220 |
5
|
|
221 |
drop table t1;
|
|
222 |
create table t1 (a bigint);
|
|
223 |
insert into t1 values (1), (2), (3), (0), (0);
|
|
224 |
alter table t1 modify a bigint not null auto_increment primary key;
|
|
1578.6.5
by Brian Aker
Remove error message for less effective one, but remove current_session(). |
225 |
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
226 |
select * from t1;
|
227 |
a
|
|
228 |
1
|
|
229 |
2
|
|
230 |
3
|
|
231 |
0
|
|
232 |
0
|
|
233 |
drop table t1;
|
|
234 |
create table t1 (a bigint);
|
|
235 |
insert into t1 values (0), (1), (2), (3);
|
|
236 |
alter table t1 modify a bigint not null auto_increment primary key;
|
|
237 |
select * from t1;
|
|
238 |
a
|
|
239 |
0
|
|
240 |
1
|
|
241 |
2
|
|
242 |
3
|
|
1
by brian
clean slate |
243 |
drop table t1;
|
244 |
create table t1 (a int auto_increment primary key , b int null);
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
245 |
insert into t1 values (0,1),(1,2),(2,3);
|
246 |
select * from t1;
|
|
247 |
a b
|
|
248 |
0 1
|
|
249 |
1 2
|
|
250 |
2 3
|
|
1
by brian
clean slate |
251 |
alter table t1 modify b varchar(255);
|
252 |
insert into t1 values (0,4);
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
253 |
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
1
by brian
clean slate |
254 |
select * from t1;
|
255 |
a b
|
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
256 |
0 1
|
257 |
1 2
|
|
258 |
2 3
|
|
1
by brian
clean slate |
259 |
drop table t1;
|
260 |
CREATE TABLE t1 ( a INT AUTO_INCREMENT, b BLOB, PRIMARY KEY (a,b(10)));
|
|
261 |
INSERT INTO t1 (b) VALUES ('aaaa');
|
|
262 |
CHECK TABLE t1;
|
|
263 |
Table Op Msg_type Msg_text
|
|
264 |
test.t1 check status OK
|
|
265 |
INSERT INTO t1 (b) VALUES ('');
|
|
266 |
CHECK TABLE t1;
|
|
267 |
Table Op Msg_type Msg_text
|
|
268 |
test.t1 check status OK
|
|
269 |
INSERT INTO t1 (b) VALUES ('bbbb');
|
|
270 |
CHECK TABLE t1;
|
|
271 |
Table Op Msg_type Msg_text
|
|
272 |
test.t1 check status OK
|
|
273 |
DROP TABLE IF EXISTS t1;
|
|
642.1.71
by Lee
merge with latest from the trunk |
274 |
CREATE TABLE t1 (
|
1
by brian
clean slate |
275 |
t1_name VARCHAR(255) DEFAULT NULL,
|
642.1.71
by Lee
merge with latest from the trunk |
276 |
t1_id INT not null AUTO_INCREMENT,
|
1
by brian
clean slate |
277 |
KEY (t1_name),
|
278 |
PRIMARY KEY (t1_id)
|
|
279 |
) AUTO_INCREMENT = 1000;
|
|
280 |
INSERT INTO t1 (t1_name) VALUES('MySQL');
|
|
281 |
INSERT INTO t1 (t1_name) VALUES('MySQL');
|
|
282 |
INSERT INTO t1 (t1_name) VALUES('MySQL');
|
|
283 |
SELECT * from t1;
|
|
284 |
t1_name t1_id
|
|
285 |
MySQL 1000
|
|
286 |
MySQL 1001
|
|
287 |
MySQL 1002
|
|
288 |
SHOW CREATE TABLE `t1`;
|
|
289 |
Table Create Table
|
|
290 |
t1 CREATE TABLE `t1` (
|
|
1743.5.2
by LinuxJedi
Alter many test cases for the new SHOW CREATE TABLE output |
291 |
`t1_name` VARCHAR(255) COLLATE utf8_general_ci DEFAULT NULL,
|
292 |
`t1_id` INT NOT NULL AUTO_INCREMENT,
|
|
2363.1.5
by Brian Aker
This patch fixes 798940, we will also just now add the type of index to our create statements. |
293 |
PRIMARY KEY (`t1_id`) USING BTREE,
|
294 |
KEY `t1_name` (`t1_name`) USING BTREE
|
|
1638.10.55
by Stewart Smith
auto_increment.result with explicit COLLATE in SHOW CREATE TABLE |
295 |
) ENGINE=InnoDB COLLATE = utf8_general_ci AUTO_INCREMENT=1000
|
1
by brian
clean slate |
296 |
DROP TABLE `t1`;
|
297 |
create table t1(a int not null auto_increment primary key);
|
|
298 |
create table t2(a int not null auto_increment primary key, t1a int);
|
|
299 |
insert into t1 values(NULL);
|
|
300 |
insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
|
|
301 |
insert into t1 values (NULL);
|
|
302 |
insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
|
|
303 |
(NULL, LAST_INSERT_ID());
|
|
304 |
insert into t1 values (NULL);
|
|
305 |
insert into t2 values (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID()),
|
|
306 |
(NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID());
|
|
307 |
select * from t2;
|
|
308 |
a t1a
|
|
309 |
1 1
|
|
310 |
2 1
|
|
311 |
3 2
|
|
312 |
4 2
|
|
313 |
5 2
|
|
314 |
6 3
|
|
315 |
7 3
|
|
316 |
8 3
|
|
317 |
9 3
|
|
318 |
drop table t1, t2;
|
|
319 |
End of 4.1 tests
|
|
642.1.71
by Lee
merge with latest from the trunk |
320 |
CREATE TABLE t1 ( `a` int NOT NULL auto_increment, `b` int default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`));
|
1
by brian
clean slate |
321 |
insert into t1 (b) values (1);
|
322 |
replace into t1 (b) values (2), (1), (3);
|
|
323 |
select * from t1;
|
|
324 |
a b
|
|
642.1.71
by Lee
merge with latest from the trunk |
325 |
2 2
|
1
by brian
clean slate |
326 |
3 1
|
327 |
4 3
|
|
328 |
truncate table t1;
|
|
329 |
insert into t1 (b) values (1);
|
|
330 |
replace into t1 (b) values (2);
|
|
331 |
replace into t1 (b) values (1);
|
|
332 |
replace into t1 (b) values (3);
|
|
333 |
select * from t1;
|
|
334 |
a b
|
|
642.1.71
by Lee
merge with latest from the trunk |
335 |
2 2
|
1
by brian
clean slate |
336 |
3 1
|
337 |
4 3
|
|
338 |
drop table t1;
|
|
339 |
create table t1 (rowid int not null auto_increment, val int not null,primary
|
|
340 |
key (rowid), unique(val));
|
|
341 |
replace into t1 (val) values ('1'),('2');
|
|
342 |
replace into t1 (val) values ('1'),('2');
|
|
343 |
insert into t1 (val) values ('1'),('2');
|
|
344 |
ERROR 23000: Duplicate entry '1' for key 'val'
|
|
345 |
select * from t1;
|
|
346 |
rowid val
|
|
347 |
3 1
|
|
348 |
4 2
|
|
349 |
drop table t1;
|
|
642.1.71
by Lee
merge with latest from the trunk |
350 |
CREATE TABLE t1 (t1 INT PRIMARY KEY, t2 INT);
|
1
by brian
clean slate |
351 |
INSERT INTO t1 VALUES(0, 0);
|
352 |
INSERT INTO t1 VALUES(1, 1);
|
|
642.1.71
by Lee
merge with latest from the trunk |
353 |
ALTER TABLE t1 CHANGE t1 t1 INT auto_increment;
|
1008.3.2
by Stewart Smith
Make sql_mode=NO_AUTO_VALUE_ON_ZERO default for Drizzle. |
354 |
INSERT INTO t1 VALUES(0,0);
|
355 |
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
|
|
1
by brian
clean slate |
356 |
DROP TABLE t1;
|
357 |
create table t1 (a int primary key auto_increment, b int, c int, d timestamp default current_timestamp, unique(b),unique(c));
|
|
358 |
insert into t1 values(null,1,1,now());
|
|
359 |
insert into t1 values(null,0,0,null);
|
|
360 |
replace into t1 values(null,1,0,null);
|
|
361 |
select last_insert_id();
|
|
362 |
last_insert_id()
|
|
363 |
3
|
|
364 |
drop table t1;
|