Type:
Task
Priority:
Critical
Resolution:
Fixed
Under terms of MDEV-21743 , we'll add new global privilege flags.
In order to help the server understand which version a privilege record was written by, let's add a new JSON field "version_id" in mysql.global_priv.priv.
So the following script:
GRANT FILE ON *.* TO user1@localhost;
SELECT Host, User , JSON_DETAILED(Priv) FROM mysql.global_priv WHERE user = 'user1' \G
returns about this output:
*************************** 1. row ***************************
Host: localhost
User: user1
JSON_DETAILED(Priv): {
"access": 512,
"plugin": "mysql_native_password",
"authentication_string": "",
"password_last_changed": 1581070979,
"version_id": 100502
}
1 row in set (0.001 sec)
Notice, the new "version_id" field in the JSON record.
The version id is needed to translate a set of bits to a set of privileges.
If the version_id JSON field is missing in a record, the server will consider that this record was created by MariaDB-10.5.1 or earlier.
As version_id is determined per record, records of different formats will co-exist in the same table without conflicts, so no mysql_upgrade execution will be needed to make the global_priv table up-to-date after upgrade to a new server version with new privilege bits defined.
If the version_id JSON field is missing in a record, the server will consider that this record was created by MariaDB-10.5.1 or earlier.
As version_id is determined per record, records of different formats will co-exist in the same table without conflicts, so no mysql_upgrade execution will be needed to make the global_priv table up-to-date after upgrade to a new server version with new privilege bits defined.
This change will also include:
Validation for the new "version_id" JSON field, to ignore records with obviously wrong version_id records.
Validation for the "access" JSON field, to ignore records when "access" has any bits set which are not known as of server version specified in version_od
Reporting ignored records to the server error log.
blocks
MDEV-21743
Split up SUPER privilege to smaller privileges
Closed
{"report":{"fcp":838,"ttfb":227.09999990463257,"pageVisibility":"visible","entityId":83143,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"27e85c26-460b-4902-8dcb-41a405f1a75a","navigationType":0,"readyForUser":916.3000001907349,"redirectCount":0,"resourceLoadedEnd":952,"resourceLoadedStart":233.2000002861023,"resourceTiming":[{"duration":61.09999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":233.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":233.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":294.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":61.19999980926514,"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":233.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":233.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":294.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":119.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":233.7000002861023,"connectEnd":233.7000002861023,"connectStart":233.7000002861023,"domainLookupEnd":233.7000002861023,"domainLookupStart":233.7000002861023,"fetchStart":233.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":233.7000002861023,"responseEnd":352.90000009536743,"responseStart":352.90000009536743,"secureConnectionStart":233.7000002861023},{"duration":185.69999980926514,"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":233.90000009536743,"connectEnd":233.90000009536743,"connectStart":233.90000009536743,"domainLookupEnd":233.90000009536743,"domainLookupStart":233.90000009536743,"fetchStart":233.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":233.90000009536743,"responseEnd":419.59999990463257,"responseStart":419.59999990463257,"secureConnectionStart":233.90000009536743},{"duration":190.09999990463257,"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":234,"connectEnd":234,"connectStart":234,"domainLookupEnd":234,"domainLookupStart":234,"fetchStart":234,"redirectEnd":0,"redirectStart":0,"requestStart":234,"responseEnd":424.09999990463257,"responseStart":424.09999990463257,"secureConnectionStart":234},{"duration":190.2999997138977,"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":234.2000002861023,"connectEnd":234.2000002861023,"connectStart":234.2000002861023,"domainLookupEnd":234.2000002861023,"domainLookupStart":234.2000002861023,"fetchStart":234.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":234.2000002861023,"responseEnd":424.5,"responseStart":424.5,"secureConnectionStart":234.2000002861023},{"duration":190.5,"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":234.40000009536743,"connectEnd":234.40000009536743,"connectStart":234.40000009536743,"domainLookupEnd":234.40000009536743,"domainLookupStart":234.40000009536743,"fetchStart":234.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":234.40000009536743,"responseEnd":424.90000009536743,"responseStart":424.90000009536743,"secureConnectionStart":234.40000009536743},{"duration":265.80000019073486,"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":234.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":500.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":190.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":234.80000019073486,"connectEnd":234.80000019073486,"connectStart":234.80000019073486,"domainLookupEnd":234.80000019073486,"domainLookupStart":234.80000019073486,"fetchStart":234.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":234.80000019073486,"responseEnd":425.40000009536743,"responseStart":425.40000009536743,"secureConnectionStart":234.80000019073486},{"duration":265.59999990463257,"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":235,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":235,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":500.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":190.80000019073486,"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":235.09999990463257,"connectEnd":235.09999990463257,"connectStart":235.09999990463257,"domainLookupEnd":235.09999990463257,"domainLookupStart":235.09999990463257,"fetchStart":235.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":235.09999990463257,"responseEnd":425.90000009536743,"responseStart":425.90000009536743,"secureConnectionStart":235.09999990463257},{"duration":333.09999990463257,"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":235.90000009536743,"connectEnd":235.90000009536743,"connectStart":235.90000009536743,"domainLookupEnd":235.90000009536743,"domainLookupStart":235.90000009536743,"fetchStart":235.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":235.90000009536743,"responseEnd":569,"responseStart":569,"secureConnectionStart":235.90000009536743},{"duration":485,"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":240.2000002861023,"connectEnd":240.2000002861023,"connectStart":240.2000002861023,"domainLookupEnd":240.2000002861023,"domainLookupStart":240.2000002861023,"fetchStart":240.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":240.2000002861023,"responseEnd":725.2000002861023,"responseStart":725.2000002861023,"secureConnectionStart":240.2000002861023},{"duration":60.89999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":512.7000002861023,"connectEnd":512.7000002861023,"connectStart":512.7000002861023,"domainLookupEnd":512.7000002861023,"domainLookupStart":512.7000002861023,"fetchStart":512.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":512.7000002861023,"responseEnd":573.5999999046326,"responseStart":573.5999999046326,"secureConnectionStart":512.7000002861023},{"duration":157.80000019073486,"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&whisper-enabled=true","startTime":785,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":785,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":942.8000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":159.09999990463257,"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&whisper-enabled=true","startTime":785.9000000953674,"connectEnd":785.9000000953674,"connectStart":785.9000000953674,"domainLookupEnd":785.9000000953674,"domainLookupStart":785.9000000953674,"fetchStart":785.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":785.9000000953674,"responseEnd":945,"responseStart":945,"secureConnectionStart":785.9000000953674},{"duration":165.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/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.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":786.3000001907349,"connectEnd":786.3000001907349,"connectStart":786.3000001907349,"domainLookupEnd":786.3000001907349,"domainLookupStart":786.3000001907349,"fetchStart":786.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":786.3000001907349,"responseEnd":952,"responseStart":952,"secureConnectionStart":786.3000001907349}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":70,"responseStart":227,"responseEnd":232,"domLoading":231,"domInteractive":1018,"domContentLoadedEventStart":1018,"domContentLoadedEventEnd":1069,"domComplete":1886,"loadEventStart":1886,"loadEventEnd":1888,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":986.4000000953674},{"name":"bigPipe.sidebar-id.end","time":987.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":987.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":989.9000000953674},{"name":"activityTabFullyLoaded","time":1096.5}],"measures":[],"correlationId":"d8a7aaf091dea3","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}