• Dmitry Shulga's avatar
    Fixed bug#11764334 (formerly bug#57156): ALTER EVENT CHANGES · fa913a0b
    Dmitry Shulga authored
    THE EVENT STATUS.
    
    Any ALTER EVENT statement on a disabled event enabled it back
    (unless this ALTER EVENT statement explicitly disabled the event).
    
    The problem was that during processing of an ALTER EVENT statement
    value of status field was overwritten unconditionally even if new
    value was not specified explicitly. As a consequence this field
    was set to default value for status which corresponds to ENABLE.
    
    The solution is to check if status field was explicitly specified in
    ALTER EVENT statement before assigning new value to status field.
    
    mysql-test/r/events_bugs.result:
      test's result for Bug#11764334 was added.
    mysql-test/t/events_bugs.test:
      new test for Bug#11764334 was added.
    sql/event_db_repository.cc:
      mysql_event_fill_row() was modified: set value for status field
      in events tables only in case if statement CREATE EVENT
      is being processed or if this value was set in ALTER EVENT
      statement.
      Event_db_repository::create_event was modified: removed redundant
      setting of status field after return from call to mysql_event_fill_row().
    sql/event_parse_data.h:
      Event_parse_data structure was modified: added flag
      status_changed that is set to true if status's value
      was changed in ALTER EVENT statement.
    sql/sql_yacc.yy:
      Set flag status_changed if status was set in ALTER EVENT
      statement.
    fa913a0b
events_bugs.result 37.1 KB