• unknown's avatar
    Bug#23556: TRUNCATE TABLE still maps to DELETE · 1a0e1f13
    unknown authored
     This is the 5.0 part of the fix.
     Currently TRUNCATE command will not call
     delete_all_rows() in the handler (that implements
     the "fast" TRUNCATE for InnoDB) when there are
     triggers on the table.
     As decided by the architecture team TRUNCATE must
     use "fast" TRUNCATE even when there are triggers.
     Thus it must ignore the triggers. 
     Made TRUNCATE to ignore the triggers and call
     delete_all_rows() for all storage engines
     to maintain engine consistency.
    
    
    mysql-test/r/trigger.result:
      Bug#23556: TRUNCATE TABLE still maps to DELETE
       - test case
    mysql-test/t/trigger.test:
      Bug#23556: TRUNCATE TABLE still maps to DELETE
       - test case
    sql/sql_delete.cc:
      Bug#23556: TRUNCATE TABLE still maps to DELETE
       - We implemenent fast TRUNCATE for InnoDB even
         if triggers are present.  
       - TRUNCATE ignores triggers.
    1a0e1f13
trigger.test 47.2 KB