Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
-
5.5.49
Description
This script crashes the server:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; |
The problem is not repeatable in MySQL-5.7.11.
It seems it's trying to create a DECIMAL(0,0) column. If I change the script slightly:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a; |
SHOW CREATE TABLE t1; |
it does not crash, but the result is incorrect:
+-------+--------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+--------------------------------------------------------------------------------------------+
|
| t1 | CREATE TABLE `t1` (
|
`a` decimal(1,0) DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+--------------------------------------------------------------------------------------------+
|
The field data type DECIMAL(1,0) is too small. It should probably be DECIMAL(2,0).
MySQL-5.7.11 creates a DECIMAL(2,0) column.
Attachments
Issue Links
- relates to
-
MDEV-9653 Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Labels | upstream-not-affected |
Description |
This script crashes the server:
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; {code} |
This script crashes the server:
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; {code} The problem is not repeatable in MySQL-5.7.11. |
Description |
This script crashes the server:
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; {code} The problem is not repeatable in MySQL-5.7.11. |
This script crashes the server:
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; {code} The problem is not repeatable in MySQL-5.7.11. It seems it's trying to create a DECIMAL(0,0) column. If I change the script slightly: {code} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a; SHOW CREATE TABLE t1; {code} |
Fix Version/s | 5.5 [ 15800 ] |
Description |
This script crashes the server:
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; {code} The problem is not repeatable in MySQL-5.7.11. It seems it's trying to create a DECIMAL(0,0) column. If I change the script slightly: {code} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a; SHOW CREATE TABLE t1; {code} |
This script crashes the server:
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; {code} The problem is not repeatable in MySQL-5.7.11. It seems it's trying to create a DECIMAL(0,0) column. If I change the script slightly: {code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a; SHOW CREATE TABLE t1; {code} it does not crash, but the result is incorrect: {noformat} +-------+--------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+--------------------------------------------------------------------------------------------+ | t1 | CREATE TABLE `t1` ( `a` decimal(1,0) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +-------+--------------------------------------------------------------------------------------------+ {noformat} The field data type DECIMAL(1,0) is too small. It should probably be DECIMAL(2,0). |
Description |
This script crashes the server:
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; {code} The problem is not repeatable in MySQL-5.7.11. It seems it's trying to create a DECIMAL(0,0) column. If I change the script slightly: {code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a; SHOW CREATE TABLE t1; {code} it does not crash, but the result is incorrect: {noformat} +-------+--------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+--------------------------------------------------------------------------------------------+ | t1 | CREATE TABLE `t1` ( `a` decimal(1,0) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +-------+--------------------------------------------------------------------------------------------+ {noformat} The field data type DECIMAL(1,0) is too small. It should probably be DECIMAL(2,0). |
This script crashes the server:
{code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END AS a; {code} The problem is not repeatable in MySQL-5.7.11. It seems it's trying to create a DECIMAL(0,0) column. If I change the script slightly: {code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 SELECT CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 40 END AS a; SHOW CREATE TABLE t1; {code} it does not crash, but the result is incorrect: {noformat} +-------+--------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+--------------------------------------------------------------------------------------------+ | t1 | CREATE TABLE `t1` ( `a` decimal(1,0) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +-------+--------------------------------------------------------------------------------------------+ {noformat} The field data type DECIMAL(1,0) is too small. It should probably be DECIMAL(2,0). MySQL-5.7.11 creates a DECIMAL(2,0) column. |
Status | Open [ 1 ] | In Progress [ 3 ] |
Sprint | 5.5.49-1 [ 48 ] |
Assignee | Alexander Barkov [ bar ] | Sergei Golubchik [ serg ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Sergei Golubchik [ serg ] | Alexander Barkov [ bar ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Fix Version/s | 5.5.49 [ 21600 ] | |
Fix Version/s | 5.5 [ 15800 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 74574 ] | MariaDB v4 [ 150234 ] |