summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2023-03-01 19:38:36 +0200
committerMonty <monty@mariadb.org>2023-03-02 13:11:54 +0200
commit37edbbf2d36654cd7facd6d5caddee364f12826c (patch)
treee7051533951f274128c01f080f15f0738873cbac
parentbf9aa8687f7a00c1abc3b23c33a060a1a076bbda (diff)
downloadmariadb-git-37edbbf2d36654cd7facd6d5caddee364f12826c.tar.gz
Don't log delete_all_rows() for temporary Aria files to transaction log
- This was just a small performance issue, not a crashing bug.
-rw-r--r--storage/maria/ha_maria.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index 8f59ce0a549..81262578765 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2858,8 +2858,9 @@ bool ha_maria::auto_repair(int error) const
int ha_maria::delete_all_rows()
{
THD *thd= table->in_use;
- TRN *trn= file->trn;
+ TRN *trn= file->s->now_transactional ? file->trn : (TRN*) 0;
CHECK_UNTIL_WE_FULLY_IMPLEMENTED_VERSIONING("TRUNCATE in WRITE CONCURRENT");
+
#ifdef EXTRA_DEBUG
if (trn && ! (trnman_get_flags(trn) & TRN_STATE_INFO_LOGGED))
{
@@ -2873,8 +2874,7 @@ int ha_maria::delete_all_rows()
If we are under LOCK TABLES, we have to do a commit as
delete_all_rows() can't be rolled back
*/
- if (table->in_use->locked_tables_mode && trn &&
- trnman_has_locked_tables(trn))
+ if (trn && table->in_use->locked_tables_mode && trnman_has_locked_tables(trn))
{
int error;
if ((error= implicit_commit(thd, 1)))