• unknown's avatar
    A fix for Bug#34643: TRUNCATE crash if trigger and foreign key. · 0dc8565e
    unknown authored
      
    In cases when TRUNCATE was executed by invoking mysql_delete() rather
    than by table recreation (for example, when TRUNCATE was issued on
    InnoDB table with is referenced by foreign key) triggers were invoked.
    In debug builds this also led to crash because of an assertion, which
    assumes that some preliminary actions take place before trigger 
    invocation, which doesn't happen in case of TRUNCATE.
    
    The fix is not to execute triggers in mysql_delete() when this
    function is used by TRUNCATE.
    
    
    mysql-test/r/trigger-trans.result:
      Update result file.
    mysql-test/t/trigger-trans.test:
      A test case for Bug#34643: TRUNCATE crash if trigger and foreign key.
    sql/sql_delete.cc:
      Do not process triggers in TRUNCATE.
    0dc8565e
trigger-trans.result 4.73 KB