|
1 | 1 | /*****************************************************************************
|
2 | 2 |
|
3 |
| -Copyright (c) 2016, 2021, MariaDB Corporation. |
| 3 | +Copyright (c) 2016, 2022, MariaDB Corporation. |
4 | 4 |
|
5 | 5 | This program is free software; you can redistribute it and/or modify it under
|
6 | 6 | the terms of the GNU General Public License as published by the Free Software
|
@@ -253,7 +253,9 @@ dberr_t dict_stats_save_defrag_summary(dict_index_t *index, THD *thd)
|
253 | 253 | trx_t *trx= trx_create();
|
254 | 254 | trx->mysql_thd= thd;
|
255 | 255 | trx_start_internal(trx);
|
256 |
| - dberr_t ret= lock_table_for_trx(table_stats, trx, LOCK_X); |
| 256 | + dberr_t ret= trx->read_only |
| 257 | + ? DB_READ_ONLY |
| 258 | + : lock_table_for_trx(table_stats, trx, LOCK_X); |
257 | 259 | if (ret == DB_SUCCESS)
|
258 | 260 | ret= lock_table_for_trx(index_stats, trx, LOCK_X);
|
259 | 261 | row_mysql_lock_data_dictionary(trx);
|
@@ -388,7 +390,9 @@ dict_stats_save_defrag_stats(
|
388 | 390 | trx_t *trx= trx_create();
|
389 | 391 | trx->mysql_thd= thd;
|
390 | 392 | trx_start_internal(trx);
|
391 |
| - dberr_t ret= lock_table_for_trx(table_stats, trx, LOCK_X); |
| 393 | + dberr_t ret= trx->read_only |
| 394 | + ? DB_READ_ONLY |
| 395 | + : lock_table_for_trx(table_stats, trx, LOCK_X); |
392 | 396 | if (ret == DB_SUCCESS)
|
393 | 397 | ret= lock_table_for_trx(index_stats, trx, LOCK_X);
|
394 | 398 |
|
|
0 commit comments