Type:
Task
Priority:
Major
Resolution:
Fixed
ST_FIELD_INFO is used to define INFORMATION_SCHEMA columns. A typical INFORMATION_SCHEMA table definition looks like this:
ST_FIELD_INFO schema_fields_info[]=
{
{ "CATALOG_NAME" , FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{ "SCHEMA_NAME" , NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 0, "Database" ,
SKIP_OPEN_TABLE},
{ "DEFAULT_CHARACTER_SET_NAME" , MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, 0,
SKIP_OPEN_TABLE},
{ "DEFAULT_COLLATION_NAME" , MY_CS_NAME_SIZE, MYSQL_TYPE_STRING, 0, 0, 0,
SKIP_OPEN_TABLE},
{ "SQL_PATH" , FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{ "SCHEMA_COMMENT" , DATABASE_COMMENT_MAXLEN, MYSQL_TYPE_STRING, 0, 0, 0,
SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
It has two problems:
It's not friently for user plugins, which may want to create INFORMATION_SCHEMA tables with their own data types.
When a Field is created inside Type_handler_xxx::make_schema_field(), strlen() is called for ST_FIELD_INFO::field_name , for every column, every time an INFORMATION_SCHEMA query is done. This is not performance wise.
To solve these problems let do the following:
Add a namespace Show
Add a helper class Show::Column
Add a number of Show classes for various data types, with this hierarchy:
Type
Blob
Varchar
Yesno
Catalog
Name
Definer
Userhost
CSName
SQLMode
Longtext
Datetime
Decimal
ULonglong
ULong
SLonglong
SLong
SShort
STiny
Double
This will hide internal implementation details of ST_FIELD_INFO from the upper level code. An INFORMATION_SCHEMA table definition will look like this:
namespace Show {
ST_FIELD_INFO schema_fields_info[]=
{
Column( "CATALOG_NAME" , Catalog(), NOT_NULL),
Column( "SCHEMA_NAME" , Name(), NOT_NULL, "Database" ),
Column( "DEFAULT_CHARACTER_SET_NAME" , CSName(), NOT_NULL),
Column( "DEFAULT_COLLATION_NAME" , CSName(), NOT_NULL),
Column( "SQL_PATH" , Str(FN_REFLEN), NULLABLE),
Column( "SCHEMA_COMMENT" , Str(DATABASE_COMMENT_MAXLEN), NOT_NULL),
CEnd()
};
...
} // namespace Show
This task covers the code in /sql and /plugins .
As the next step, in separate patchs, we'll do the following:
Fix the code in /storage to use the new classes instead of direct ST_FIELD_INFO initialization.
In ST_FIELD_INFO , replace enum_field_types field_type to const Type_handler *handler .
In ST_FIELD_INFO , replace const char *field_name to LEX_CSTRING field_name .
which will solve the two mentioned problems.
There are no comments yet on this issue.
{"report":{"fcp":965.0999999046326,"ttfb":280.90000009536743,"pageVisibility":"visible","entityId":76818,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"ae107cfd-6697-4c1f-88a4-bd0d40c299fc","navigationType":0,"readyForUser":1058.5,"redirectCount":0,"resourceLoadedEnd":871.7999999523163,"resourceLoadedStart":287.7000000476837,"resourceTiming":[{"duration":208.20000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":287.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":287.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":495.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":208.20000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":288,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":288,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":496.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":217.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":288.2000000476837,"connectEnd":288.2000000476837,"connectStart":288.2000000476837,"domainLookupEnd":288.2000000476837,"domainLookupStart":288.2000000476837,"fetchStart":288.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":288.2000000476837,"responseEnd":505.7000000476837,"responseStart":505.7000000476837,"secureConnectionStart":288.2000000476837},{"duration":304.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":288.40000009536743,"connectEnd":288.40000009536743,"connectStart":288.40000009536743,"domainLookupEnd":288.40000009536743,"domainLookupStart":288.40000009536743,"fetchStart":288.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":288.40000009536743,"responseEnd":593.2999999523163,"responseStart":593.2999999523163,"secureConnectionStart":288.40000009536743},{"duration":308.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":288.59999990463257,"connectEnd":288.59999990463257,"connectStart":288.59999990463257,"domainLookupEnd":288.59999990463257,"domainLookupStart":288.59999990463257,"fetchStart":288.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":288.59999990463257,"responseEnd":597.4000000953674,"responseStart":597.4000000953674,"secureConnectionStart":288.59999990463257},{"duration":309,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":288.90000009536743,"connectEnd":288.90000009536743,"connectStart":288.90000009536743,"domainLookupEnd":288.90000009536743,"domainLookupStart":288.90000009536743,"fetchStart":288.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":288.90000009536743,"responseEnd":597.9000000953674,"responseStart":597.9000000953674,"secureConnectionStart":288.90000009536743},{"duration":309.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":289,"connectEnd":289,"connectStart":289,"domainLookupEnd":289,"domainLookupStart":289,"fetchStart":289,"redirectEnd":0,"redirectStart":0,"requestStart":289,"responseEnd":598.2999999523163,"responseStart":598.2999999523163,"secureConnectionStart":289},{"duration":359.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":289.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":289.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":648.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":309.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":289.40000009536743,"connectEnd":289.40000009536743,"connectStart":289.40000009536743,"domainLookupEnd":289.40000009536743,"domainLookupStart":289.40000009536743,"fetchStart":289.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":289.40000009536743,"responseEnd":599,"responseStart":599,"secureConnectionStart":289.40000009536743},{"duration":358.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":289.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":289.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":648.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":309.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":289.7000000476837,"connectEnd":289.7000000476837,"connectStart":289.7000000476837,"domainLookupEnd":289.7000000476837,"domainLookupStart":289.7000000476837,"fetchStart":289.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":289.7000000476837,"responseEnd":599.5999999046326,"responseStart":599.5999999046326,"secureConnectionStart":289.7000000476837},{"duration":426,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":291,"connectEnd":291,"connectStart":291,"domainLookupEnd":291,"domainLookupStart":291,"fetchStart":291,"redirectEnd":0,"redirectStart":0,"requestStart":291,"responseEnd":717,"responseStart":717,"secureConnectionStart":291},{"duration":580.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":291,"connectEnd":291,"connectStart":291,"domainLookupEnd":291,"domainLookupStart":291,"fetchStart":291,"redirectEnd":0,"redirectStart":0,"requestStart":291,"responseEnd":871.7999999523163,"responseStart":871.7999999523163,"secureConnectionStart":291},{"duration":94,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":676.2999999523163,"connectEnd":676.2999999523163,"connectStart":676.2999999523163,"domainLookupEnd":676.2999999523163,"domainLookupStart":676.2999999523163,"fetchStart":676.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":676.2999999523163,"responseEnd":770.2999999523163,"responseStart":770.2999999523163,"secureConnectionStart":676.2999999523163},{"duration":287.89999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/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&whisper-enabled=true","startTime":919.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":919.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1207.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":280.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/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&whisper-enabled=true","startTime":920.2999999523163,"connectEnd":920.2999999523163,"connectStart":920.2999999523163,"domainLookupEnd":920.2999999523163,"domainLookupStart":920.2999999523163,"fetchStart":920.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":920.2999999523163,"responseEnd":1201,"responseStart":1201,"secureConnectionStart":920.2999999523163},{"duration":286.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/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&whisper-enabled=true","startTime":920.7000000476837,"connectEnd":920.7000000476837,"connectStart":920.7000000476837,"domainLookupEnd":920.7000000476837,"domainLookupStart":920.7000000476837,"fetchStart":920.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":920.7000000476837,"responseEnd":1207.4000000953674,"responseStart":1207.4000000953674,"secureConnectionStart":920.7000000476837}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":103,"responseStart":281,"responseEnd":283,"domLoading":285,"domInteractive":1118,"domContentLoadedEventStart":1118,"domContentLoadedEventEnd":1167,"domComplete":1487,"loadEventStart":1487,"loadEventEnd":1488,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1100.7999999523163},{"name":"bigPipe.sidebar-id.end","time":1101.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1101.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1102.2999999523163},{"name":"activityTabFullyLoaded","time":1217.0999999046326}],"measures":[],"correlationId":"b8ed18bef5df1f","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":112,"dbReadsTimeInMs":16,"dbConnsTimeInMs":26,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}