-
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":751,"ttfb":224.29999995231628,"pageVisibility":"visible","entityId":79415,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"281d6f17-f3fe-495c-bbd2-eafdc6b4f31c","navigationType":0,"readyForUser":812,"redirectCount":0,"resourceLoadedEnd":574.8999999761581,"resourceLoadedStart":230.70000004768372,"resourceTiming":[{"duration":7.899999976158142,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":230.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":230.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":238.60000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":8.300000071525574,"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":230.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":230.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":239.20000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":81.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":231,"connectEnd":231,"connectStart":231,"domainLookupEnd":231,"domainLookupStart":231,"fetchStart":231,"redirectEnd":0,"redirectStart":0,"requestStart":241.20000004768372,"responseEnd":312.5,"responseStart":256.7999999523163,"secureConnectionStart":231},{"duration":122.19999992847443,"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":231.20000004768372,"connectEnd":231.20000004768372,"connectStart":231.20000004768372,"domainLookupEnd":231.20000004768372,"domainLookupStart":231.20000004768372,"fetchStart":231.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":241.70000004768372,"responseEnd":353.39999997615814,"responseStart":262.2999999523163,"secureConnectionStart":231.20000004768372},{"duration":25.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":231.29999995231628,"connectEnd":231.29999995231628,"connectStart":231.29999995231628,"domainLookupEnd":231.29999995231628,"domainLookupStart":231.29999995231628,"fetchStart":231.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":242.20000004768372,"responseEnd":256.7999999523163,"responseStart":254.89999997615814,"secureConnectionStart":231.29999995231628},{"duration":33.39999997615814,"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":231.5,"connectEnd":231.5,"connectStart":231.5,"domainLookupEnd":231.5,"domainLookupStart":231.5,"fetchStart":231.5,"redirectEnd":0,"redirectStart":0,"requestStart":243.29999995231628,"responseEnd":264.89999997615814,"responseStart":264.2999999523163,"secureConnectionStart":231.5},{"duration":37.89999997615814,"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":231.70000004768372,"connectEnd":231.70000004768372,"connectStart":231.70000004768372,"domainLookupEnd":231.70000004768372,"domainLookupStart":231.70000004768372,"fetchStart":231.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":244.10000002384186,"responseEnd":269.60000002384186,"responseStart":267.7000000476837,"secureConnectionStart":231.70000004768372},{"duration":11.899999976158142,"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":231.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":231.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":243.79999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":55.89999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":232,"connectEnd":232,"connectStart":232,"domainLookupEnd":232,"domainLookupStart":232,"fetchStart":232,"redirectEnd":0,"redirectStart":0,"requestStart":246.79999995231628,"responseEnd":287.89999997615814,"responseStart":286.60000002384186,"secureConnectionStart":232},{"duration":12.899999976158142,"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":232.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":232.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":245,"responseStart":0,"secureConnectionStart":0},{"duration":58.800000071525574,"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":232.29999995231628,"connectEnd":232.29999995231628,"connectStart":232.29999995231628,"domainLookupEnd":232.29999995231628,"domainLookupStart":232.29999995231628,"fetchStart":232.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":250.10000002384186,"responseEnd":291.10000002384186,"responseStart":289.7000000476837,"secureConnectionStart":232.29999995231628},{"duration":330.2999999523163,"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":244.60000002384186,"connectEnd":244.60000002384186,"connectStart":244.60000002384186,"domainLookupEnd":244.60000002384186,"domainLookupStart":244.60000002384186,"fetchStart":244.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":275.7000000476837,"responseEnd":574.8999999761581,"responseStart":568.8999999761581,"secureConnectionStart":244.60000002384186},{"duration":325.6999999284744,"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":247.60000002384186,"connectEnd":247.60000002384186,"connectStart":247.60000002384186,"domainLookupEnd":247.60000002384186,"domainLookupStart":247.60000002384186,"fetchStart":247.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":285.2000000476837,"responseEnd":573.2999999523163,"responseStart":564.7000000476837,"secureConnectionStart":247.60000002384186},{"duration":185.39999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":516.7000000476837,"connectEnd":516.7000000476837,"connectStart":516.7000000476837,"domainLookupEnd":516.7000000476837,"domainLookupStart":516.7000000476837,"fetchStart":516.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":665.1000000238419,"responseEnd":702.1000000238419,"responseStart":700.2000000476837,"secureConnectionStart":516.7000000476837}],"fetchStart":0,"domainLookupStart":29,"domainLookupEnd":31,"connectStart":32,"connectEnd":52,"secureConnectionStart":41,"requestStart":53,"responseStart":224,"responseEnd":247,"domLoading":229,"domInteractive":862,"domContentLoadedEventStart":862,"domContentLoadedEventEnd":896,"domComplete":1643,"loadEventStart":1643,"loadEventEnd":1644,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":848.2999999523163},{"name":"bigPipe.sidebar-id.end","time":849.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":849.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":849.8999999761581},{"name":"activityTabFullyLoaded","time":899.5}],"measures":[],"correlationId":"e8e437ce8ccfea","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":106,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}