diff options
author | Mats Kindahl <mats@mysql.com> | 2008-09-03 22:04:07 +0200 |
---|---|---|
committer | Mats Kindahl <mats@mysql.com> | 2008-09-03 22:04:07 +0200 |
commit | 02a435404434a69f23e02d199e45a724729d9751 (patch) | |
tree | 0866c0d378211ec4b2bc83e6f3af1c3ca4b3b961 /sql/log.h | |
parent | d62f27a90a7bcc54819bf70667be7b2d96fd5adc (diff) | |
download | mariadb-git-02a435404434a69f23e02d199e45a724729d9751.tar.gz |
Bug #32709: Assertion failed: trx_data->empty(), file log.cc
The assertion indicates that some data was left in the transaction
cache when the server was shut down, which means that a previous
statement did not commit or rollback correctly.
What happened was that a bug in the rollback of a transactional
table caused the transaction cache to be emptied, but not reset.
The error can be triggered by having a failing UPDATE or INSERT,
on a transactional table, causing an implicit rollback.
Fixed by always flushing the pending event to reset the state
properly.
mysql-test/extra/rpl_tests/rpl_row_basic.test:
Testing that a failed update (that writes some rows to the
transaction cache) does not cause the transaction cache to
hold on to the data or forget to reset the transaction cache.
sql/log.cc:
Added call to remove pending event when the transaction cache
is emptied instead of written to binary log. The call will also
clear the outstanding table map count so that the cache is not
left it in a state of "empty but not reset".
Added function MYSQL_BIN_LOG::remove_pending_rows_event().
sql/log.h:
Added function MYSQL_BIN_LOG::remove_pending_rows_event().
sql/sql_class.cc:
Adding function THD::binlog_remove_pending_rows_event().
sql/sql_class.h:
Adding function THD::binlog_remove_pending_rows_event().
Diffstat (limited to 'sql/log.h')
-rw-r--r-- | sql/log.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/log.h b/sql/log.h index 20a1b7e8e6d..891134a9762 100644 --- a/sql/log.h +++ b/sql/log.h @@ -307,6 +307,7 @@ public: void update_table_map_version() { ++m_table_map_version; } int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event); + int remove_pending_rows_event(THD *thd); #endif /* !defined(MYSQL_CLIENT) */ void reset_bytes_written() |