-
Task
-
-
Major
-
Resolution:
Fixed
-
-
-
This change was suggested by Serg during the review of MDEV-20016.
Let's implement sql_type() in abstract classes as much as possible. It will reduce the amout of the code:
- in the built-in Field_xxx classes
- in the future plugin Field_xxx classes
Note, this task is limited to Field_real and Field_int only. Other classes will be changed the same way later.
Let's remove sql_type() implementations from:
- Field_tiny
- Field_short
- Field_medium
- Field_long
- Field_longlong
- Field_float
- Field_double
The inherited implementations will work for these classes. The exact data type name will be taken from the Type_handler.
The implementation for the abstract classes will look like:
void Field_int::sql_type(String &res) const
|
{
|
CHARSET_INFO *cs=res.charset();
|
Name name= type_handler()->type_handler_signed()->name();
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
"%.*s(%d)", (int) name.length(), name.ptr(),
|
(int) field_length));
|
add_zerofill_and_unsigned(res);
|
}
|
void Field_real::sql_type(String &res) const
|
{
|
const Name name= type_handler()->name();
|
if (dec >= FLOATING_POINT_DECIMALS)
|
{
|
res.set_ascii(name.ptr(), name.length());
|
}
|
else
|
{
|
CHARSET_INFO *cs= res.charset();
|
res.length(cs->cset->snprintf(cs,(char*) res.ptr(),res.alloced_length(),
|
"%.*s(%d,%d)", (int) name.length(), name.ptr(),
|
(int) field_length,dec));
|
}
|
add_zerofill_and_unsigned(res);
|
}
|
There are no comments yet on this issue.
{"report":{"fcp":1096.7999997138977,"ttfb":300.8999996185303,"pageVisibility":"visible","entityId":79415,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"dde8bd63-b945-4d12-9f8d-5df15f551c3f","navigationType":0,"readyForUser":1183.5999999046326,"redirectCount":0,"resourceLoadedEnd":792.3999996185303,"resourceLoadedStart":319.19999980926514,"resourceTiming":[{"duration":133.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":319.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":319.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":452.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":134,"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":319.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":319.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":453.5,"responseStart":0,"secureConnectionStart":0},{"duration":300,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":319.7999997138977,"connectEnd":319.7999997138977,"connectStart":319.7999997138977,"domainLookupEnd":319.7999997138977,"domainLookupStart":319.7999997138977,"fetchStart":319.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":457.8999996185303,"responseEnd":619.7999997138977,"responseStart":475.59999990463257,"secureConnectionStart":319.7999997138977},{"duration":472,"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":320.3999996185303,"connectEnd":320.3999996185303,"connectStart":320.3999996185303,"domainLookupEnd":320.3999996185303,"domainLookupStart":320.3999996185303,"fetchStart":320.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":468.09999990463257,"responseEnd":792.3999996185303,"responseStart":481,"secureConnectionStart":320.3999996185303},{"duration":164.5,"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":320.5,"connectEnd":320.5,"connectStart":320.5,"domainLookupEnd":320.5,"domainLookupStart":320.5,"fetchStart":320.5,"redirectEnd":0,"redirectStart":0,"requestStart":468.2999997138977,"responseEnd":485,"responseStart":483.69999980926514,"secureConnectionStart":320.5},{"duration":166,"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":320.69999980926514,"connectEnd":320.69999980926514,"connectStart":320.69999980926514,"domainLookupEnd":320.69999980926514,"domainLookupStart":320.69999980926514,"fetchStart":320.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":469.19999980926514,"responseEnd":486.69999980926514,"responseStart":485.19999980926514,"secureConnectionStart":320.69999980926514},{"duration":167.59999990463257,"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":320.7999997138977,"connectEnd":320.7999997138977,"connectStart":320.7999997138977,"domainLookupEnd":320.7999997138977,"domainLookupStart":320.7999997138977,"fetchStart":320.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":470.59999990463257,"responseEnd":488.3999996185303,"responseStart":487,"secureConnectionStart":320.7999997138977},{"duration":147.5,"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":321,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":321,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":468.5,"responseStart":0,"secureConnectionStart":0},{"duration":169,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":321.19999980926514,"connectEnd":321.19999980926514,"connectStart":321.19999980926514,"domainLookupEnd":321.19999980926514,"domainLookupStart":321.19999980926514,"fetchStart":321.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":471.5,"responseEnd":490.19999980926514,"responseStart":488.8999996185303,"secureConnectionStart":321.19999980926514},{"duration":149.7000002861023,"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":321.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":321.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":471.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":174.5,"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":321.5,"connectEnd":321.5,"connectStart":321.5,"domainLookupEnd":321.5,"domainLookupStart":321.5,"fetchStart":321.5,"redirectEnd":0,"redirectStart":0,"requestStart":482.5,"responseEnd":496,"responseStart":495.09999990463257,"secureConnectionStart":321.5},{"duration":463.1000003814697,"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":326.3999996185303,"connectEnd":326.3999996185303,"connectStart":326.3999996185303,"domainLookupEnd":326.3999996185303,"domainLookupStart":326.3999996185303,"fetchStart":326.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":607,"responseEnd":789.5,"responseStart":784.1999998092651,"secureConnectionStart":326.3999996185303},{"duration":464.69999980926514,"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":326.5,"connectEnd":326.5,"connectStart":326.5,"domainLookupEnd":326.5,"domainLookupStart":326.5,"fetchStart":326.5,"redirectEnd":0,"redirectStart":0,"requestStart":774.0999999046326,"responseEnd":791.1999998092651,"responseStart":788.3999996185303,"secureConnectionStart":326.5},{"duration":171.89999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":752.5,"connectEnd":752.5,"connectStart":752.5,"domainLookupEnd":752.5,"domainLookupStart":752.5,"fetchStart":752.5,"redirectEnd":0,"redirectStart":0,"requestStart":892,"responseEnd":924.3999996185303,"responseStart":922.5999999046326,"secureConnectionStart":752.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":131,"responseStart":301,"responseEnd":325,"domLoading":305,"domInteractive":1278,"domContentLoadedEventStart":1278,"domContentLoadedEventEnd":1326,"domComplete":2104,"loadEventStart":2104,"loadEventEnd":2104,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1260.7999997138977},{"name":"bigPipe.sidebar-id.end","time":1261.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.start","time":1261.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.end","time":1262.3999996185303},{"name":"activityTabFullyLoaded","time":1338.3999996185303}],"measures":[],"correlationId":"fc442698a6b2ba","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":92,"dbReadsTimeInMs":12,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}