diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-03-18 13:38:29 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-03-18 13:38:29 +0300 |
commit | 2acfdc50929dda084cdad96e4208c1dd6f26e183 (patch) | |
tree | b9789210c6251e842ccc7cee877d0f3ffa2b0887 /mysql-test/r/strict.result | |
parent | d1ad316a59b6bd48dec94433ffe982ddfc376e35 (diff) | |
download | mariadb-git-2acfdc50929dda084cdad96e4208c1dd6f26e183.tar.gz |
Bug #8433: Overflow must be an error
All numeric operators and functions on integer, floating point
and DECIMAL values now throw an 'out of range' error rather
than returning an incorrect value or NULL, when the result is
out of supported range for the corresponding data type.
Some test cases in the test suite had to be updated
accordingly either because the test case itself relied on a
value returned in case of a numeric overflow, or because a
numeric overflow was the root cause of the corresponding bugs.
The latter tests are no longer relevant, since the expressions
used to trigger the corresponding bugs are not valid anymore.
However, such test cases have been adjusted and kept "for the
record".
mysql-test/r/func_math.result:
Added test cases for bug #8433.
Updated results of the test case for bug #31236.
mysql-test/r/func_misc.result:
Streamlined test cases.
mysql-test/r/func_test.result:
Streamlined test cases.
mysql-test/r/select.result:
Streamlined test cases.
mysql-test/r/sp.result:
Streamlined test cases.
mysql-test/r/strict.result:
Streamlined test cases.
mysql-test/r/type_newdecimal.result:
Streamlined test cases.
mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result:
Streamlined test cases.
mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test:
Streamlined test cases.
mysql-test/t/func_math.test:
Added test cases for bug #8433.
Updated results of the test case for bug #31236.
mysql-test/t/func_misc.test:
Streamlined test cases.
mysql-test/t/func_test.test:
Streamlined test cases.
mysql-test/t/select.test:
Streamlined test cases.
mysql-test/t/sp.test:
Streamlined test cases.
mysql-test/t/strict.test:
Streamlined test cases.
mysql-test/t/type_newdecimal.test:
Streamlined test cases.
sql/item_create.cc:
Changed Item_func_cot() to be defined as a standalone Item
rather than a combination of "1 / TAN(x)".
sql/item_func.cc:
Throw an 'out of range' error rather than returning an
incorrect value or NULL, when the result of a numeric
operator or a function is out of supported range for
the corresponding data type.
sql/item_func.h:
Added validation helpers as inline methods of Item_func.
sql/share/errmsg-utf8.txt:
New ER_DATA_OUT_OF_RANGE error.
Diffstat (limited to 'mysql-test/r/strict.result')
-rw-r--r-- | mysql-test/r/strict.result | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index fa4096cb424..769e797d2f6 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -895,6 +895,7 @@ ERROR 22003: Out of range value for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES ('-1.2E-3'); ERROR 22003: Out of range value for column 'col2' at row 1 UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0; +ERROR 22003: DOUBLE value is out of range in '("test"."t1"."col1" * 5000)' UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0; ERROR 22012: Division by 0 UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0; @@ -922,10 +923,10 @@ SELECT * FROM t1; col1 col2 -2.2e-307 0 1e-303 0 -NULL 1.7e308 +1.7e308 1.7e308 -2.2e-307 0 -2e-307 0 -NULL 1.7e308 +1.7e308 1.7e308 0 NULL 2 NULL NULL NULL |