• unknown's avatar
    Fix for bug#14945 "Truncate table doesn't reset the auto_increment · 0d373cdd
    unknown authored
    counter".
    
    When TRUNCATE TABLE was called within an stored procedure the
    auto_increment counter was not reset to 0 even if straight
    TRUNCATE for this table did this.
    
    This fix makes TRUNCATE in stored procedures to be handled exactly
    in the same way as straight TRUNCATE. We achieve this by rolling
    back the fix for bug 8850, which is no longer needed since stored
    procedures don't require prelocked mode anymore (and TRUNCATE is
    not allowed in stored functions or triggers).
    
    
    mysql-test/r/sp.result:
      Test case for BUG#14945.
    mysql-test/t/sp.test:
      Test case for BUG#14945.
    sql/sql_delete.cc:
      Handle TRUNCATE in stored procedures exactly in the same way as straight
      TRUNCATE (i.e. without falling back to DELETE if possible). We achieve
      this by rolling back the fix for bug 8850, which is no longer relevant
      since stored procedures don't require prelocked mode anymore
      (and TRUNCATE is not allowed in stored functions or triggers).
    sql/sql_parse.cc:
      Handle TRUNCATE in stored procedures exactly in the same way as straight
      TRUNCATE (i.e. without falling back to DELETE if possible). We achieve
      this by rolling back the fix for bug 8850, which is no longer relevant
      since stored procedures don't require prelocked mode anymore
      (and TRUNCATE is not allowed in stored functions or triggers).
    0d373cdd
sql_delete.cc 24.8 KB