174
174
insert into t1 values ("00000000000001");
175
175
insert into t1 values ("+0000000000001");
176
176
insert into t1 values ("-0000000000001");
177
--error 1264 out of range value
177
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
178
178
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
179
--error 1264 out of range value
179
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
180
180
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
181
--error 1366 incorrect decimal value
181
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
182
182
insert into t1 values ("1e+1000");
183
--error 1366 incorrect decimal value
183
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
184
184
insert into t1 values ("1e-1000");
185
--error 1366 incorrect decimal value
185
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
186
186
insert into t1 values ("-1e+1000");
187
--error 1366 incorrect decimal value
187
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
188
188
insert into t1 values ("1e+4294967296");
189
--error 1366 incorrect decimal value
189
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
190
190
insert into t1 values ("1e-4294967296");
191
--error 1366 incorrect decimal value
191
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
192
192
insert into t1 values ("1e+18446744073709551615");
193
--error 1366 incorrect decimal value
193
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
194
194
insert into t1 values ("1e+18446744073709551616");
195
--error 1366 incorrect decimal value
195
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
196
196
insert into t1 values ("1e-9223372036854775807");
197
--error 1366 incorrect decimal value
197
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
198
198
insert into t1 values ("1e-9223372036854775809");
199
--error 1366 incorrect decimal value
200
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
204
create table t1 (a decimal(10,2));
205
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
206
insert into t1 values ("-.1"),("+.1"),(".1");
207
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
208
--error 1264 out of range value
209
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
210
--error 1264 out of range value
211
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
212
--error 1366 incorrect decimal value
213
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
214
--error 1366 incorrect decimal value
215
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
219
create table t1 (a decimal(10,2));
220
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
221
insert into t1 values ("-.1"),("+.1"),(".1");
222
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
223
--error 1264 out of range value
224
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
225
--error 1264 out of range value
226
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
227
--error 1366 incorrect decimal value
228
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
229
--error 1366 incorrect decimal value
199
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
200
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
204
create table t1 (a decimal(10,2));
205
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
206
insert into t1 values ("-.1"),("+.1"),(".1");
207
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
208
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
209
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
210
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
211
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
212
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
213
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
214
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
215
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
219
create table t1 (a decimal(10,2));
220
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0");
221
insert into t1 values ("-.1"),("+.1"),(".1");
222
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
223
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
224
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
225
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
226
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11");
227
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
228
insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000");
229
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
230
230
insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0");
231
231
select * from t1;
237
237
insert into t1 values (0.0),("-0.0"),(+0.0),(01.0),(+01.0),(-01.0);
238
238
insert into t1 values (-.1),(+.1),(.1);
239
239
insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
240
--error 1264 out of range value
240
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
241
241
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
242
--error 1264 out of range value
242
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
243
243
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11);
244
--error 1264 out of range value
244
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
245
245
insert into t1 values (1e+100),(1e-100),(-1e+100);
246
246
insert into t1 values (123.4e0);
247
247
insert into t1 values (123.4e+2);
248
248
# This INSERT statement will give an error since truncation of a
249
249
# decimal number in Drizzle is an error. See bug#337038 for further
251
--error ER_WARN_DATA_TRUNCATED
252
252
insert into t1 values (123.4e-2);
253
253
insert into t1 values (123e1);
254
254
insert into t1 values (123e+0);
265
265
create table t1 (a decimal);
266
--error 1264 out of range value
266
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
267
267
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999);
268
268
select * from t1;
270
270
create table t1 (a decimal);
271
--error 1264 out of range value
272
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
275
create table t1 (a decimal);
276
--error 1264 out of range value
277
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
280
create table t1 (a decimal);
281
--error 1264 out of range value
271
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
272
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
275
create table t1 (a decimal);
276
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
277
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
280
create table t1 (a decimal);
281
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
282
282
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999);
283
283
select * from t1;
286
286
# Exponent overflow bug
287
287
create table t1(a decimal(10,0));
288
--error 1366 incorrect decimal value
288
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
289
289
insert into t1 values ("1e4294967295");
290
290
select * from t1;
292
--error 1366 incorrect decimal value
292
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD incorrect decimal value
293
293
insert into t1 values("1e4294967297");
294
294
select * from t1;
313
313
--disable_warnings
314
314
create table t1(a decimal(7,3));
315
--error 1264 out of range value
316
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
319
create table t1(a decimal(7,3));
320
--error 1264 out of range value
321
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
324
create table t1(a decimal(7,3));
325
--error 1264 out of range value
315
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
316
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
319
create table t1(a decimal(7,3));
320
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
321
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
324
create table t1(a decimal(7,3));
325
--error ER_WARN_DATA_OUT_OF_RANGE out of range value
326
326
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
327
327
--enable_warnings
328
328
select * from t1;