diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2005-03-05 21:44:15 +0200 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2005-03-05 21:44:15 +0200 |
commit | 2fc5d274e875fdcc00a3ee03835f0f964e63dc49 (patch) | |
tree | 262a483ed5b829f39f6334eb6c7eec7745249151 /sql/sql_delete.cc | |
parent | 679088a2ae1353f14a970182fa64f58170e81b72 (diff) | |
download | mariadb-git-2fc5d274e875fdcc00a3ee03835f0f964e63dc49.tar.gz |
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
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 3 |
1 files changed, 2 insertions, 1 deletions
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); |