• Nisha Gopalakrishnan's avatar
    BUG#25250768: WRITING ON A READ_ONLY=ON SERVER WITHOUT SUPER · 3c6c0ebc
    Nisha Gopalakrishnan authored
                  PRIVILEGE.
    
    Backport from mysql-5.7 to mysql-5.5 and mysql-5.6.
    
    BUG#13969578: TEMPORARY TABLE IN A DATABASE ON A READ-ONLY
                      INSTANCE CAN BE OVERWRITTEN
    
    Analysis:
    ========
    
    Creation or modification of a persistent table by a non-super user
    is NOT ALLOWED in read_only mode. Only TEMPORARY tables are allowed
    to be created or modified in read_only mode. But the creation of
    a persistent table was being allowed when a temporary table of
    the same name existed.
    
    The routine which denies updating a non-temporary table in a
    read_only mode does not handle the case of creation of a regular
    table when a temporary table of the same exists.
    
    Fix:
    ===
    Handled the condition where an attempt is made to create a persistent
    table having the same name as that of the temporary table. Hence
    the creation of a persistent table by a non-super user when a
    temporary table of the same exists is denied under read_only mode.
    3c6c0ebc
sql_parse.cc 235 KB