1
1
DROP TABLE IF EXISTS t1;
2
2
CREATE TABLE t1 (col1 INT);
3
INSERT INTO t1 VALUES(-2147483648),(0),(2147483647),('-2147483648'),('2147483647'),(-2147483648.0),(2147483647.0);
3
INSERT INTO t1 VALUES(-2147483648);
4
INSERT INTO t1 VALUES (0);
5
INSERT INTO t1 VALUES (2147483647);
6
INSERT INTO t1 VALUES ('-2147483648');
7
INSERT INTO t1 VALUES ('2147483647');
8
INSERT INTO t1 VALUES (-2147483648.0);
9
INSERT INTO t1 VALUES (2147483647.0);
4
10
INSERT INTO t1 (col1) VALUES(-2147483649);
5
11
ERROR 22003: Out of range value for column 'col1' at row 1
6
12
INSERT INTO t1 (col1) VALUES(2147643648);
31
37
INSERT IGNORE INTO t1 values (1/0);
33
39
Error 1365 Division by 0
34
INSERT IGNORE INTO t1 values (-2147483649),(2147643648);
36
Warning 1264 Out of range value for column 'col1' at row 1
37
Warning 1264 Out of range value for column 'col1' at row 2
38
INSERT IGNORE INTO t1 values ('-2147483649'),('2147643648');
40
Warning 1264 Out of range value for column 'col1' at row 1
41
Warning 1264 Out of range value for column 'col1' at row 2
42
INSERT IGNORE INTO t1 values (-2147483649.0),(2147643648.0);
44
Warning 1264 Out of range value for column 'col1' at row 1
45
Warning 1264 Out of range value for column 'col1' at row 2
40
INSERT IGNORE INTO t1 values (-2147483649);
42
Warning 1264 Out of range value for column 'col1' at row 1
43
INSERT IGNORE INTO t1 values (2147643648);
45
Warning 1264 Out of range value for column 'col1' at row 1
46
INSERT IGNORE INTO t1 values ('-2147483649');
48
Warning 1264 Out of range value for column 'col1' at row 1
49
INSERT IGNORE INTO t1 values ('2147643648');
51
Warning 1264 Out of range value for column 'col1' at row 1
52
INSERT IGNORE INTO t1 values (-2147483649.0);
54
Warning 1264 Out of range value for column 'col1' at row 1
55
INSERT IGNORE INTO t1 values (2147643648.0);
57
Warning 1264 Out of range value for column 'col1' at row 1
64
76
CREATE TABLE t1 (col1 BIGINT);
65
INSERT INTO t1 VALUES(-9223372036854775808),(0),(9223372036854775807);
66
INSERT INTO t1 VALUES('-9223372036854775808'),('9223372036854775807');
67
INSERT INTO t1 VALUES(-9223372036854774000.0),(9223372036854775700.0);
77
INSERT INTO t1 VALUES (-9223372036854775808);
78
INSERT INTO t1 VALUES (0);
79
INSERT INTO t1 VALUES (9223372036854775807);
80
INSERT INTO t1 VALUES ('-9223372036854775808');
81
INSERT INTO t1 VALUES ('9223372036854775807');
82
INSERT INTO t1 VALUES (-9223372036854774000.0);
83
INSERT INTO t1 VALUES (9223372036854775700.0);
68
84
INSERT INTO t1 (col1) VALUES(-9223372036854775809);
69
85
ERROR 22003: Out of range value for column 'col1' at row 1
70
86
INSERT INTO t1 (col1) VALUES('-9223372036854775809');
91
107
INSERT IGNORE INTO t1 values (1/0);
93
109
Error 1365 Division by 0
94
INSERT IGNORE INTO t1 VALUES(-9223372036854775809),(9223372036854775808);
96
Warning 1264 Out of range value for column 'col1' at row 1
97
INSERT IGNORE INTO t1 VALUES('-9223372036854775809'),('9223372036854775808');
99
Warning 1264 Out of range value for column 'col1' at row 1
100
Warning 1264 Out of range value for column 'col1' at row 2
101
INSERT IGNORE INTO t1 VALUES(-9223372036854785809.0),(9223372036854785808.0);
103
Warning 1264 Out of range value for column 'col1' at row 1
104
Warning 1264 Out of range value for column 'col1' at row 2
110
INSERT IGNORE INTO t1 VALUES (-9223372036854775809);
112
Warning 1264 Out of range value for column 'col1' at row 1
113
INSERT IGNORE INTO t1 VALUES (9223372036854775808);
114
INSERT IGNORE INTO t1 VALUES ('-9223372036854775809');
116
Warning 1264 Out of range value for column 'col1' at row 1
117
INSERT IGNORE INTO t1 VALUES ('9223372036854775808');
119
Warning 1264 Out of range value for column 'col1' at row 1
120
INSERT IGNORE INTO t1 VALUES (-9223372036854785809.0);
122
Warning 1264 Out of range value for column 'col1' at row 1
123
INSERT IGNORE INTO t1 VALUES (9223372036854785808.0);
125
Warning 1264 Out of range value for column 'col1' at row 1
105
126
SELECT * FROM t1;
107
128
-9223372036854775808
121
142
9223372036854775807
123
144
CREATE TABLE t1 (col1 NUMERIC(4,2));
124
INSERT INTO t1 VALUES (10.55),(10.55),(0),(-10.55),(-10.55),(11),(1e+01);
125
INSERT INTO t1 VALUES ('10.55'),('10.55'),('-10.55'),('-10.55'),('11'),('1e+01');
145
INSERT INTO t1 VALUES (10.55);
146
INSERT INTO t1 VALUES (10.5555);
147
ERROR 01000: Data truncated for column 'col1' at row 1
148
INSERT INTO t1 VALUES (0);
149
INSERT INTO t1 VALUES (-10.55);
150
INSERT INTO t1 VALUES (-10.5555);
151
ERROR 01000: Data truncated for column 'col1' at row 1
152
INSERT INTO t1 VALUES (11);
153
INSERT INTO t1 VALUES (1e+01);
154
INSERT INTO t1 VALUES ('10.55');
155
INSERT INTO t1 VALUES ('10.5555');
156
ERROR 01000: Data truncated for column 'col1' at row 1
157
INSERT INTO t1 VALUES ('-10.55');
158
INSERT INTO t1 VALUES ('-10.5555');
159
ERROR 01000: Data truncated for column 'col1' at row 1
160
INSERT INTO t1 VALUES ('11');
161
INSERT INTO t1 VALUES ('1e+01');
126
162
INSERT INTO t1 VALUES (101.55);
127
163
ERROR 22003: Out of range value for column 'col1' at row 1
128
164
INSERT INTO t1 VALUES (101);
146
182
INSERT INTO t1 VALUES ('-100E');
147
183
ERROR HY000: Incorrect decimal value: '-100E' for column 'col1' at row 1
148
184
UPDATE t1 SET col1 =col1 * 50000 WHERE col1 =11;
149
ERROR 22003: Out of range value for column 'col1' at row 6
185
ERROR 22003: Out of range value for column 'col1' at row 4
150
186
UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0;
151
187
ERROR 22012: Division by 0
152
188
UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0;
163
199
INSERT IGNORE INTO t1 values (1/0);
165
201
Error 1365 Division by 0
166
INSERT IGNORE INTO t1 VALUES(1000),(-1000);
168
Warning 1264 Out of range value for column 'col1' at row 1
169
Warning 1264 Out of range value for column 'col1' at row 2
170
INSERT IGNORE INTO t1 VALUES('1000'),('-1000');
172
Warning 1264 Out of range value for column 'col1' at row 1
173
Warning 1264 Out of range value for column 'col1' at row 2
174
INSERT IGNORE INTO t1 VALUES(1000.0),(-1000.0);
176
Warning 1264 Out of range value for column 'col1' at row 1
177
Warning 1264 Out of range value for column 'col1' at row 2
202
INSERT IGNORE INTO t1 VALUES (1000);
204
Warning 1264 Out of range value for column 'col1' at row 1
205
INSERT IGNORE INTO t1 VALUES (-1000);
207
Warning 1264 Out of range value for column 'col1' at row 1
208
INSERT IGNORE INTO t1 VALUES ('1000');
210
Warning 1264 Out of range value for column 'col1' at row 1
211
INSERT IGNORE INTO t1 VALUES ('-1000');
213
Warning 1264 Out of range value for column 'col1' at row 1
214
INSERT IGNORE INTO t1 VALUES (1000.0);
216
Warning 1264 Out of range value for column 'col1' at row 1
217
INSERT IGNORE INTO t1 VALUES (-1000.0);
219
Warning 1264 Out of range value for column 'col1' at row 1
178
220
UPDATE IGNORE t1 SET col1=1/NULL where col1=0;
179
221
SELECT * FROM t1;
203
241
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
204
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
242
INSERT INTO t1 VALUES ('hello', 'hello');
243
INSERT INTO t1 VALUES ('he', 'he');
244
INSERT INTO t1 VALUES ('hello ', 'hello ');
206
Note 1265 Data truncated for column 'col1' at row 3
246
Note 1265 Data truncated for column 'col1' at row 1
207
247
INSERT INTO t1 (col1) VALUES ('hellobob');
208
248
ERROR 22001: Data too long for column 'col1' at row 1
209
249
INSERT INTO t1 (col2) VALUES ('hellobob');
233
273
CREATE TABLE t1 (col1 enum('red','blue','green'));
234
INSERT INTO t1 VALUES ('red'),('blue'),('green');
274
INSERT INTO t1 VALUES ('red');
275
INSERT INTO t1 VALUES ('blue');
276
INSERT INTO t1 VALUES ('green');
235
277
INSERT INTO t1 (col1) VALUES ('yellow');
236
278
ERROR HY000: Received an invalid enum value 'yellow'.
237
279
INSERT INTO t1 (col1) VALUES ('redd');