10.7.0 53b2c1f4664a3cb90f583979d9aa2771b7e1c98d (Debug) preview-10.7-MDEV-25015-sformat
|
10.7.0-dbg>SET @a=3.14;
|
Query OK, 0 rows affected (0.000 sec)
|
|
10.7.0-dbg>CREATE TABLE t1 SELECT @a;
|
Query OK, 1 row affected (0.019 sec)
|
Records: 1 Duplicates: 0 Warnings: 0
|
|
10.7.0-dbg>SHOW CREATE TABLE t1\G
|
*************************** 1. row ***************************
|
Table: t1
|
Create Table: CREATE TABLE `t1` (
|
`@a` decimal(65,38) DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
1 row in set (0.000 sec)
|
|
10.7.0-dbg>SELECT SFORMAT ('FLOAT {:.5f}',@a);
|
+-----------------------------+
|
| SFORMAT ('FLOAT {:.5f}',@a) |
|
+-----------------------------+
|
| NULL |
|
+-----------------------------+
|
1 row in set, 1 warning (0.000 sec)
|
|
10.7.0-dbg>SHOW WARNINGS;
|
+---------+------+---------------------------------------+
|
| Level | Code | Message |
|
+---------+------+---------------------------------------+
|
| Warning | 4183 | SFORMAT error: invalid type specifier |
|
+---------+------+---------------------------------------+
|
1 row in set (0.000 sec)
|
|
10.7.0-dbg>SELECT SFORMAT ('FLOAT {:.5f}',3.14);
|
+-------------------------------+
|
| SFORMAT ('FLOAT {:.5f}',3.14) |
|
+-------------------------------+
|
| FLOAT 3.14000 |
|
+-------------------------------+
|
1 row in set (0.000 sec)
|
- is caused by
-
MDEV-25015
Custom formatting of strings in MariaDB queries
-
-
Closed
{"report":{"fcp":908.5999999046326,"ttfb":245.79999995231628,"pageVisibility":"visible","entityId":102863,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"127e0dc4-921c-406d-a31b-4c4b1bd0eec9","navigationType":0,"readyForUser":987.6999999284744,"redirectCount":0,"resourceLoadedEnd":1037.7999999523163,"resourceLoadedStart":251.79999995231628,"resourceTiming":[{"duration":94.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":251.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":251.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":345.89999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":94.69999992847443,"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":252,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":252,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":346.6999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":149.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":252.19999992847443,"connectEnd":252.19999992847443,"connectStart":252.19999992847443,"domainLookupEnd":252.19999992847443,"domainLookupStart":252.19999992847443,"fetchStart":252.19999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":252.19999992847443,"responseEnd":401.2999999523163,"responseStart":401.2999999523163,"secureConnectionStart":252.19999992847443},{"duration":209.69999992847443,"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":252.39999997615814,"connectEnd":252.39999997615814,"connectStart":252.39999997615814,"domainLookupEnd":252.39999997615814,"domainLookupStart":252.39999997615814,"fetchStart":252.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":252.39999997615814,"responseEnd":462.09999990463257,"responseStart":462.09999990463257,"secureConnectionStart":252.39999997615814},{"duration":212.90000009536743,"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":252.59999990463257,"connectEnd":252.59999990463257,"connectStart":252.59999990463257,"domainLookupEnd":252.59999990463257,"domainLookupStart":252.59999990463257,"fetchStart":252.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":252.59999990463257,"responseEnd":465.5,"responseStart":465.5,"secureConnectionStart":252.59999990463257},{"duration":213.20000004768372,"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":252.69999992847443,"connectEnd":252.69999992847443,"connectStart":252.69999992847443,"domainLookupEnd":252.69999992847443,"domainLookupStart":252.69999992847443,"fetchStart":252.69999992847443,"redirectEnd":0,"redirectStart":0,"requestStart":252.69999992847443,"responseEnd":465.89999997615814,"responseStart":465.89999997615814,"secureConnectionStart":252.69999992847443},{"duration":213.39999997615814,"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":252.89999997615814,"connectEnd":252.89999997615814,"connectStart":252.89999997615814,"domainLookupEnd":252.89999997615814,"domainLookupStart":252.89999997615814,"fetchStart":252.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":252.89999997615814,"responseEnd":466.2999999523163,"responseStart":466.2999999523163,"secureConnectionStart":252.89999997615814},{"duration":291.40000009536743,"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":253.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":253.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":544.5,"responseStart":0,"secureConnectionStart":0},{"duration":213.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":253.29999995231628,"connectEnd":253.29999995231628,"connectStart":253.29999995231628,"domainLookupEnd":253.29999995231628,"domainLookupStart":253.29999995231628,"fetchStart":253.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":253.29999995231628,"responseEnd":466.6999999284744,"responseStart":466.6999999284744,"secureConnectionStart":253.29999995231628},{"duration":291.09999990463257,"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":253.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":253.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":544.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":213.60000002384186,"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":253.59999990463257,"connectEnd":253.59999990463257,"connectStart":253.59999990463257,"domainLookupEnd":253.59999990463257,"domainLookupStart":253.59999990463257,"fetchStart":253.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":253.59999990463257,"responseEnd":467.1999999284744,"responseStart":467.1999999284744,"secureConnectionStart":253.59999990463257},{"duration":453.09999990463257,"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":254.5,"connectEnd":254.5,"connectStart":254.5,"domainLookupEnd":254.5,"domainLookupStart":254.5,"fetchStart":254.5,"redirectEnd":0,"redirectStart":0,"requestStart":254.5,"responseEnd":707.5999999046326,"responseStart":707.5999999046326,"secureConnectionStart":254.5},{"duration":676.1999999284744,"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":254.5,"connectEnd":254.5,"connectStart":254.5,"domainLookupEnd":254.5,"domainLookupStart":254.5,"fetchStart":254.5,"redirectEnd":0,"redirectStart":0,"requestStart":254.5,"responseEnd":930.6999999284744,"responseStart":930.6999999284744,"secureConnectionStart":254.5},{"duration":159,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":556.0999999046326,"connectEnd":556.0999999046326,"connectStart":556.0999999046326,"domainLookupEnd":556.0999999046326,"domainLookupStart":556.0999999046326,"fetchStart":556.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":556.0999999046326,"responseEnd":715.0999999046326,"responseStart":715.0999999046326,"secureConnectionStart":556.0999999046326},{"duration":225,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&slack-enabled=true","startTime":812.7999999523163,"connectEnd":812.7999999523163,"connectStart":812.7999999523163,"domainLookupEnd":812.7999999523163,"domainLookupStart":812.7999999523163,"fetchStart":812.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":812.7999999523163,"responseEnd":1037.7999999523163,"responseStart":1037.7999999523163,"secureConnectionStart":812.7999999523163},{"duration":191.70000004768372,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":901.6999999284744,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":901.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1093.3999999761581,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":79,"responseStart":246,"responseEnd":248,"domLoading":249,"domInteractive":1044,"domContentLoadedEventStart":1044,"domContentLoadedEventEnd":1088,"domComplete":1344,"loadEventStart":1344,"loadEventEnd":1344,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1027.5},{"name":"bigPipe.sidebar-id.end","time":1028.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":1028.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1030.3999999761581},{"name":"activityTabFullyLoaded","time":1110.0999999046326}],"measures":[],"correlationId":"532f4af1d7c900","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":12,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
please, take a look at the commit
commit e800625d80c
Author: Sergei Golubchik <serg@mariadb.org>
Date: Sat Oct 9 16:00:13 2021 +0200
MDEV-26646 SFORMAT Does not allow @variable use
If charset aggregation decides to convert arguments to some specific
charset and some arguments are numbers, they'll be wrapped into a
Item_func_conv_charset(), that changes result_type() to STRING_RESULT.
Fix: don't convert numbers, sformat needs their numerical value only.
I'm particularly interested in alternative approaches, e.g. pass a flag MY_COLL_SKIP_NUMBERS. Or just always skip numbers everywhere unconditionally.