36
36
Warning 1265 Data truncated for column 'col1' at row 1
37
37
INSERT IGNORE INTO t1 values (1/0);
38
ERROR 22012: Division by 0
39
Error 1365 Division by 0
39
40
INSERT IGNORE INTO t1 values (-2147483649);
41
42
Warning 1264 Out of range value for column 'col1' at row 1
81
83
INSERT INTO t1 VALUES (9223372036854775700.0);
82
84
INSERT INTO t1 (col1) VALUES(-9223372036854775809);
83
85
ERROR 22003: Out of range value for column 'col1' at row 1
84
INSERT INTO t1 (col1) VALUES(9223372036854775808);
85
ERROR 22003: Out of range value for column 'col1' at row 1
86
86
INSERT INTO t1 (col1) VALUES('-9223372036854775809');
87
87
ERROR 22003: Out of range value for column 'col1' at row 1
88
88
INSERT INTO t1 (col1) VALUES('9223372036854775808');
106
106
Warning 1265 Data truncated for column 'col1' at row 1
107
107
INSERT IGNORE INTO t1 values (1/0);
108
ERROR 22012: Division by 0
109
Error 1365 Division by 0
109
110
INSERT IGNORE INTO t1 VALUES (-9223372036854775809);
111
112
Warning 1264 Out of range value for column 'col1' at row 1
112
113
INSERT IGNORE INTO t1 VALUES (9223372036854775808);
114
Warning 1264 Out of range value for column 'col1' at row 1
115
114
INSERT IGNORE INTO t1 VALUES ('-9223372036854775809');
117
116
Warning 1264 Out of range value for column 'col1' at row 1
198
198
Warning 1265 Data truncated for column 'col1' at row 1
199
199
INSERT IGNORE INTO t1 values (1/0);
200
ERROR 22012: Division by 0
201
Error 1365 Division by 0
201
202
INSERT IGNORE INTO t1 VALUES (1000);
203
204
Warning 1264 Out of range value for column 'col1' at row 1
239
241
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
240
242
INSERT INTO t1 VALUES ('hello', 'hello');
241
243
INSERT INTO t1 VALUES ('he', 'he');
242
244
INSERT INTO t1 VALUES ('hello ', 'hello ');
243
ERROR 22001: Data too long for column 'col1' at row 1
246
Note 1265 Data truncated for column 'col1' at row 1
244
247
INSERT INTO t1 (col1) VALUES ('hellobob');
245
248
ERROR 22001: Data too long for column 'col1' at row 1
246
249
INSERT INTO t1 (col2) VALUES ('hellobob');
247
250
ERROR 22001: Data too long for column 'col2' at row 1
248
251
INSERT INTO t1 (col2) VALUES ('hello ');
249
ERROR 22001: Data too long for column 'col2' at row 1
253
Note 1265 Data truncated for column 'col2' at row 1
250
254
UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
251
255
ERROR 22001: Data too long for column 'col1' at row 2
252
256
UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
253
257
ERROR 22001: Data too long for column 'col2' at row 2
254
258
INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob');
256
Error 1406 Data too long for column 'col1' at row 1
257
Error 1406 Data too long for column 'col2' at row 1
260
Warning 1265 Data truncated for column 'col1' at row 1
261
Warning 1265 Data truncated for column 'col2' at row 1
258
262
UPDATE IGNORE t1 SET col2 ='hellotrudy' WHERE col2 ='he';
260
Error 1406 Data too long for column 'col2' at row 2
264
Warning 1265 Data truncated for column 'col2' at row 2
261
265
SELECT * FROM t1;
267
273
CREATE TABLE t1 (col1 enum('red','blue','green'));
316
322
SHOW CREATE TABLE t1;
317
323
Table Create Table
318
324
t1 CREATE TABLE `t1` (
319
`col1` INT NOT NULL DEFAULT '99',
320
`col2` VARCHAR(6) COLLATE utf8_general_ci NOT NULL
321
) ENGINE=DEFAULT COLLATE = utf8_general_ci
325
`col1` int NOT NULL DEFAULT '99',
326
`col2` varchar(6) NOT NULL
322
328
INSERT INTO t1 VALUES (1, 'hello');
323
329
INSERT INTO t1 (col2) VALUES ('hello2');
324
330
INSERT INTO t1 (col2) VALUES (NULL);
423
429
show create table t1;
424
430
Table Create Table
425
431
t1 CREATE TABLE `t1` (
428
) ENGINE=DEFAULT COLLATE = utf8_general_ci
430
436
create table t1(a int, b timestamp);
431
437
alter table t1 add primary key(a);
432
438
show create table t1;
433
439
Table Create Table
434
440
t1 CREATE TABLE `t1` (
436
`b` TIMESTAMP NULL DEFAULT NULL,
442
`b` timestamp NULL DEFAULT NULL,
437
443
PRIMARY KEY (`a`)
438
) ENGINE=DEFAULT COLLATE = utf8_general_ci
440
446
create table t1(a int, b timestamp default 20050102030405);
441
447
alter table t1 add primary key(a);
442
448
show create table t1;
443
449
Table Create Table
444
450
t1 CREATE TABLE `t1` (
446
`b` TIMESTAMP NULL DEFAULT '2005-01-02 03:04:05',
452
`b` timestamp NULL DEFAULT '2005-01-02 03:04:05',
447
453
PRIMARY KEY (`a`)
448
) ENGINE=DEFAULT COLLATE = utf8_general_ci
450
456
create table t1 (date date not null);
451
457
create table t2 select date from t1;
452
458
show create table t2;
453
459
Table Create Table
454
460
t2 CREATE TABLE `t2` (
456
) ENGINE=DEFAULT COLLATE = utf8_general_ci
457
463
drop table t2,t1;
458
464
create table t1 (i int)
459
comment='123456789*123456789*123456789*123456789*123456789*123456789*';
465
comment '123456789*123456789*123456789*123456789*123456789*123456789*';
460
466
show create table t1;
461
467
Table Create Table
462
468
t1 CREATE TABLE `t1` (
464
) ENGINE=DEFAULT COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*' COLLATE = utf8_general_ci
470
) ENGINE=DEFAULT COMMENT='123456789*123456789*123456789*123456789*123456789*123456789*'
466
472
create table t1(col1 int, col2 int,
467
473
col3 int, col4 int,