DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (
|
c1 LONGBLOB,
|
c2 MEDIUMBLOB,
|
c3 BLOB,
|
c4 TINYBLOB,
|
c5 VARCHAR(64),
|
c6 VARCHAR(4000),
|
c7 CHAR(64));
|
DROP TABLE IF EXISTS t2;
|
CREATE TABLE t2 AS SELECT
|
MAX(COALESCE(c1)) AS c1,
|
MAX(COALESCE(c2)) AS c2,
|
MAX(COALESCE(c3)) AS c3,
|
MAX(COALESCE(c4)) AS c4,
|
MAX(COALESCE(c5)) AS c5,
|
MAX(COALESCE(c6)) AS c6,
|
MAX(COALESCE(c7)) AS c7 FROM t1;
|
SHOW CREATE TABLE t2;
|
returns
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| t2 | CREATE TABLE `t2` (
|
`c1` longblob,
|
`c2` mediumblob,
|
`c3` blob,
|
`c4` varbinary(255) DEFAULT NULL,
|
`c5` varchar(64) DEFAULT NULL,
|
`c6` text,
|
`c7` varchar(64) DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
Now if I run "mysql --column-type-info test" and execute this query:
SELECT
|
MAX(COALESCE(c1)) AS c1,
|
MAX(COALESCE(c2)) AS c2,
|
MAX(COALESCE(c3)) AS c3,
|
MAX(COALESCE(c4)) AS c4,
|
MAX(COALESCE(c5)) AS c5,
|
MAX(COALESCE(c6)) AS c6,
|
MAX(COALESCE(c7)) AS c7 FROM t1;
|
it returns the following metadata:
Field 1: `c1`
|
Type: LONG_BLOB
|
Collation: binary (63)
|
Length: 4294967295
|
|
Field 2: `c2`
|
Type: MEDIUM_BLOB
|
Collation: binary (63)
|
Length: 16777215
|
|
Field 3: `c3`
|
Type: VAR_STRING
|
Collation: binary (63)
|
Length: 65535
|
|
Field 4: `c4`
|
Type: VAR_STRING
|
Collation: binary (63)
|
Length: 255
|
|
Field 5: `c5`
|
Type: VAR_STRING
|
Collation: utf8_general_ci (33)
|
Length: 192
|
|
Field 6: `c6`
|
Type: VAR_STRING
|
Collation: utf8_general_ci (33)
|
Length: 12000
|
|
Field 7: `c7`
|
Type: VAR_STRING
|
Collation: utf8_general_ci (33)
|
Length: 192
|
Notice, for some columns the type of the column created in CREATE TABLE...SELECT does not match the type of the column returned in the metadata for the same SELECT query.
{"report":{"fcp":866.5999999046326,"ttfb":202,"pageVisibility":"visible","entityId":53498,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"c66c0ab6-4dd5-473a-b99c-a2b683fe8abe","navigationType":0,"readyForUser":957.2999999523163,"redirectCount":0,"resourceLoadedEnd":562.5999999046326,"resourceLoadedStart":208.59999990463257,"resourceTiming":[{"duration":4.599999904632568,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":208.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":213.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":4.700000047683716,"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":208.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":213.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":198.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":209,"connectEnd":216,"connectStart":216,"domainLookupEnd":216,"domainLookupStart":216,"fetchStart":209,"redirectEnd":0,"redirectStart":0,"requestStart":216.19999980926514,"responseEnd":407.7999999523163,"responseStart":233.29999995231628,"secureConnectionStart":216},{"duration":35.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":209.19999980926514,"connectEnd":209.19999980926514,"connectStart":209.19999980926514,"domainLookupEnd":209.19999980926514,"domainLookupStart":209.19999980926514,"fetchStart":209.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":218.89999985694885,"responseEnd":244.69999980926514,"responseStart":238.19999980926514,"secureConnectionStart":209.19999980926514},{"duration":353.40000009536743,"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":209.19999980926514,"connectEnd":209.19999980926514,"connectStart":209.19999980926514,"domainLookupEnd":209.19999980926514,"domainLookupStart":209.19999980926514,"fetchStart":209.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":218.59999990463257,"responseEnd":562.5999999046326,"responseStart":240.39999985694885,"secureConnectionStart":209.19999980926514},{"duration":35.700000047683716,"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":209.29999995231628,"connectEnd":209.29999995231628,"connectStart":209.29999995231628,"domainLookupEnd":209.29999995231628,"domainLookupStart":209.29999995231628,"fetchStart":209.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":220,"responseEnd":245,"responseStart":239.39999985694885,"secureConnectionStart":209.29999995231628},{"duration":44.5,"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":213.89999985694885,"connectEnd":213.89999985694885,"connectStart":213.89999985694885,"domainLookupEnd":213.89999985694885,"domainLookupStart":213.89999985694885,"fetchStart":213.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":228.29999995231628,"responseEnd":258.39999985694885,"responseStart":249.5,"secureConnectionStart":213.89999985694885},{"duration":10.5,"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":214,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":224.5,"responseStart":0,"secureConnectionStart":0},{"duration":45.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":214.19999980926514,"connectEnd":214.19999980926514,"connectStart":214.19999980926514,"domainLookupEnd":214.19999980926514,"domainLookupStart":214.19999980926514,"fetchStart":214.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":233,"responseEnd":260.09999990463257,"responseStart":252.19999980926514,"secureConnectionStart":214.19999980926514},{"duration":10.399999856948853,"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":214.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":214.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":224.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":52.60000014305115,"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":214.39999985694885,"connectEnd":214.39999985694885,"connectStart":214.39999985694885,"domainLookupEnd":214.39999985694885,"domainLookupStart":214.39999985694885,"fetchStart":214.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":235.39999985694885,"responseEnd":267,"responseStart":258.59999990463257,"secureConnectionStart":214.39999985694885},{"duration":291.90000009536743,"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":217.39999985694885,"connectEnd":217.39999985694885,"connectStart":217.39999985694885,"domainLookupEnd":217.39999985694885,"domainLookupStart":217.39999985694885,"fetchStart":217.39999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":245.89999985694885,"responseEnd":509.2999999523163,"responseStart":500.19999980926514,"secureConnectionStart":217.39999985694885},{"duration":292.39999985694885,"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":217.5,"connectEnd":217.5,"connectStart":217.5,"domainLookupEnd":217.5,"domainLookupStart":217.5,"fetchStart":217.5,"redirectEnd":0,"redirectStart":0,"requestStart":263.19999980926514,"responseEnd":509.89999985694885,"responseStart":502.09999990463257,"secureConnectionStart":217.5},{"duration":68,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":550.5999999046326,"connectEnd":550.5999999046326,"connectStart":550.5999999046326,"domainLookupEnd":550.5999999046326,"domainLookupStart":550.5999999046326,"fetchStart":550.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":581.5,"responseEnd":618.5999999046326,"responseStart":617.5,"secureConnectionStart":550.5999999046326},{"duration":189.69999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":783,"connectEnd":783,"connectStart":783,"domainLookupEnd":783,"domainLookupStart":783,"fetchStart":783,"redirectEnd":0,"redirectStart":0,"requestStart":942.3999998569489,"responseEnd":972.6999998092651,"responseStart":971.7999999523163,"secureConnectionStart":783},{"duration":142.29999995231628,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":858.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":858.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1000.8999998569489,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":61,"responseStart":202,"responseEnd":216,"domLoading":206,"domInteractive":1023,"domContentLoadedEventStart":1023,"domContentLoadedEventEnd":1066,"domComplete":1874,"loadEventStart":1874,"loadEventEnd":1876,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1004.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1005.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1005.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1007.7999999523163},{"name":"activityTabFullyLoaded","time":1075.0999999046326}],"measures":[],"correlationId":"fd73a8254c8fed","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":70,"dbReadsTimeInMs":11,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}