• unknown's avatar
    Fix for bug #18897 "Events: unauthorized action possible with · d6cf50ca
    unknown authored
    alter event rename".
    
    ALTER EVENT ... RENAME statement hasn't checked privileges
    for the target database. It also caused server crashes when
    target database was not specified explicitly and there was
    no current database.
    
    This fix adds missing privilege check and check for the case
    when target database is not specified explicitly or implicitly.
    
    
    mysql-test/r/events_bugs.result:
      update result
    mysql-test/t/events_bugs.test:
      add test case for bug 18897 Events: unauthorized action possible with alter event
      rename:
      - test rename to db the user does not have access to
      - test rename when there is no selected db
    sql/sql_parse.cc:
      Additional check for the situation when no db is selected.
      CREATE EVENT abc and ALTER EVENT db.abc RENAME TO xyz,
      and DROP EVENT abc
      won't work if there is no selected DB.
    d6cf50ca
sql_parse.cc 225 KB