mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixing bug #8850 in such a way that when TRUNCATE is called within
stored procedure, it is converted to DELETE. mysql-test/r/sp.result: A result for the test case for bug #8850 mysql-test/t/sp.test: A test case for the bug #8850 sql/sql_delete.cc: A fix for bug #8850, plus adding a missing call to mysql_init_select(), which caused mem_root corruption. sql/sql_parse.cc: A fix for the bug #8850 BitKeeper/etc/ignore: Added acinclude.m4 to the ignore list
This commit is contained in:
@@ -749,11 +749,12 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
table_list->db, table_list->table_name);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
if (!ha_supports_generate(table_type))
|
||||
if (!ha_supports_generate(table_type) || thd->lex->sphead)
|
||||
{
|
||||
/* Probably InnoDB table */
|
||||
table_list->lock_type= TL_WRITE;
|
||||
ha_enable_transaction(thd, FALSE);
|
||||
mysql_init_select(thd->lex);
|
||||
error= mysql_delete(thd, table_list, (COND*) 0, (SQL_LIST*) 0,
|
||||
HA_POS_ERROR, 0);
|
||||
ha_enable_transaction(thd, TRUE);
|
||||
|
Reference in New Issue
Block a user