• Dmitry Shulga's avatar
    Fixed bug #55421 - Protocol::end_statement(): Assertion `0' on · d6f6db6f
    Dmitry Shulga authored
    multi-table UPDATE IGNORE.
    The problem was that if there was an active SELECT statement
    during trigger execution, an error risen during the execution
    may cause a crash. The fix is to temporary reset LEX::current_select
    before trigger execution and restore it afterwards. This way
    errors risen during the trigger execution are processed as
    if there was no active SELECT.
    
    mysql-test/r/trigger_notembedded.result:
      added test case result for bug #55421.
    mysql-test/t/trigger_notembedded.test:
      added test case for bug #55421.
    sql/sql_trigger.cc:
      Reset thd->lex->current_select before start trigger execution
      and restore its original value after execution is finished.
      This is neccessery in order to set error status in 
      diagnostic_area in case of trigger execution failure.
    d6f6db6f
sql_trigger.cc 68.5 KB