When moving from MySQL 5.7 to MariaDB 10.2, roles are not usable. This seems to persist, even if the MariaDB instance is further upgraded (first noticed on a production 10.3 server).
Steps I have taken to replicate this issue:
- Create fresh EC2 instance, running Ubuntu 18.04 LTS
- Run apt update / apt upgrade
- Install mysql-server (installs 5.7.30-0ubuntu0.18.04.1)
- Proceed through installation process accepting defaults, ensure once finished server has started
- Stop the server, uninstall the MySQL package, install the MariaDB package as per here
- Stop the server, start without grant tables, update root user to use 'unix_socket' instead of 'auth_socket' (via FLUSH PRIVILEGES; ALTER USER `root`@`localhost` IDENTIFIED VIA unix_socket;)
The below test script now shows roles don't work (on a straight MariaDB install, `is_role` would be 'Y' and the `SET ROLE` would work as expected:
MariaDB [(none)]> CREATE ROLE `aRole`;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [(none)]> SET ROLE `aRole`;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [(none)]> FLUSH PRIVILEGES;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [(none)]> SET ROLE `aRole`;
|
ERROR 1959 (OP000): Invalid role specification `aRole`
|
MariaDB [(none)]> SELECT `User`, `is_role` FROM `mysql`.`user`;
|
+------------------+---------+
|
| User | is_role |
|
+------------------+---------+
|
| root | N |
|
| mysql.session | N |
|
| mysql.sys | N |
|
| debian-sys-maint | N |
|
| aRole | N |
|
+------------------+---------+
|
5 rows in set (0.00 sec)
|
(Running the select prior to the FLUSH PRIVILEGES; has the same result)
{"report":{"fcp":1019.4000000953674,"ttfb":302.09999990463257,"pageVisibility":"visible","entityId":89656,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"36e8dfe8-9f50-48ec-950b-c17ae33bae47","navigationType":0,"readyForUser":1091.5999999046326,"redirectCount":0,"resourceLoadedEnd":1103.9000000953674,"resourceLoadedStart":308.09999990463257,"resourceTiming":[{"duration":134.20000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":308.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":308.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":442.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":134.69999980926514,"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":308.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":308.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":443.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":189.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":308.59999990463257,"connectEnd":308.59999990463257,"connectStart":308.59999990463257,"domainLookupEnd":308.59999990463257,"domainLookupStart":308.59999990463257,"fetchStart":308.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":308.59999990463257,"responseEnd":498.5,"responseStart":498.5,"secureConnectionStart":308.59999990463257},{"duration":251.20000004768372,"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":308.7000000476837,"connectEnd":308.7000000476837,"connectStart":308.7000000476837,"domainLookupEnd":308.7000000476837,"domainLookupStart":308.7000000476837,"fetchStart":308.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":308.7000000476837,"responseEnd":559.9000000953674,"responseStart":559.9000000953674,"secureConnectionStart":308.7000000476837},{"duration":255.20000004768372,"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":309,"connectEnd":309,"connectStart":309,"domainLookupEnd":309,"domainLookupStart":309,"fetchStart":309,"redirectEnd":0,"redirectStart":0,"requestStart":309,"responseEnd":564.2000000476837,"responseStart":564.2000000476837,"secureConnectionStart":309},{"duration":255.5,"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":309.2000000476837,"connectEnd":309.2000000476837,"connectStart":309.2000000476837,"domainLookupEnd":309.2000000476837,"domainLookupStart":309.2000000476837,"fetchStart":309.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":309.2000000476837,"responseEnd":564.7000000476837,"responseStart":564.7000000476837,"secureConnectionStart":309.2000000476837},{"duration":256.09999990463257,"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":309.40000009536743,"connectEnd":309.40000009536743,"connectStart":309.40000009536743,"domainLookupEnd":309.40000009536743,"domainLookupStart":309.40000009536743,"fetchStart":309.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":309.40000009536743,"responseEnd":565.5,"responseStart":565.5,"secureConnectionStart":309.40000009536743},{"duration":333.2000000476837,"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":309.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":309.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":642.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":256.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":309.7000000476837,"connectEnd":309.7000000476837,"connectStart":309.7000000476837,"domainLookupEnd":309.7000000476837,"domainLookupStart":309.7000000476837,"fetchStart":309.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":309.7000000476837,"responseEnd":566.4000000953674,"responseStart":566.4000000953674,"secureConnectionStart":309.7000000476837},{"duration":333,"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":309.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":309.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":642.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":257.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":310,"connectEnd":310,"connectStart":310,"domainLookupEnd":310,"domainLookupStart":310,"fetchStart":310,"redirectEnd":0,"redirectStart":0,"requestStart":310,"responseEnd":567.2000000476837,"responseStart":567.2000000476837,"secureConnectionStart":310},{"duration":700.2999999523163,"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":310.7999999523163,"connectEnd":310.7999999523163,"connectStart":310.7999999523163,"domainLookupEnd":310.7999999523163,"domainLookupStart":310.7999999523163,"fetchStart":310.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":310.7999999523163,"responseEnd":1011.0999999046326,"responseStart":1011.0999999046326,"secureConnectionStart":310.7999999523163},{"duration":701.2000000476837,"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":310.7999999523163,"connectEnd":310.7999999523163,"connectStart":310.7999999523163,"domainLookupEnd":310.7999999523163,"domainLookupStart":310.7999999523163,"fetchStart":310.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":310.7999999523163,"responseEnd":1012,"responseStart":1012,"secureConnectionStart":310.7999999523163},{"duration":101.29999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":658.7000000476837,"connectEnd":658.7000000476837,"connectStart":658.7000000476837,"domainLookupEnd":658.7000000476837,"domainLookupStart":658.7000000476837,"fetchStart":658.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":658.7000000476837,"responseEnd":760,"responseStart":760,"secureConnectionStart":658.7000000476837},{"duration":173,"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":930.9000000953674,"connectEnd":930.9000000953674,"connectStart":930.9000000953674,"domainLookupEnd":930.9000000953674,"domainLookupStart":930.9000000953674,"fetchStart":930.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":930.9000000953674,"responseEnd":1103.9000000953674,"responseStart":1103.9000000953674,"secureConnectionStart":930.9000000953674},{"duration":112.60000014305115,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1010.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1010.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1123.2000000476837,"responseStart":0,"secureConnectionStart":0}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":153,"responseStart":303,"responseEnd":305,"domLoading":306,"domInteractive":1151,"domContentLoadedEventStart":1151,"domContentLoadedEventEnd":1190,"domComplete":1602,"loadEventStart":1602,"loadEventEnd":1602,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1130},{"name":"bigPipe.sidebar-id.end","time":1130.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.start","time":1130.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1133.2000000476837},{"name":"activityTabFullyLoaded","time":1197.5999999046326}],"measures":[],"correlationId":"52a98ab8ca1228","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":91,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}