1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix for bug#14945 "Truncate table doesn't reset the auto_increment

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).
This commit is contained in:
svoj@april.(none)
2006-04-06 15:19:01 +05:00
parent ae532e2611
commit 209682e051
4 changed files with 28 additions and 3 deletions

View File

@ -3350,7 +3350,7 @@ end_with_restore_list:
Don't allow this within a transaction because we want to use
re-generate table
*/
if ((thd->locked_tables && !lex->sphead) || thd->active_transaction())
if (thd->locked_tables || thd->active_transaction())
{
my_message(ER_LOCK_OR_ACTIVE_TRANSACTION,
ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));