summaryrefslogtreecommitdiff
path: root/storage/maria/ha_maria.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-12-13 19:57:19 +0200
committerMichael Widenius <monty@askmonty.org>2011-12-13 19:57:19 +0200
commit33c26f78428d30e1ca860803e5e0142ca41f8b61 (patch)
treeb0760b663c4e13c671282ca1e9953f9f17bfd1c7 /storage/maria/ha_maria.cc
parent6404504d0c10d58ad5861bdb72edd54508f1364c (diff)
downloadmariadb-git-33c26f78428d30e1ca860803e5e0142ca41f8b61.tar.gz
Fixed bug: lp:887051 ; Error in recovery with LOAD DATA + DELETE
mysql-test/suite/maria/r/maria-recovery3.result: Added test case for recovery bug mysql-test/suite/maria/t/maria-recovery3.test: Added test case for recovery bug storage/maria/ha_maria.cc: Don't print query twice to log storage/maria/ma_delete.c: More DBUG_PRINT storage/maria/ma_key_recover.c: Added new asserts to detect errors earlier storage/maria/ma_recovery.c: Update all states when moving a non-transactional file to transactional. This fixes lp:887051
Diffstat (limited to 'storage/maria/ha_maria.cc')
-rw-r--r--storage/maria/ha_maria.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index ead0a3eb5c5..99a1e2cc903 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2431,8 +2431,16 @@ int ha_maria::extra_opt(enum ha_extra_function operation, ulong cache_size)
int ha_maria::delete_all_rows()
{
THD *thd= table->in_use;
- (void) translog_log_debug_info(file->trn, LOGREC_DEBUG_INFO_QUERY,
- (uchar*) thd->query(), thd->query_length());
+#ifdef EXTRA_DEBUG
+ TRN *trn= file->trn;
+ if (trn && ! (trnman_get_flags(trn) & TRN_STATE_INFO_LOGGED))
+ {
+ trnman_set_flags(trn, trnman_get_flags(trn) | TRN_STATE_INFO_LOGGED |
+ TRN_STATE_TABLES_CAN_CHANGE);
+ (void) translog_log_debug_info(trn, LOGREC_DEBUG_INFO_QUERY,
+ (uchar*) thd->query(), thd->query_length());
+ }
+#endif
if (file->s->now_transactional &&
((table->in_use->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) ||
table->in_use->locked_tables))