Skip to content

Commit 1fd1ef2

Browse files
committed
Fix CMAKE_BUILD_TYPE=Debug
Remove unused variables and type mismatch that was introduced in commit b393e2c Also, fix a typo in the documentation of the parameter, and update the test.
1 parent 350e46a commit 1fd1ef2

File tree

5 files changed

+32
-25
lines changed

5 files changed

+32
-25
lines changed

mysql-test/suite/sys_vars/r/sysvars_innodb.result

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,18 @@ NUMERIC_BLOCK_SIZE NULL
642642
ENUM_VALUE_LIST OFF,ON
643643
READ_ONLY NO
644644
COMMAND_LINE_ARGUMENT REQUIRED
645+
VARIABLE_NAME INNODB_DEBUG_SYNC
646+
SESSION_VALUE NULL
647+
DEFAULT_VALUE
648+
VARIABLE_SCOPE GLOBAL
649+
VARIABLE_TYPE VARCHAR
650+
VARIABLE_COMMENT debug_sync for innodb purge threads. Use it to set up sync points for all purge threads at once. The commands will be applied sequentially at the beginning of purging the next undo record.
651+
NUMERIC_MIN_VALUE NULL
652+
NUMERIC_MAX_VALUE NULL
653+
NUMERIC_BLOCK_SIZE NULL
654+
ENUM_VALUE_LIST NULL
655+
READ_ONLY NO
656+
COMMAND_LINE_ARGUMENT NONE
645657
VARIABLE_NAME INNODB_DEFAULT_ENCRYPTION_KEY_ID
646658
SESSION_VALUE 1
647659
DEFAULT_VALUE 1

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21015,9 +21015,9 @@ char *innobase_debug_sync;
2101521015
static MYSQL_SYSVAR_STR(debug_sync, innobase_debug_sync,
2101621016
PLUGIN_VAR_NOCMDARG,
2101721017
"debug_sync for innodb purge threads. "
21018-
"Use it t oset up sync points for all purge threads "
21018+
"Use it to set up sync points for all purge threads "
2101921019
"at once. The commands will be applied sequentially at "
21020-
"the beginning of purging the next node ",
21020+
"the beginning of purging the next undo record.",
2102121021
NULL,
2102221022
innobase_debug_sync_set, NULL);
2102321023
#endif /* UNIV_DEBUG */

storage/innobase/include/que0que.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ struct que_thr_t{
386386
row_prebuilt_t* prebuilt; /*!< prebuilt structure processed by
387387
the query thread */
388388

389-
ut_d(srv_slot_t *thread_slot;) /*!< a slot from srv_sys.sys_threads
390-
* if any */
389+
/** a slot of srv_sys.sys_threads, for DEBUG_SYNC in purge thread */
390+
ut_d(srv_slot_t* thread_slot;)
391391
};
392392

393393
#define QUE_THR_MAGIC_N 8476583

storage/innobase/que/que0que.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,9 +1082,6 @@ que_run_threads_low(
10821082
ut_a(thr_get_trx(thr)->error_state == DB_SUCCESS);
10831083
ut_ad(!trx_mutex_own(thr_get_trx(thr)));
10841084

1085-
/* slot can be received from purge thread for debug_sync setup */
1086-
ut_d(srv_slot_t *slot = thr->thread_slot);
1087-
10881085
/* cumul_resource counts how much resources the OS thread (NOT the
10891086
query thread) has spent in this function */
10901087

storage/innobase/srv/srv0srv.cc

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,33 +3047,31 @@ srv_was_tablespace_truncated(const fil_space_t* space)
30473047
}
30483048

30493049
#ifdef UNIV_DEBUG
3050-
static uint get_first_slot(srv_thread_type type)
3050+
static ulint get_first_slot(srv_thread_type type)
30513051
{
30523052
switch (type) {
3053-
case SRV_MASTER:
3054-
return SRV_MASTER_SLOT;
3055-
case SRV_PURGE:
3056-
return SRV_PURGE_SLOT;
3057-
case SRV_WORKER:
3058-
/* Find an empty slot, skip the master and purge slots. */
3059-
return SRV_WORKER_SLOTS_START;
3060-
default:
3061-
ut_error;
3053+
case SRV_MASTER:
3054+
return SRV_MASTER_SLOT;
3055+
case SRV_PURGE:
3056+
return SRV_PURGE_SLOT;
3057+
case SRV_WORKER:
3058+
/* Find an empty slot, skip the master and purge slots. */
3059+
return SRV_WORKER_SLOTS_START;
3060+
default:
3061+
ut_error;
30623062
}
30633063
}
30643064

30653065
void srv_for_each_thread(srv_thread_type type,
30663066
srv_slot_callback_t callback,
30673067
const void *arg)
30683068
{
3069-
int slot_idx= get_first_slot(type);
3070-
while(slot_idx < srv_sys.n_sys_threads
3071-
&& srv_sys.sys_threads[slot_idx].in_use
3072-
&& srv_sys.sys_threads[slot_idx].type == type)
3073-
{
3074-
srv_slot_t *slot= &srv_sys.sys_threads[slot_idx];
3075-
callback(slot, arg);
3076-
slot_idx++;
3069+
for (ulint slot_idx= get_first_slot(type);
3070+
slot_idx < srv_sys.n_sys_threads
3071+
&& srv_sys.sys_threads[slot_idx].in_use
3072+
&& srv_sys.sys_threads[slot_idx].type == type;
3073+
slot_idx++) {
3074+
callback(&srv_sys.sys_threads[slot_idx], arg);
30773075
}
30783076
}
30793077
#endif

0 commit comments

Comments
 (0)