• unknown's avatar
    Fix for bug #5890 "Triggers fail for DELETE without WHERE". · bb43e831
    unknown authored
    If we have DELETE with always true WHERE clause we should not use 
    optimized delete_all_rows() method for tables with DELETE triggers,
    because in this case we will lose side-effect of deletion.
    
    
    mysql-test/r/trigger.result:
      Added test for bug #5890 "Triggers fail for DELETE without WHERE".
    mysql-test/t/trigger.test:
      Added test for bug #5890 "Triggers fail for DELETE without WHERE".
    sql/sql_delete.cc:
      mysql_delete(): 
        We should not use optimized delete_all_rows() method for tables
        with DELETE triggers, because in this case we will lose side-effect
        of deletion.
    sql/sql_trigger.h:
      Added new Table_triggers_list::has_delete_triggers() method which
      allows to understand quickly if we have some DELETE triggers in
      our list.
    bb43e831
trigger.test 5.63 KB