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.
relates to
MDEV-9653
Assertion `length || !scale' failed in uint my_decimal_length_to_precision(uint, uint, bool)
Closed
Alexander Barkov
made changes -
2016-03-16 12:03
Field
Original Value
New Value
Labels
upstream-not-affected
Alexander Barkov
made changes -
2016-03-16 12:04
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.
Alexander Barkov
made changes -
2016-03-16 12:09
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}
Alexander Barkov
made changes -
2016-03-16 12: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.
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).
Alexander Barkov
made changes -
2016-03-16 12:12
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.
Alexander Barkov
made changes -
2016-04-18 13:00
Status
Open
[ 1
]
In Progress
[ 3
]
Alexander Barkov
made changes -
2016-04-19 12:59
Assignee
Alexander Barkov
[ bar
]
Sergei Golubchik
[ serg
]
Status
In Progress
[ 3
]
In Review
[ 10002
]
Sergei Golubchik
made changes -
2016-04-19 18:04
Assignee
Sergei Golubchik
[ serg
]
Alexander Barkov
[ bar
]
Status
In Review
[ 10002
]
Stalled
[ 10000
]
Alexander Barkov
made changes -
2016-04-20 04:54
Status
Stalled
[ 10000
]
In Progress
[ 3
]
Alexander Barkov
made changes -
2016-04-20 04:54
Fix Version/s
5.5.49
[ 21600
]
Fix Version/s
5.5
[ 15800
]
Resolution
Fixed
[ 1
]
Status
In Progress
[ 3
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2021-12-06 21:42
Workflow
MariaDB v3
[ 74574
]
MariaDB v4
[ 150234
]
{"report":{"fcp":1022.8000000119209,"ttfb":241.70000004768372,"pageVisibility":"visible","entityId":56173,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"4de1287f-864c-4469-bc97-85aa9367b546","navigationType":0,"readyForUser":1099.7000000476837,"redirectCount":0,"resourceLoadedEnd":1142.5,"resourceLoadedStart":248,"resourceTiming":[{"duration":307,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":248,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":248,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":555,"responseStart":0,"secureConnectionStart":0},{"duration":307,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":248.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":248.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":555.3000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":315.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":248.4000000357628,"connectEnd":248.4000000357628,"connectStart":248.4000000357628,"domainLookupEnd":248.4000000357628,"domainLookupStart":248.4000000357628,"fetchStart":248.4000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":248.4000000357628,"responseEnd":564.1000000238419,"responseStart":564.1000000238419,"secureConnectionStart":248.4000000357628},{"duration":372.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":248.60000002384186,"connectEnd":248.60000002384186,"connectStart":248.60000002384186,"domainLookupEnd":248.60000002384186,"domainLookupStart":248.60000002384186,"fetchStart":248.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":248.60000002384186,"responseEnd":620.7000000476837,"responseStart":620.7000000476837,"secureConnectionStart":248.60000002384186},{"duration":376,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":248.9000000357628,"connectEnd":248.9000000357628,"connectStart":248.9000000357628,"domainLookupEnd":248.9000000357628,"domainLookupStart":248.9000000357628,"fetchStart":248.9000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":248.9000000357628,"responseEnd":624.9000000357628,"responseStart":624.9000000357628,"secureConnectionStart":248.9000000357628},{"duration":376.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":249.10000002384186,"connectEnd":249.10000002384186,"connectStart":249.10000002384186,"domainLookupEnd":249.10000002384186,"domainLookupStart":249.10000002384186,"fetchStart":249.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":249.10000002384186,"responseEnd":625.8000000119209,"responseStart":625.8000000119209,"secureConnectionStart":249.10000002384186},{"duration":377.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":249.20000004768372,"connectEnd":249.20000004768372,"connectStart":249.20000004768372,"domainLookupEnd":249.20000004768372,"domainLookupStart":249.20000004768372,"fetchStart":249.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":249.20000004768372,"responseEnd":626.5,"responseStart":626.5,"secureConnectionStart":249.20000004768372},{"duration":456.69999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":249.4000000357628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":249.4000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":706.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":377.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":249.5,"connectEnd":249.5,"connectStart":249.5,"domainLookupEnd":249.5,"domainLookupStart":249.5,"fetchStart":249.5,"redirectEnd":0,"redirectStart":0,"requestStart":249.5,"responseEnd":627.3000000119209,"responseStart":627.2000000476837,"secureConnectionStart":249.5},{"duration":456.5999999642372,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":249.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":249.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":706.3000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":378.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":249.80000001192093,"connectEnd":249.80000001192093,"connectStart":249.80000001192093,"domainLookupEnd":249.80000001192093,"domainLookupStart":249.80000001192093,"fetchStart":249.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":249.80000001192093,"responseEnd":628.1000000238419,"responseStart":628.1000000238419,"secureConnectionStart":249.80000001192093},{"duration":682.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":250.70000004768372,"connectEnd":250.70000004768372,"connectStart":250.70000004768372,"domainLookupEnd":250.70000004768372,"domainLookupStart":250.70000004768372,"fetchStart":250.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":250.70000004768372,"responseEnd":933,"responseStart":933,"secureConnectionStart":250.70000004768372},{"duration":875.8999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":254.9000000357628,"connectEnd":254.9000000357628,"connectStart":254.9000000357628,"domainLookupEnd":254.9000000357628,"domainLookupStart":254.9000000357628,"fetchStart":254.9000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":254.9000000357628,"responseEnd":1130.800000011921,"responseStart":1130.800000011921,"secureConnectionStart":254.9000000357628},{"duration":220.30000001192093,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":717.4000000357628,"connectEnd":717.4000000357628,"connectStart":717.4000000357628,"domainLookupEnd":717.4000000357628,"domainLookupStart":717.4000000357628,"fetchStart":717.4000000357628,"redirectEnd":0,"redirectStart":0,"requestStart":717.4000000357628,"responseEnd":937.7000000476837,"responseStart":937.7000000476837,"secureConnectionStart":717.4000000357628},{"duration":154.89999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":977.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":977.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1132,"responseStart":0,"secureConnectionStart":0},{"duration":154.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":978,"connectEnd":978,"connectStart":978,"domainLookupEnd":978,"domainLookupStart":978,"fetchStart":978,"redirectEnd":0,"redirectStart":0,"requestStart":978,"responseEnd":1132.2000000476837,"responseStart":1132.1000000238419,"secureConnectionStart":978},{"duration":164.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":978.3000000119209,"connectEnd":978.3000000119209,"connectStart":978.3000000119209,"domainLookupEnd":978.3000000119209,"domainLookupStart":978.3000000119209,"fetchStart":978.3000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":978.3000000119209,"responseEnd":1142.5,"responseStart":1142.5,"secureConnectionStart":978.3000000119209},{"duration":212.4000000357628,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1016.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1016.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1228.9000000357628,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":22,"responseStart":241,"responseEnd":246,"domLoading":244,"domInteractive":1240,"domContentLoadedEventStart":1240,"domContentLoadedEventEnd":1287,"domComplete":1769,"loadEventStart":1769,"loadEventEnd":1769,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1196.4000000357628},{"name":"bigPipe.sidebar-id.end","time":1197.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1197.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1202},{"name":"activityTabFullyLoaded","time":1306.5}],"measures":[],"correlationId":"78473be45559fc","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":150,"dbReadsTimeInMs":28,"dbConnsTimeInMs":39,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}