While this functions can be implemented as user SQL functions, they have become native on MySQL 8.0.16. They are simple and independent enough that backport them should be easy.
Implementing them on MariaDB would allow:
Better compatibility with sys/performance_schema
Nice functions to have natively in any case for formatting reasons or even as a virtual column
Better MySQL compatibility, and avoiding user pain when migrating from MySQL from 8.0.16+
Better performance by being C rather than user functions/SQL
In MySQL all native functions are defined in file item_pfs_func.h, where source code declaration is item_pfs_func.cc . Definition of native functions format_pico_time for example is item_create.cc
Commit and author that introduced native function is
commit 260e09ea654a9688f588c13f5303bcc34dfc4a7d
Author: Christopher Powers <chris.powers@oracle.com>
Abdelrahman
added a comment - Is any one working on "Create native function for format_bytes" ? I would like to start working on it.
I found out that "format_bytes" is deprecated according to this https://dev.mysql.com/doc/refman/8.0/en/sys-format-bytes.html , and there's a new version https://dev.mysql.com/doc/refman/8.0/en/performance-schema-functions.html#function_format-bytes , which one should I work on ? the difference is minimal anyways and it would be easy to implement.
@Abdelrahman please note that what's deprecated is the sys stored procedure, precisely because they exist in MySQL as built-in functions (and why this was filed). The latter version is what's asked.
I would ask Anel first before taking it, as they started working on one of the subtasks.
Jaime Crespo
added a comment - @Abdelrahman please note that what's deprecated is the sys stored procedure, precisely because they exist in MySQL as built-in functions (and why this was filed). The latter version is what's asked.
I would ask Anel first before taking it, as they started working on one of the subtasks.
People
Unassigned
Jaime Crespo
Votes:
1Vote for this issue
Watchers:
7Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1064.7999999523163,"ttfb":324.89999985694885,"pageVisibility":"visible","entityId":76398,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"caa8def1-ab91-4864-a071-4db6ad18f2bc","navigationType":0,"readyForUser":1164.2999999523163,"redirectCount":0,"resourceLoadedEnd":1213.3999998569489,"resourceLoadedStart":330.59999990463257,"resourceTiming":[{"duration":180.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":330.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":330.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":511,"responseStart":0,"secureConnectionStart":0},{"duration":180.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":330.89999985694885,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":330.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":511.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":205.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":331.09999990463257,"connectEnd":331.09999990463257,"connectStart":331.09999990463257,"domainLookupEnd":331.09999990463257,"domainLookupStart":331.09999990463257,"fetchStart":331.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":331.09999990463257,"responseEnd":536.5,"responseStart":536.5,"secureConnectionStart":331.09999990463257},{"duration":295.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":331.2999999523163,"connectEnd":331.2999999523163,"connectStart":331.2999999523163,"domainLookupEnd":331.2999999523163,"domainLookupStart":331.2999999523163,"fetchStart":331.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":331.2999999523163,"responseEnd":626.7999999523163,"responseStart":626.7999999523163,"secureConnectionStart":331.2999999523163},{"duration":299.39999985694885,"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":331.5,"connectEnd":331.5,"connectStart":331.5,"domainLookupEnd":331.5,"domainLookupStart":331.5,"fetchStart":331.5,"redirectEnd":0,"redirectStart":0,"requestStart":331.5,"responseEnd":630.8999998569489,"responseStart":630.8999998569489,"secureConnectionStart":331.5},{"duration":299.59999990463257,"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":331.7000000476837,"connectEnd":331.7000000476837,"connectStart":331.7000000476837,"domainLookupEnd":331.7000000476837,"domainLookupStart":331.7000000476837,"fetchStart":331.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":331.7000000476837,"responseEnd":631.2999999523163,"responseStart":631.2999999523163,"secureConnectionStart":331.7000000476837},{"duration":299.80000019073486,"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":331.89999985694885,"connectEnd":331.89999985694885,"connectStart":331.89999985694885,"domainLookupEnd":331.89999985694885,"domainLookupStart":331.89999985694885,"fetchStart":331.89999985694885,"redirectEnd":0,"redirectStart":0,"requestStart":331.89999985694885,"responseEnd":631.7000000476837,"responseStart":631.7000000476837,"secureConnectionStart":331.89999985694885},{"duration":350.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":332.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":332.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":682.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":299.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":332.2999999523163,"connectEnd":332.2999999523163,"connectStart":332.2999999523163,"domainLookupEnd":332.2999999523163,"domainLookupStart":332.2999999523163,"fetchStart":332.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":332.2999999523163,"responseEnd":632.2000000476837,"responseStart":632.2000000476837,"secureConnectionStart":332.2999999523163},{"duration":350.2999999523163,"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":332.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":332.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":682.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":300.2000000476837,"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":332.59999990463257,"connectEnd":332.59999990463257,"connectStart":332.59999990463257,"domainLookupEnd":332.59999990463257,"domainLookupStart":332.59999990463257,"fetchStart":332.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":332.59999990463257,"responseEnd":632.7999999523163,"responseStart":632.7999999523163,"secureConnectionStart":332.59999990463257},{"duration":789.4000000953674,"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":339.09999990463257,"connectEnd":339.09999990463257,"connectStart":339.09999990463257,"domainLookupEnd":339.09999990463257,"domainLookupStart":339.09999990463257,"fetchStart":339.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":339.09999990463257,"responseEnd":1128.5,"responseStart":1128.5,"secureConnectionStart":339.09999990463257},{"duration":789.9000000953674,"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":339.2999999523163,"connectEnd":339.2999999523163,"connectStart":339.2999999523163,"domainLookupEnd":339.2999999523163,"domainLookupStart":339.2999999523163,"fetchStart":339.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":339.2999999523163,"responseEnd":1129.2000000476837,"responseStart":1129.2000000476837,"secureConnectionStart":339.2999999523163},{"duration":249.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":696,"connectEnd":696,"connectStart":696,"domainLookupEnd":696,"domainLookupStart":696,"fetchStart":696,"redirectEnd":0,"redirectStart":0,"requestStart":696,"responseEnd":945.5,"responseStart":945.5,"secureConnectionStart":696},{"duration":255.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","startTime":957.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":957.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1213.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":375.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","startTime":958.7999999523163,"connectEnd":958.7999999523163,"connectStart":958.7999999523163,"domainLookupEnd":958.7999999523163,"domainLookupStart":958.7999999523163,"fetchStart":958.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":958.7999999523163,"responseEnd":1334.5,"responseStart":1334.5,"secureConnectionStart":958.7999999523163}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":140,"responseStart":325,"responseEnd":338,"domLoading":329,"domInteractive":1256,"domContentLoadedEventStart":1256,"domContentLoadedEventEnd":1321,"domComplete":1634,"loadEventStart":1634,"loadEventEnd":1634,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1232.2999999523163},{"name":"bigPipe.sidebar-id.end","time":1233},{"name":"bigPipe.activity-panel-pipe-id.start","time":1233.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1234.2999999523163},{"name":"activityTabFullyLoaded","time":1336.5999999046326}],"measures":[],"correlationId":"2b0ee4dbedaa36","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":116,"dbReadsTimeInMs":16,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Is any one working on "Create native function for format_bytes" ? I would like to start working on it.
I found out that "format_bytes" is deprecated according to this https://dev.mysql.com/doc/refman/8.0/en/sys-format-bytes.html , and there's a new version https://dev.mysql.com/doc/refman/8.0/en/performance-schema-functions.html#function_format-bytes , which one should I work on ? the difference is minimal anyways and it would be easy to implement.