Skip to content

Commit 581aebe

Browse files
committed
MDEV-24167: Fix -DPLUGIN_PERFSCHEMA=NO and Windows debug builds
1 parent 4e359eb commit 581aebe

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

storage/innobase/dict/dict0dict.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ void dict_sys_t::create()
10381038
table_id_hash.create(hash_size);
10391039
temp_id_hash.create(hash_size);
10401040

1041-
latch.init(dict_operation_lock_key);
1041+
latch.SRW_LOCK_INIT(dict_operation_lock_key);
10421042

10431043
if (!srv_read_only_mode)
10441044
{

storage/innobase/fil/fil0fil.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ fil_space_t *fil_space_t::create(const char *name, ulint id, ulint flags,
957957
<< " " << fil_crypt_get_type(crypt_data));
958958
}
959959

960-
space->latch.init(fil_space_latch_key);
960+
space->latch.SRW_LOCK_INIT(fil_space_latch_key);
961961

962962
if (space->purpose == FIL_TYPE_TEMPORARY) {
963963
/* SysTablespace::open_or_create() would pass

storage/innobase/include/btr0sea.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ struct btr_search_sys_t
250250
void init()
251251
{
252252
memset((void*) this, 0, sizeof *this);
253-
latch.init(btr_search_latch_key);
253+
latch.SRW_LOCK_INIT(btr_search_latch_key);
254254
}
255255

256256
void alloc(ulint hash_size)

storage/innobase/include/srw_lock.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ this program; if not, write to the Free Software Foundation, Inc.,
3232
# endif
3333
#endif
3434

35+
#ifdef UNIV_PFS_RWLOCK
36+
# define SRW_LOCK_INIT(key) init(key)
37+
#else
38+
# define SRW_LOCK_INIT(key) init()
39+
#endif
40+
3541
class srw_lock final
3642
#if defined __linux__ && !defined SRW_LOCK_DUMMY
3743
: protected rw_lock
@@ -40,7 +46,7 @@ class srw_lock final
4046
#if defined SRW_LOCK_DUMMY || (!defined _WIN32 && !defined __linux__)
4147
mysql_rwlock_t lock;
4248
public:
43-
void init(mysql_pfs_key_t key) { mysql_rwlock_init(key, &lock); }
49+
void SRW_LOCK_INIT(mysql_pfs_key_t key) { mysql_rwlock_init(key, &lock); }
4450
void destroy() { mysql_rwlock_destroy(&lock); }
4551
void rd_lock() { mysql_rwlock_rdlock(&lock); }
4652
void rd_unlock() { mysql_rwlock_unlock(&lock); }
@@ -67,7 +73,7 @@ class srw_lock final
6773
# endif
6874

6975
public:
70-
void init(mysql_pfs_key_t key)
76+
void SRW_LOCK_INIT(mysql_pfs_key_t key)
7177
{
7278
# ifdef UNIV_PFS_RWLOCK
7379
pfs_psi= PSI_RWLOCK_CALL(init_rwlock)(key, this);
@@ -83,7 +89,7 @@ class srw_lock final
8389
pfs_psi= nullptr;
8490
}
8591
# endif
86-
DBUG_ASSERT(!is_locked_or_waiting());
92+
IF_WIN(, DBUG_ASSERT(!is_locked_or_waiting()));
8793
}
8894
void rd_lock()
8995
{

storage/innobase/trx/trx0i_s.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ trx_i_s_cache_init(
12631263
acquire trx_i_s_cache_t::rw_lock, rdlock
12641264
release trx_i_s_cache_t::rw_lock */
12651265

1266-
cache->rw_lock.init(trx_i_s_cache_lock_key);
1266+
cache->rw_lock.SRW_LOCK_INIT(trx_i_s_cache_lock_key);
12671267

12681268
cache->last_read = 0;
12691269

storage/innobase/trx/trx0purge.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void purge_sys_t::create()
175175
offset= 0;
176176
hdr_page_no= 0;
177177
hdr_offset= 0;
178-
latch.init(trx_purge_latch_key);
178+
latch.SRW_LOCK_INIT(trx_purge_latch_key);
179179
mutex_create(LATCH_ID_PURGE_SYS_PQ, &pq_mutex);
180180
truncate.current= NULL;
181181
truncate.last= NULL;

0 commit comments

Comments
 (0)