[MDEV-16987] ALTER DATABASE possible in read-only mode Created: 2018-08-15 Updated: 2020-08-25 Resolved: 2018-12-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.1.34, 10.3.8, 10.2, 10.3 |
| Fix Version/s: | 10.4.1, 10.1.38, 5.5.63, 10.0.38, 10.2.20, 10.3.12 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Hartmut Holzgraefe | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream-fixed | ||
| Issue Links: |
|
||||
| Description |
|
Test user has all privileges but SUPER, and read-only is set.
Changing the default character set of an existing database is possible though, it does not raise any error, and the changes effect even though the MariaDB instance is in read-only mode:
|
| Comments |
| Comment by Elena Stepanova [ 2018-08-29 ] | |||||||||||||
|
Also reproducible on MySQL 5.5-5.7, but not on 8.0. | |||||||||||||
| Comment by Sergey Vojtovich [ 2018-12-11 ] | |||||||||||||
|
It is documented behaviour: https://mariadb.com/kb/en/library/server-system-variables/#read_only | |||||||||||||
| Comment by Hartmut Holzgraefe [ 2018-12-11 ] | |||||||||||||
|
Where do you see this documented in that KB section? It lists a few exceptions, but ALTER DATABASE is not among these as far as I can tell:
I especially can't see why CREATE DATABASE and ALTER TABLE are blocked by read_only, but ALTER DATABASE should be OK? | |||||||||||||
| Comment by Sergey Vojtovich [ 2018-12-11 ] | |||||||||||||
| |||||||||||||
| Comment by Hartmut Holzgraefe [ 2018-12-11 ] | |||||||||||||
|
While "no updates" may seem to imply DML only, all DDL operations are blocked, too. The only exception seems to be ALTER DATABASE. That's what the bug report is about: why this single DDL exception? PS: also please note that I wrote "Test user has all privileges but SUPER", not "Test user has SUPER privilege". | |||||||||||||
| Comment by Sergey Vojtovich [ 2018-12-12 ] | |||||||||||||
|
hholzgra, sorry, you're right. I misread your test cases. I wonder if ALTER DATABASE ... UPGRADE should be fixed as well? Fix itself is fairly simple:
| |||||||||||||
| Comment by Sergey Vojtovich [ 2018-12-12 ] | |||||||||||||
|
serg, could you review fix for this bug? | |||||||||||||
| Comment by Sergei Golubchik [ 2018-12-13 ] | |||||||||||||
|
ok to push. Although, I'd push it into an earlier version. 10.1 or even 5.5. | |||||||||||||
| Comment by Hartmut Holzgraefe [ 2018-12-17 ] | |||||||||||||
|
"I wonder if ALTER DATABASE ... UPGRADE should be fixed as well?" Maybe .. but on the other hand it does not perform any changes visible to the SQL layer, so it shouldn't really matter. I can't see a slave getting out of sync with its master due to this, so it is probably acceptable even with read_only=true |