1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

An assertion added (transaction must be re-enabled before end of

top-level statement) and fixes for the bugs it finds.
Fix for non-serious Valgrind warning.


sql/sql_insert.cc:
  When CREATE TABLE IF NOT EXISTS finds the table already exists,
  'table' is the existing table. So if that table is temporary we don't
  re-enable transactions which is a bug.
sql/sql_parse.cc:
  verify that at the end of each top-statement transactions have
  been re-enabled. Does not apply to substatements (consider
  CREATE TABLE t1 SELECT stored_func() : the substatements inside
  stored_func() run with transaction disabled).
  I am not putting the assertion into ha_external_lock(F_UNLCK) because
  performance schema tables get closed in the middle of a statement
  sometimes while transaction is disabled.
sql/sql_table.cc:
  copy_data_between_tables() forgot to clean-up several things in error
  conditions (ha_enable_transaction(), free-ing 'copy', etc) as found
  by the assertion added to sql_parse.cc.
storage/maria/ha_maria.cc:
  Comment
storage/maria/ma_blockrec.c:
  fix for Valgrind warning: a temporary table was created, a blob
  page of its was flushed to disk and had random bytes in the checksum
  area ("write of uninitialized bytes in pwrite")
storage/maria/ma_pagecrc.c:
  typo
This commit is contained in:
unknown
2008-01-21 11:56:37 +01:00
parent 0825c48549
commit d66157e30f
6 changed files with 37 additions and 29 deletions

View File

@ -3670,16 +3670,16 @@ bool select_create::send_eof()
abort();
else
{
if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0)
ha_enable_transaction(thd, TRUE);
/*
Do an implicit commit at end of statement for non-temporary
tables. This can fail, but we should unlock the table
nevertheless.
*/
if (!table->s->tmp_table)
{
ha_enable_transaction(thd, TRUE);
ha_commit(thd); // Can fail, but we proceed anyway
}
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
if (m_plock)