DROP TABLE IF EXISTS t1;
|
SET @a='test';
|
SELECT @a;
|
Field 1: `@a`
|
Catalog: `def`
|
Database: ``
|
Table: ``
|
Org_table: ``
|
Type: MEDIUM_BLOB
|
Collation: utf8_general_ci (33)
|
Length: 50331645
|
Max_length: 4
|
Decimals: 31
|
Flags:
|
+------+
|
| @a |
|
+------+
|
| test |
|
+------+
|
Notice, MEDIUM_BLOB is displayed as the data type.
Now I create a table:
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 AS SELECT @a;
|
SHOW CREATE TABLE t1;
|
+-------+-----------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+-----------------------------------------------------------------------------------------------+
|
| t1 | CREATE TABLE `t1` (
|
`@a` longtext CHARACTER SET utf8
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+-----------------------------------------------------------------------------------------------+
|
Notice, a LONGTEXT column was created.
There is a mismatch:
- Either LONG_BLOB should be reported in the metadata
- Or a MEDIUMBLOB column should be created
- Or perhaps a smaller data type could be used, e.g. BLOB or TINYBLOB, with the corresponding data type displayed in metadata.
Update:
The data type should be LONGBLOB/LONGTEXT, because user variables can be modified on the fly. So the metadata should by synchronized with the data type and report LONG_BLOB.
The same problem is repeatable with Item_func_set_user_var:
CREATE OR REPLACE TABLE t1 AS SELECT @a:=1;
|
DESCRIBE t1;
|
+-------+--------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+-------+--------+------+-----+---------+-------+
|
| @a:=1 | int(1) | NO | | 0 | |
|
+-------+--------+------+-----+---------+-------+
|
But if I start mysql --column-type-info test and do:
Field 1: `@a:=1`
|
Type: LONGLONG
|
Length: 3
|
Max_length: 1
|
Notice, result set metadata is wrong. It should report LONG rather than LONGLONG.
- blocks
-
MDEV-4912
Data type plugin API version 1
-
-
Closed
Transition |
Time In Source Status |
Execution Times |
Open |
|
In Progress |
|
33d 9m
|
1
|
In Progress |
|
Closed |
|
2h 36m
|
1
|
{"report":{"fcp":726.4000000953674,"ttfb":180.19999980926514,"pageVisibility":"visible","entityId":60998,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"679f6654-4261-448a-9f94-6c9d14420565","navigationType":0,"readyForUser":851.5,"redirectCount":0,"resourceLoadedEnd":734.4000000953674,"resourceLoadedStart":185.19999980926514,"resourceTiming":[{"duration":133.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":185.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":185.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":318.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":133,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":185.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":185.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":318.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":141.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/c54b129276d75dc2a3460e1d78f37913-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":185.5,"connectEnd":185.5,"connectStart":185.5,"domainLookupEnd":185.5,"domainLookupStart":185.5,"fetchStart":185.5,"redirectEnd":0,"redirectStart":0,"requestStart":185.5,"responseEnd":327.40000009536743,"responseStart":327.40000009536743,"secureConnectionStart":185.5},{"duration":218.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/f867843cd2fdb209d4d1d4f760f86346-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":185.59999990463257,"connectEnd":185.59999990463257,"connectStart":185.59999990463257,"domainLookupEnd":185.59999990463257,"domainLookupStart":185.59999990463257,"fetchStart":185.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":185.59999990463257,"responseEnd":404.19999980926514,"responseStart":404.19999980926514,"secureConnectionStart":185.59999990463257},{"duration":222.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/ffdb17665775c5b4d6f097f3974ee359-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":185.69999980926514,"connectEnd":185.69999980926514,"connectStart":185.69999980926514,"domainLookupEnd":185.69999980926514,"domainLookupStart":185.69999980926514,"fetchStart":185.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":185.69999980926514,"responseEnd":408.59999990463257,"responseStart":408.59999990463257,"secureConnectionStart":185.69999980926514},{"duration":223.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":185.7999997138977,"connectEnd":185.7999997138977,"connectStart":185.7999997138977,"domainLookupEnd":185.7999997138977,"domainLookupStart":185.7999997138977,"fetchStart":185.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":185.7999997138977,"responseEnd":409.09999990463257,"responseStart":409.09999990463257,"secureConnectionStart":185.7999997138977},{"duration":223.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":185.90000009536743,"connectEnd":185.90000009536743,"connectStart":185.90000009536743,"domainLookupEnd":185.90000009536743,"domainLookupStart":185.90000009536743,"fetchStart":185.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":185.90000009536743,"responseEnd":409.40000009536743,"responseStart":409.40000009536743,"secureConnectionStart":185.90000009536743},{"duration":223.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":409.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":223.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":186,"connectEnd":186,"connectStart":186,"domainLookupEnd":186,"domainLookupStart":186,"fetchStart":186,"redirectEnd":0,"redirectStart":0,"requestStart":186,"responseEnd":409.90000009536743,"responseStart":409.90000009536743,"secureConnectionStart":186},{"duration":224.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":186.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":186.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":410.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":224.2000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":186.19999980926514,"connectEnd":186.19999980926514,"connectStart":186.19999980926514,"domainLookupEnd":186.19999980926514,"domainLookupStart":186.19999980926514,"fetchStart":186.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":186.19999980926514,"responseEnd":410.40000009536743,"responseStart":410.40000009536743,"secureConnectionStart":186.19999980926514},{"duration":509.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":191.40000009536743,"connectEnd":191.40000009536743,"connectStart":191.40000009536743,"domainLookupEnd":191.40000009536743,"domainLookupStart":191.40000009536743,"fetchStart":191.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":191.40000009536743,"responseEnd":701,"responseStart":701,"secureConnectionStart":191.40000009536743},{"duration":542.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":191.5,"connectEnd":191.5,"connectStart":191.5,"domainLookupEnd":191.5,"domainLookupStart":191.5,"fetchStart":191.5,"redirectEnd":0,"redirectStart":0,"requestStart":191.5,"responseEnd":734.4000000953674,"responseStart":734.4000000953674,"secureConnectionStart":191.5},{"duration":164.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":539,"connectEnd":539,"connectStart":539,"domainLookupEnd":539,"domainLookupStart":539,"fetchStart":539,"redirectEnd":0,"redirectStart":0,"requestStart":539,"responseEnd":703.0999999046326,"responseStart":703.0999999046326,"secureConnectionStart":539},{"duration":34.09999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":706.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":706.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":740.1999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":30,"responseStart":180,"responseEnd":185,"domLoading":183,"domInteractive":911,"domContentLoadedEventStart":911,"domContentLoadedEventEnd":952,"domComplete":1183,"loadEventStart":1183,"loadEventEnd":1184,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":892.4000000953674},{"name":"bigPipe.sidebar-id.end","time":893.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":893.2999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":894.1999998092651},{"name":"activityTabFullyLoaded","time":965.1999998092651}],"measures":[],"correlationId":"a015a64604ad84","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":83,"dbReadsTimeInMs":16,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}