# test file for bug #13573: wrong data inserted for too big values for INSERT into DECIMAL column --disable_warnings drop database if exists db_018; --enable_warnings create database db_019; use db_019; create table tt1 (c1 decimal(64)); --echo ... WRONG: inserted as 0 insert into tt1 values( 89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 83000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); --echo ... next 2 rows inserted as *MAX_VALUE*, BOTH WARNING and ERROR shown insert into tt1 values( 89123456789012345678901234567890123456789012345678901234567890123456789012345678900000000 ); insert into tt1 values( 8200000000000000000000000000000000000000000000000000000000000000000000000000000000 ); --echo ... OK: next 4 rows inserted as *MAX_VALUE*, only WARNING shown insert into tt1 values( 65000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 65123456789012345678901234567890123456789012345678901234567890000 ); --echo ... CORRECT: inserted value as wanted. insert into tt1 values( 6412345678901234567890123456789012345678901234567890123456789000 ); select * from tt1; --echo ... inserted as *MAX_VALUE*, only WARNING shown insert into tt1 values( 6.1234E+89 ); insert into tt1 values( 6.1234E+83 ); insert into tt1 values( 6.1234E+65 ); --echo ... STRANGE: value inserted AND WARNING shown insert into tt1 values( 0.64123456E64 ); insert into tt1 values( 6.4123456E63 ); insert into tt1 values( 64.123456E62 ); insert into tt1 values( 641.23456E61 ); insert into tt1 values( 6412.3456E60 ); insert into tt1 values( 64123.456E59 ); select * from tt1; if (0) { strange behaviour with too big values for INSERT into DECIMAL col insert into tt1 values(3109990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); select * from tt1; insert into tt1 values(3109991234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789000000000015512345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789000); select * from tt1; insert into tt1 values(26099900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(2599900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(258900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(25700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(2560000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(255000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(25400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(2530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(252000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(25100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values(2509990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); insert into tt1 values( 255000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 25400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001550000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 2530000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000015500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 1540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 1009990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 92000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 9100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); insert into tt1 values( 909990000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 870000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 86000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 8500000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 840000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 83000000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 8200000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 810000000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 80999000000000000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 7099900000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 690000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 68000000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 6700000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 660000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 65000000000000000000000000000000000000000000000000000000000000000 ); select * from tt1; insert into tt1 values( 1541234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678900 ); select * from tt1; insert into tt1 values( 1009991234567890123456789012345678901234567890123456789012345678901234567890123456789012345678900000 ); select * from tt1; insert into tt1 values( 92123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 ); select * from tt1; insert into tt1 values( 9112345678901234567890123456789012345678901234567890123456789012345678901234567890000000000 ); select * from tt1; insert into tt1 values( 909991234567890123456789012345678901234567890123456789012345678901234567890123456789000000 ); select * from tt1; insert into tt1 values( 8812345678901234567890123456789012345678901234567890123456789012345678901234567890000000 ); select * from tt1; insert into tt1 values( 871234567890123456789012345678901234567890123456789012345678901234567890123456789000000 ); select * from tt1; insert into tt1 values( 86123456789012345678901234567890123456789012345678901234567890123456789012345678900000 ); select * from tt1; insert into tt1 values( 8512345678901234567890123456789012345678901234567890123456789012345678901234567890000 ); select * from tt1; insert into tt1 values( 841234567890123456789012345678901234567890123456789012345678901234567890123456789000 ); select * from tt1; insert into tt1 values( 83123456789012345678901234567890123456789012345678901234567890123456789012345678900 ); insert into tt1 values( 8212345678901234567890123456789012345678901234567890123456789012345678901234567890 ); insert into tt1 values( 811234567890123456789012345678901234567890123456789012345678901234567890000000000 ); insert into tt1 values( 80999123456789012345678901234567890123456789012345678901234567890123456789000000 ); select * from tt1; insert into tt1 values( 7099912345678901234567890123456789012345678901234567890123456789000000 ); insert into tt1 values( 691234567890123456789012345678901234567890123456789012345678900000000 ); insert into tt1 values( 68123456789012345678901234567890123456789012345678901234567890000000 ); insert into tt1 values( 6712345678901234567890123456789012345678901234567890123456789000000 ); insert into tt1 values( 661234567890123456789012345678901234567890123456789012345678900000 ); insert into tt1 values( 65123456789012345678901234567890123456789012345678901234567890000 ); select * from tt1; insert into tt1 values( 6412345678901234567890123456789012345678901234567890123456789000 ); insert into tt1 values( 631234567890123456789012345678901234567890123456789012345678900 ); insert into tt1 values( 62123456789012345678901234567890123456789012345678901234567890 ); select * from tt1; insert into tt1 values( 6112345678901234567890123456789012345678901234567890000000000 ); insert into tt1 values( 612345678901234567890123456789012345678901234567890000000000 ); select * from tt1; insert into tt1 values( 65123456789012345678901234567890123456789012345678901234567890000.00 ); insert into tt1 values( 6412345678901234567890123456789012345678901234567890123456789000.00 ); insert into tt1 values( 631234567890123456789012345678901234567890123456789012345678900.00 ); insert into tt1 values( 62123456789012345678901234567890123456789012345678901234567890.00 ); insert into tt1 values( 6112345678901234567890123456789012345678901234567890000000000.00 ); insert into tt1 values( 612345678901234567890123456789012345678901234567890000000000.00 ); select * from tt1; } --disable_warnings drop database if exists db_019; --enable_warnings