From 2fc5d274e875fdcc00a3ee03835f0f964e63dc49 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 5 Mar 2005 21:44:15 +0200 Subject: 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 --- sql/sql_delete.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_delete.cc') diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index eddc6741be6..d49d654cb87 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -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); -- cgit v1.2.1