• unknown's avatar
    fix for bug#16394 "Events: Crash if schedule contains SELECT" · 8d961c45
    unknown authored
    Parsing of CREATE/ALTER EVENT statement was crashing because of early
    initialization done during parsing, instead in the after parsing phase.
    Moreover, we don't want SUBqueries in CREATE/ALTER EVENT therefore we
    disable them, though it is possible to make them work. It can be emulated
    inside SP with a cursor and SP variable (CREATE/ALTER EVENT can still
    accept variables as values).
    
    
    mysql-test/r/events_bugs.result:
      update result
    mysql-test/t/events_bugs.test:
      tests for bug#16384
    sql/sql_yacc.yy:
      disallow subqueries when SQLCOM_CREATE_EVENT | SQLCOM_ALTER_EVENT
      The fix is not big, though lex->forbid_subqueries could have been introduced.
      Easier is just to set the sql_command and check in both rules where
      subqueries enter.
    8d961c45
sql_yacc.yy 284 KB