DROP TABLE IF EXISTS t1;
CREATE TABLE t1 AS SELECT 12345678900 AS c1, COALESCE (12345678900) AS c2;
SELECT * FROM t1;
SHOW CREATE TABLE t1;
+-------------+------------+
| c1 | c2 |
+-------------+------------+
| 12345678900 | 2147483647 |
+-------------+------------+
+-------+----------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` bigint(11) NOT NULL,
`c2` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------------------------
The expected result to create a BIGINT column for both expressions, and return 12345678900 for both columns.
Alexander Barkov
made changes -
2016-06-29 15:37
Field
Original Value
New Value
Description
{code:sql}
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 AS SELECT 12345678900 AS c1, COALESCE(12345678900) AS c2;
SELECT * FROM t1;
SHOW CREATE TABLE t1;
{code}
{noformat}
+-------------+------------+
| c1 | c2 |
+-------------+------------+
| 12345678900 | 2147483647 |
+-------------+------------+
{noformat}
{noformat}
+-------+----------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` bigint(11) NOT NULL,
`c2` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------------------------
{noformat}
The expected result to to create a BIGINT column for both expressions.
{code:sql}
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 AS SELECT 12345678900 AS c1, COALESCE(12345678900) AS c2;
SELECT * FROM t1;
SHOW CREATE TABLE t1;
{code}
{noformat}
+-------------+------------+
| c1 | c2 |
+-------------+------------+
| 12345678900 | 2147483647 |
+-------------+------------+
{noformat}
{noformat}
+-------+----------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` bigint(11) NOT NULL,
`c2` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+---------------------------------------------------------------------------------------------------------------
{noformat}
The expected result to create a BIGINT column for both expressions, and return 12345678900 for both columns.
Alexander Barkov
made changes -
2017-05-27 12:08
issue.field.resolutiondate
2017-05-27 12:08:57.0
2017-05-27 12:08:57.642
Alexander Barkov
made changes -
2017-05-27 12:08
Fix Version/s
10.3.1
[ 22532
]
Fix Version/s
10.1
[ 16100
]
Resolution
Fixed
[ 1
]
Status
Open
[ 1
]
Closed
[ 6
]
Sergei Golubchik
made changes -
2021-12-06 21:43
Workflow
MariaDB v3
[ 76278
]
MariaDB v4
[ 150567
]
{"report":{"fcp":803.8000000715256,"ttfb":246,"pageVisibility":"visible","entityId":57277,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"b8e1a6df-b180-4e92-9028-e77b94cf51fd","navigationType":0,"readyForUser":877,"redirectCount":0,"resourceLoadedEnd":1084.6000000238419,"resourceLoadedStart":251.70000004768372,"resourceTiming":[{"duration":59.39999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":251.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":251.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311.10000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":59.59999990463257,"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":251.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":251.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311.5,"responseStart":0,"secureConnectionStart":0},{"duration":73.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":252,"connectEnd":252,"connectStart":252,"domainLookupEnd":252,"domainLookupStart":252,"fetchStart":252,"redirectEnd":0,"redirectStart":0,"requestStart":252,"responseEnd":325.90000009536743,"responseStart":325.90000009536743,"secureConnectionStart":252},{"duration":206.29999995231628,"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":252.20000004768372,"connectEnd":252.20000004768372,"connectStart":252.20000004768372,"domainLookupEnd":252.20000004768372,"domainLookupStart":252.20000004768372,"fetchStart":252.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":252.20000004768372,"responseEnd":458.5,"responseStart":458.5,"secureConnectionStart":252.20000004768372},{"duration":209.5,"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":252.40000009536743,"connectEnd":252.40000009536743,"connectStart":252.40000009536743,"domainLookupEnd":252.40000009536743,"domainLookupStart":252.40000009536743,"fetchStart":252.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":252.40000009536743,"responseEnd":461.90000009536743,"responseStart":461.8000000715256,"secureConnectionStart":252.40000009536743},{"duration":209.80000007152557,"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":252.60000002384186,"connectEnd":252.60000002384186,"connectStart":252.60000002384186,"domainLookupEnd":252.60000002384186,"domainLookupStart":252.60000002384186,"fetchStart":252.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":252.60000002384186,"responseEnd":462.40000009536743,"responseStart":462.40000009536743,"secureConnectionStart":252.60000002384186},{"duration":209.79999995231628,"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":252.80000007152557,"connectEnd":252.80000007152557,"connectStart":252.80000007152557,"domainLookupEnd":252.80000007152557,"domainLookupStart":252.80000007152557,"fetchStart":252.80000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":252.80000007152557,"responseEnd":462.60000002384186,"responseStart":462.60000002384186,"secureConnectionStart":252.80000007152557},{"duration":211.19999992847443,"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":252.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":252.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":464.10000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":210,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":253.10000002384186,"connectEnd":253.10000002384186,"connectStart":253.10000002384186,"domainLookupEnd":253.10000002384186,"domainLookupStart":253.10000002384186,"fetchStart":253.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":253.10000002384186,"responseEnd":463.10000002384186,"responseStart":463.10000002384186,"secureConnectionStart":253.10000002384186},{"duration":210.89999997615814,"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":253.30000007152557,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":253.30000007152557,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":464.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":210.39999997615814,"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":253.40000009536743,"connectEnd":253.40000009536743,"connectStart":253.40000009536743,"domainLookupEnd":253.40000009536743,"domainLookupStart":253.40000009536743,"fetchStart":253.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":253.40000009536743,"responseEnd":463.8000000715256,"responseStart":463.8000000715256,"secureConnectionStart":253.40000009536743},{"duration":303.89999997615814,"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":254.40000009536743,"connectEnd":254.40000009536743,"connectStart":254.40000009536743,"domainLookupEnd":254.40000009536743,"domainLookupStart":254.40000009536743,"fetchStart":254.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":254.40000009536743,"responseEnd":558.3000000715256,"responseStart":558.3000000715256,"secureConnectionStart":254.40000009536743},{"duration":805.7999999523163,"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":258.8000000715256,"connectEnd":258.8000000715256,"connectStart":258.8000000715256,"domainLookupEnd":258.8000000715256,"domainLookupStart":258.8000000715256,"fetchStart":258.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":258.8000000715256,"responseEnd":1064.6000000238419,"responseStart":1064.6000000238419,"secureConnectionStart":258.8000000715256},{"duration":84.10000002384186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":475.10000002384186,"connectEnd":475.10000002384186,"connectStart":475.10000002384186,"domainLookupEnd":475.10000002384186,"domainLookupStart":475.10000002384186,"fetchStart":475.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":475.10000002384186,"responseEnd":559.2000000476837,"responseStart":559.2000000476837,"secureConnectionStart":475.10000002384186},{"duration":358.7999999523163,"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":725.8000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":725.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1084.6000000238419,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":54,"responseStart":246,"responseEnd":252,"domLoading":249,"domInteractive":1094,"domContentLoadedEventStart":1094,"domContentLoadedEventEnd":1138,"domComplete":1474,"loadEventStart":1474,"loadEventEnd":1475,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1066.3000000715256},{"name":"bigPipe.sidebar-id.end","time":1067.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.start","time":1067.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1070.5},{"name":"activityTabFullyLoaded","time":1154.1000000238419}],"measures":[],"correlationId":"435664519f376e","effectiveType":"4g","downlink":9.2,"rtt":0,"serverDuration":132,"dbReadsTimeInMs":30,"dbConnsTimeInMs":39,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The same problem is repeatable with smaller numbers:
+-------+----------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` bigint(10) NOT NULL,
`c2` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+----------------------------------------------------------------------------------------------------------------+
+------------+------------+
| c1 | c2 |
+------------+------------+
| 2147483648 | 2147483647 |
+------------+------------+
Notice, the data type and the value for c2 is wrong.