Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-16987

ALTER DATABASE possible in read-only mode

    Details

      Description

      Test user has all privileges but SUPER, and read-only is set.
      This gets detected correctly when trying to create a new database, or when trying to change the character set of an existing table:

      MariaDB [test]> create database test2;
      ERROR 1290 (HY000): The MariaDB server is running with the --read-only option so it cannot execute this statement
       
      MariaDB [test]> alter table t1 character set latin1;
      ERROR 1290 (HY000): The MariaDB server is running with the --read-only option so it cannot execute this statement
      

      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:

      MariaDB [test]> alter database test character set latin1;
      Query OK, 1 row affected (0.001 sec)
       
      MariaDB [test]> show create database test;
      +----------+-----------------------------------------------------------------+
      | Database | Create Database                                                 |
      +----------+-----------------------------------------------------------------+
      | test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ |
      +----------+-----------------------------------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> alter database test character set utf8;
      Query OK, 1 row affected (0.001 sec)
       
      MariaDB [test]> show create database test;
      +----------+---------------------------------------------------------------+
      | Database | Create Database                                               |
      +----------+---------------------------------------------------------------+
      | test     | CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET utf8 */ |
      +----------+---------------------------------------------------------------+
      1 row in set (0.000 sec)
      

        Attachments

          Activity

            People

            • Assignee:
              svoj Sergey Vojtovich
              Reporter:
              hholzgra Hartmut Holzgraefe
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: