Skip to content

Commit 3d5f7ad

Browse files
committed
MDEV-15773 - Simplified away trx_free_for_(mysql|background)
1 parent 0993d6b commit 3d5f7ad

19 files changed

+96
-129
lines changed

storage/innobase/dict/dict0crea.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ dict_create_or_check_foreign_constraint_tables(void)
15881588

15891589
row_mysql_unlock_data_dictionary(trx);
15901590

1591-
trx_free_for_background(trx);
1591+
trx_free(trx);
15921592

15931593
srv_file_per_table = srv_file_per_table_backup;
15941594

@@ -1692,7 +1692,7 @@ dict_create_or_check_sys_virtual()
16921692

16931693
row_mysql_unlock_data_dictionary(trx);
16941694

1695-
trx_free_for_background(trx);
1695+
trx_free(trx);
16961696

16971697
srv_file_per_table = srv_file_per_table_backup;
16981698

@@ -2356,7 +2356,7 @@ dict_create_or_check_sys_tablespace(void)
23562356

23572357
row_mysql_unlock_data_dictionary(trx);
23582358

2359-
trx_free_for_background(trx);
2359+
trx_free(trx);
23602360

23612361
srv_file_per_table = srv_file_per_table_backup;
23622362

storage/innobase/dict/dict0dict.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ dict_table_try_drop_aborted(
444444
}
445445

446446
row_mysql_unlock_data_dictionary(trx);
447-
trx_free_for_background(trx);
447+
trx_free(trx);
448448
}
449449

450450
/**********************************************************************//**
@@ -2046,7 +2046,7 @@ dict_table_remove_from_cache_low(
20462046
row_merge_drop_indexes_dict(trx, table->id);
20472047
trx_commit_for_mysql(trx);
20482048
trx->dict_operation_lock_mode = 0;
2049-
trx_free_for_background(trx);
2049+
trx_free(trx);
20502050
}
20512051

20522052
/* Free virtual column template if any */

storage/innobase/dict/dict0load.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ dict_update_filepath(
914914

915915
trx_commit_for_mysql(trx);
916916
trx->dict_operation_lock_mode = 0;
917-
trx_free_for_background(trx);
917+
trx_free(trx);
918918

919919
if (err == DB_SUCCESS) {
920920
/* We just updated SYS_DATAFILES due to the contents in
@@ -976,7 +976,7 @@ dict_replace_tablespace_and_filepath(
976976

977977
trx_commit_for_mysql(trx);
978978
trx->dict_operation_lock_mode = 0;
979-
trx_free_for_background(trx);
979+
trx_free(trx);
980980

981981
return(err);
982982
}

storage/innobase/dict/dict0stats.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ dict_stats_exec_sql(
333333
}
334334

335335
if (trx_started) {
336-
trx_free_for_background(trx);
336+
trx_free(trx);
337337
}
338338

339339
return(err);
@@ -2602,7 +2602,7 @@ dict_stats_save(
26022602
trx_commit_for_mysql(trx);
26032603

26042604
end:
2605-
trx_free_for_background(trx);
2605+
trx_free(trx);
26062606

26072607
mutex_exit(&dict_sys->mutex);
26082608
rw_lock_x_unlock(dict_operation_lock);
@@ -3078,7 +3078,7 @@ dict_stats_fetch_from_ps(
30783078

30793079
trx_commit_for_mysql(trx);
30803080

3081-
trx_free_for_background(trx);
3081+
trx_free(trx);
30823082

30833083
if (!index_fetch_arg.stats_were_modified) {
30843084
return(DB_STATS_DO_NOT_EXIST);

storage/innobase/fts/fts0fts.cc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ fts_load_user_stopword(
552552
mutex_exit(&dict_sys->mutex);
553553
}
554554

555-
trx_free_for_background(trx);
555+
trx_free(trx);
556556
return(ret);
557557
}
558558

@@ -2758,7 +2758,7 @@ fts_cmp_set_sync_doc_id(
27582758
}
27592759
}
27602760

2761-
trx_free_for_background(trx);
2761+
trx_free(trx);
27622762

27632763
return(error);
27642764
}
@@ -2839,7 +2839,7 @@ fts_update_sync_doc_id(
28392839

28402840
fts_sql_rollback(trx);
28412841
}
2842-
trx_free_for_background(trx);
2842+
trx_free(trx);
28432843
}
28442844

28452845
return(error);
@@ -3084,7 +3084,7 @@ fts_commit_table(
30843084

30853085
fts_sql_commit(trx);
30863086

3087-
trx_free_for_background(trx);
3087+
trx_free(trx);
30883088

30893089
return(error);
30903090
}
@@ -3875,7 +3875,7 @@ fts_doc_fetch_by_doc_id(
38753875

38763876
error = fts_eval_sql(trx, graph);
38773877
fts_sql_commit(trx);
3878-
trx_free_for_background(trx);
3878+
trx_free(trx);
38793879

38803880
if (!get_doc) {
38813881
fts_que_graph_free(graph);
@@ -4271,7 +4271,7 @@ fts_sync_commit(
42714271

42724272
/* Avoid assertion in trx_free(). */
42734273
trx->dict_operation_lock_mode = 0;
4274-
trx_free_for_background(trx);
4274+
trx_free(trx);
42754275

42764276
return(error);
42774277
}
@@ -4325,7 +4325,7 @@ fts_sync_rollback(
43254325

43264326
/* Avoid assertion in trx_free(). */
43274327
trx->dict_operation_lock_mode = 0;
4328-
trx_free_for_background(trx);
4328+
trx_free(trx);
43294329
}
43304330

43314331
/** Run SYNC on the table, i.e., write out data from the cache to the
@@ -5055,7 +5055,7 @@ fts_get_rows_count(
50555055

50565056
fts_que_graph_free(graph);
50575057

5058-
trx_free_for_background(trx);
5058+
trx_free(trx);
50595059

50605060
return(count);
50615061
}
@@ -5081,7 +5081,7 @@ fts_update_max_cache_size(
50815081

50825082
fts_sql_commit(trx);
50835083

5084-
trx_free_for_background(trx);
5084+
trx_free(trx);
50855085
}
50865086
#endif /* FTS_CACHE_SIZE_DEBUG */
50875087

@@ -6394,14 +6394,14 @@ fts_rename_aux_tables_to_hex_format_low(
63946394
<< table->name << ". Please revert"
63956395
" manually.";
63966396
fts_sql_rollback(trx_bg);
6397-
trx_free_for_background(trx_bg);
6397+
trx_free(trx_bg);
63986398
/* Continue to clear aux tables' flags2 */
63996399
not_rename = true;
64006400
continue;
64016401
}
64026402

64036403
fts_sql_commit(trx_bg);
6404-
trx_free_for_background(trx_bg);
6404+
trx_free(trx_bg);
64056405
}
64066406

64076407
DICT_TF2_FLAG_UNSET(parent_table, DICT_TF2_FTS_AUX_HEX_NAME);
@@ -6643,12 +6643,12 @@ fts_rename_aux_tables_to_hex_format(
66436643
fts_parent_all_index_set_corrupt(trx_corrupt, parent_table);
66446644
trx_corrupt->dict_operation_lock_mode = 0;
66456645
fts_sql_commit(trx_corrupt);
6646-
trx_free_for_background(trx_corrupt);
6646+
trx_free(trx_corrupt);
66476647
} else {
66486648
fts_sql_commit(trx_rename);
66496649
}
66506650

6651-
trx_free_for_background(trx_rename);
6651+
trx_free(trx_rename);
66526652
ib_vector_reset(aux_tables);
66536653
}
66546654

@@ -6726,7 +6726,7 @@ fts_drop_obsolete_aux_table_from_vector(
67266726
fts_sql_commit(trx_drop);
67276727
}
67286728

6729-
trx_free_for_background(trx_drop);
6729+
trx_free(trx_drop);
67306730
}
67316731
}
67326732

@@ -7221,7 +7221,7 @@ fts_drop_orphaned_tables(void)
72217221

72227222
row_mysql_unlock_data_dictionary(trx);
72237223

7224-
trx_free_for_background(trx);
7224+
trx_free(trx);
72257225

72267226
if (heap != NULL) {
72277227
mem_heap_free(heap);
@@ -7402,7 +7402,7 @@ fts_load_stopword(
74027402
fts_sql_rollback(trx);
74037403
}
74047404

7405-
trx_free_for_background(trx);
7405+
trx_free(trx);
74067406
}
74077407

