From 8f1f869f68581238b7718169fd50e9d7b6c7f0a3 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 20 Apr 2016 15:26:37 +0200 Subject: another test case for ER_DATA_OUT_OF_RANGE on insert tests it with a non-const table too --- mysql-test/r/func_math.result | 5 +++++ mysql-test/t/func_math.test | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 3f8ab6c78d9..d122d435ac7 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -663,6 +663,11 @@ SELECT -a FROM t1; ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)' SELECT -b FROM t1; ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)' +INSERT INTO t1 VALUES(0,0); +SELECT -a FROM t1; +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)' +SELECT -b FROM t1; +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)' DROP TABLE t1; SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999; SELECT @a + @a; diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index b843cf8c364..cd90184ebf5 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -484,6 +484,14 @@ SELECT -a FROM t1; --error ER_DATA_OUT_OF_RANGE SELECT -b FROM t1; +# try with two rows now +INSERT INTO t1 VALUES(0,0); + +--error ER_DATA_OUT_OF_RANGE +SELECT -a FROM t1; +--error ER_DATA_OUT_OF_RANGE +SELECT -b FROM t1; + DROP TABLE t1; # Decimal overflows -- cgit v1.2.1