Loading mysql-test/r/select.result +21 −0 Original line number Diff line number Diff line Loading @@ -3390,3 +3390,24 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where DROP TABLE t1,t2; CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); INSERT t1 SET i = 0; UPDATE t1 SET i = -1; Warnings: Warning 1264 Out of range value adjusted for column 'i' at row 1 SELECT * FROM t1; i 0 UPDATE t1 SET i = CAST(i - 1 AS SIGNED); Warnings: Warning 1264 Out of range value adjusted for column 'i' at row 1 SELECT * FROM t1; i 0 UPDATE t1 SET i = i - 1; Warnings: Warning 1264 Out of range value adjusted for column 'i' at row 1 SELECT * FROM t1; i 255 DROP TABLE t1; mysql-test/t/select.test +15 −0 Original line number Diff line number Diff line Loading @@ -2871,3 +2871,18 @@ SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr DROP TABLE t1,t2; # # Bug#18712: Truncation problem (needs just documenting and test # cases to prevent fixing this accidently. It is intended behaviour) # CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); INSERT t1 SET i = 0; UPDATE t1 SET i = -1; SELECT * FROM t1; UPDATE t1 SET i = CAST(i - 1 AS SIGNED); SELECT * FROM t1; UPDATE t1 SET i = i - 1; SELECT * FROM t1; DROP TABLE t1; Loading
mysql-test/r/select.result +21 −0 Original line number Diff line number Diff line Loading @@ -3390,3 +3390,24 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where DROP TABLE t1,t2; CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); INSERT t1 SET i = 0; UPDATE t1 SET i = -1; Warnings: Warning 1264 Out of range value adjusted for column 'i' at row 1 SELECT * FROM t1; i 0 UPDATE t1 SET i = CAST(i - 1 AS SIGNED); Warnings: Warning 1264 Out of range value adjusted for column 'i' at row 1 SELECT * FROM t1; i 0 UPDATE t1 SET i = i - 1; Warnings: Warning 1264 Out of range value adjusted for column 'i' at row 1 SELECT * FROM t1; i 255 DROP TABLE t1;
mysql-test/t/select.test +15 −0 Original line number Diff line number Diff line Loading @@ -2871,3 +2871,18 @@ SELECT t2.sku, t2.sppr, t2.name, t1.sku, t1.pr DROP TABLE t1,t2; # # Bug#18712: Truncation problem (needs just documenting and test # cases to prevent fixing this accidently. It is intended behaviour) # CREATE TABLE t1 (i TINYINT UNSIGNED NOT NULL); INSERT t1 SET i = 0; UPDATE t1 SET i = -1; SELECT * FROM t1; UPDATE t1 SET i = CAST(i - 1 AS SIGNED); SELECT * FROM t1; UPDATE t1 SET i = i - 1; SELECT * FROM t1; DROP TABLE t1;