74087408
if (!cache->stopword_info.cached_stopword) {

storage/innobase/fts/fts0opt.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,7 @@ fts_table_fetch_doc_ids(
10281028
}
10291029

10301030
if (alloc_bk_trx) {
1031-
trx_free_for_background(trx);
1031+
trx_free(trx);
10321032
}
10331033

10341034
return(error);
@@ -1740,7 +1740,7 @@ fts_optimize_free(
17401740
mem_heap_t* heap = static_cast<mem_heap_t*>(optim->self_heap->arg);
17411741

17421742
trx_commit_for_mysql(optim->trx);
1743-
trx_free_for_background(optim->trx);
1743+
trx_free(optim->trx);
17441744

17451745
fts_doc_ids_free(optim->to_delete);
17461746
fts_optimize_graph_free(&optim->graph);

storage/innobase/fts/fts0que.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4120,7 +4120,7 @@ fts_query(
41204120
func_exit:
41214121
fts_query_free(&query);
41224122

4123-
trx_free_for_background(query_trx);
4123+
trx_free(query_trx);
41244124

41254125
return(error);
41264126
}

storage/innobase/handler/ha_innodb.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4244,7 +4244,7 @@ innobase_end(handlerton*, ha_panic_function)
42444244
if (thd) { // may be UNINSTALL PLUGIN statement
42454245
trx_t* trx = thd_to_trx(thd);
42464246
if (trx) {
4247-
trx_free_for_mysql(trx);
4247+
trx_free(trx);
42484248
}
42494249
}
42504250

@@ -5013,7 +5013,7 @@ innobase_close_connection(
50135013
} else {
50145014
rollback_and_free:
50155015
innobase_rollback_trx(trx);
5016-
trx_free_for_mysql(trx);
5016+
trx_free(trx);
50175017
}
50185018
}
50195019

@@ -12582,7 +12582,7 @@ create_table_info_t::create_table_update_dict()
1258212582
if (!innobase_fts_load_stopword(innobase_table, NULL, m_thd)) {
1258312583
dict_table_close(innobase_table, FALSE, FALSE);
1258412584
srv_active_wake_master_thread();
12585-
trx_free_for_mysql(m_trx);
12585+
trx_free(m_trx);
1258612586
DBUG_RETURN(-1);
1258712587
}
1258812588
}
@@ -12707,14 +12707,14 @@ ha_innobase::create(
1270712707

1270812708
srv_active_wake_master_thread();
1270912709

12710-
trx_free_for_mysql(trx);
12710+
trx_free(trx);
1271112711

1271212712
DBUG_RETURN(error);
1271312713

1271412714
cleanup:
1271512715
trx_rollback_for_mysql(trx);
1271612716
row_mysql_unlock_data_dictionary(trx);
12717-
trx_free_for_mysql(trx);
12717+
trx_free(trx);
1271812718

1271912719
DBUG_RETURN(error);
1272012720
}
@@ -13076,7 +13076,7 @@ ha_innobase::delete_table(
1307613076

1307713077
innobase_commit_low(trx);
1307813078

13079-
trx_free_for_mysql(trx);
13079+
trx_free(trx);
1308013080

1308113081
DBUG_RETURN(convert_error_code_to_mysql(err, 0, NULL));
1308213082
}
@@ -13149,7 +13149,7 @@ innobase_drop_database(
1314913149

1315013150
innobase_commit_low(trx);
1315113151

13152-
trx_free_for_mysql(trx);
13152+
trx_free(trx);
1315313153
}
1315413154

1315513155
/*********************************************************************//**
@@ -13276,7 +13276,7 @@ ha_innobase::rename_table(
1327613276

1327713277
innobase_commit_low(trx);
1327813278

13279-
trx_free_for_mysql(trx);
13279+
trx_free(trx);
1328013280

1328113281
if (error == DB_SUCCESS) {
1328213282
char norm_from[MAX_FULL_NAME_LEN];
@@ -17102,7 +17102,7 @@ innobase_commit_by_xid(
1710217102
ut_ad(trx->mysql_thd == NULL);
1710317103
trx_deregister_from_2pc(trx);
1710417104
ut_ad(!trx->will_lock); /* trx cache requirement */
17105-
trx_free_for_background(trx);
17105+
trx_free(trx);
1710617106

1710717107
return(XA_OK);
1710817108
} else {
@@ -17132,7 +17132,7 @@ innobase_rollback_by_xid(
1713217132
int ret = innobase_rollback_trx(trx);
1713317133
trx_deregister_from_2pc(trx);
1713417134
ut_ad(!trx->will_lock);
17135-
trx_free_for_background(trx);
17135+
trx_free(trx);
1713617136

1713717137
return(ret);
1713817138
} else {

0 commit comments

Comments
 (0)