• unknown's avatar
    Bug #27440 read_only allows create and drop database · 5826a5c4
    unknown authored
    When read_only option was enabled, a user without SUPER privilege could
    perform CREATE DATABASE and DROP DATABASE operations.
    
    This patch adds a check to make sure this isn't possible. It also attempts to 
    simplify the logic used to determine if relevant tables are updated,
    making it more human readable.
    
    
    mysql-test/r/read_only.result:
      Updated result file
    mysql-test/t/read_only.test:
      A test case is added which shows that it is not possible to drop or create a
      database in read-only mode despite having the GRANT permissions to do so,
      SUPER user excepted.
    sql/sql_parse.cc:
      - Simplified complex predicate by grouping it in a read friendly way.
      - Added predicate to fail on database updates while running in read-only
        mode.
    5826a5c4
read_only.test 3.61 KB