Skip to content

Commit

Permalink
MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precis…
Browse files Browse the repository at this point in the history
…ion_to_length_no_truncation(uint, uint8, bool)

The patch for MDEV-9745 earlier fixed the problem reported in MDEV-9662 as well.
Only adding tests.
  • Loading branch information
Alexander Barkov committed Apr 20, 2016
1 parent 9a98714 commit 2564650
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mysql-test/include/ctype_numconv.inc
Expand Up @@ -1794,6 +1794,12 @@ SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY
DROP FUNCTION f1;
DROP TABLE t1;

--echo #
--echo # MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
--echo #
SELECT @@collation_connection;
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;

--echo #
--echo # MDEV-5702 Incorrect results are returned with NULLIF()
--echo #
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/r/ctype_binary.result
Expand Up @@ -2849,6 +2849,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
binary
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/r/ctype_cp1251.result
Expand Up @@ -3241,6 +3241,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
cp1251_general_ci
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/r/ctype_latin1.result
Expand Up @@ -3423,6 +3423,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
latin1_swedish_ci
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/r/ctype_ucs.result
Expand Up @@ -4239,6 +4239,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
ucs2_general_ci
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
Expand Down
9 changes: 9 additions & 0 deletions mysql-test/r/ctype_utf8.result
Expand Up @@ -5060,6 +5060,15 @@ f1()
DROP FUNCTION f1;
DROP TABLE t1;
#
# MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
#
SELECT @@collation_connection;
@@collation_connection
utf8_general_ci
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
CASE 1 WHEN 2 THEN ( - '3' ) END
NULL
#
# MDEV-5702 Incorrect results are returned with NULLIF()
#
CREATE TABLE t1 (d DATE);
Expand Down

0 comments on commit 2564650

Please sign in to comment.