Skip to content

Commit

Permalink
Don't log delete_all_rows() for temporary Aria files to transaction log
Browse files Browse the repository at this point in the history
- This was just a small performance issue, not a crashing bug.
  • Loading branch information
montywi committed Mar 2, 2023
1 parent bf9aa86 commit 37edbbf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions storage/maria/ha_maria.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand All @@ -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)))
Expand Down

0 comments on commit 37edbbf

Please sign in to comment.