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.
{"report":{"fcp":653.7999999523163,"ttfb":176,"pageVisibility":"visible","entityId":76818,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"ddc5b774-3d92-4764-89ba-204e8bcae9b1","navigationType":0,"readyForUser":727,"redirectCount":0,"resourceLoadedEnd":846.7999999523163,"resourceLoadedStart":181.29999995231628,"resourceTiming":[{"duration":7.300000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":181.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":181.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":188.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":7.5,"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":181.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":181.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":189.20000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":62.700000047683716,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":181.70000004768372,"connectEnd":181.70000004768372,"connectStart":181.70000004768372,"domainLookupEnd":181.70000004768372,"domainLookupStart":181.70000004768372,"fetchStart":181.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":181.70000004768372,"responseEnd":244.40000009536743,"responseStart":244.40000009536743,"secureConnectionStart":181.70000004768372},{"duration":127.90000009536743,"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":181.79999995231628,"connectEnd":181.79999995231628,"connectStart":181.79999995231628,"domainLookupEnd":181.79999995231628,"domainLookupStart":181.79999995231628,"fetchStart":181.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":181.79999995231628,"responseEnd":309.7000000476837,"responseStart":309.7000000476837,"secureConnectionStart":181.79999995231628},{"duration":131.60000014305115,"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":182,"connectEnd":182,"connectStart":182,"domainLookupEnd":182,"domainLookupStart":182,"fetchStart":182,"redirectEnd":0,"redirectStart":0,"requestStart":182,"responseEnd":313.60000014305115,"responseStart":313.60000014305115,"secureConnectionStart":182},{"duration":133.19999980926514,"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":182.10000014305115,"connectEnd":182.10000014305115,"connectStart":182.10000014305115,"domainLookupEnd":182.10000014305115,"domainLookupStart":182.10000014305115,"fetchStart":182.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":182.10000014305115,"responseEnd":315.2999999523163,"responseStart":315.2999999523163,"secureConnectionStart":182.10000014305115},{"duration":134.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":182.20000004768372,"connectEnd":182.20000004768372,"connectStart":182.20000004768372,"domainLookupEnd":182.20000004768372,"domainLookupStart":182.20000004768372,"fetchStart":182.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":182.20000004768372,"responseEnd":316.7000000476837,"responseStart":316.7000000476837,"secureConnectionStart":182.20000004768372},{"duration":135.60000014305115,"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":182.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":182.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":317.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":135.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":182.5,"connectEnd":182.5,"connectStart":182.5,"domainLookupEnd":182.5,"domainLookupStart":182.5,"fetchStart":182.5,"redirectEnd":0,"redirectStart":0,"requestStart":182.5,"responseEnd":318,"responseStart":318,"secureConnectionStart":182.5},{"duration":136.79999995231628,"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":182.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":182.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":319.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":136.70000004768372,"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":182.70000004768372,"connectEnd":182.70000004768372,"connectStart":182.70000004768372,"domainLookupEnd":182.70000004768372,"domainLookupStart":182.70000004768372,"fetchStart":182.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":182.70000004768372,"responseEnd":319.40000009536743,"responseStart":319.40000009536743,"secureConnectionStart":182.70000004768372},{"duration":604.5,"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":188.79999995231628,"connectEnd":188.79999995231628,"connectStart":188.79999995231628,"domainLookupEnd":188.79999995231628,"domainLookupStart":188.79999995231628,"fetchStart":188.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":188.79999995231628,"responseEnd":793.2999999523163,"responseStart":793.2999999523163,"secureConnectionStart":188.79999995231628},{"duration":611.3000001907349,"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":188.79999995231628,"connectEnd":188.79999995231628,"connectStart":188.79999995231628,"domainLookupEnd":188.79999995231628,"domainLookupStart":188.79999995231628,"fetchStart":188.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":188.79999995231628,"responseEnd":800.1000001430511,"responseStart":800.1000001430511,"secureConnectionStart":188.79999995231628},{"duration":337.2000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":459,"connectEnd":459,"connectStart":459,"domainLookupEnd":459,"domainLookupStart":459,"fetchStart":459,"redirectEnd":0,"redirectStart":0,"requestStart":459,"responseEnd":796.2000000476837,"responseStart":796.2000000476837,"secureConnectionStart":459},{"duration":169.30000019073486,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":632.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":632.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":801.6000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":34.09999990463257,"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":812.7000000476837,"connectEnd":812.7000000476837,"connectStart":812.7000000476837,"domainLookupEnd":812.7000000476837,"domainLookupStart":812.7000000476837,"fetchStart":812.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":812.7000000476837,"responseEnd":846.7999999523163,"responseStart":846.7999999523163,"secureConnectionStart":812.7000000476837}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":26,"responseStart":176,"responseEnd":185,"domLoading":180,"domInteractive":880,"domContentLoadedEventStart":880,"domContentLoadedEventEnd":918,"domComplete":1558,"loadEventStart":1558,"loadEventEnd":1559,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":856.2999999523163},{"name":"bigPipe.sidebar-id.end","time":857.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":857.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":859.7999999523163},{"name":"activityTabFullyLoaded","time":926.2999999523163}],"measures":[],"correlationId":"88ec7e83a5aaee","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":87,"dbReadsTimeInMs":19,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}