Skip to content

Commit 2628fa2

Browse files
committed
MDEV-20857: perf schema conflict name filename_hash
filename_hash is a function from libiberty.a from the system but also an expored name in the perf schema static library. We'll use a different name.
1 parent ad0f0d2 commit 2628fa2

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

storage/perfschema/pfs_engine_table.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,11 +1233,11 @@ bool pfs_show_status(handlerton *hton, THD *thd,
12331233
break;
12341234
case 141:
12351235
name= "(filename_hash).count";
1236-
size= filename_hash.count;
1236+
size= pfs_filename_hash.count;
12371237
break;
12381238
case 142:
12391239
name= "(filename_hash).size";
1240-
size= filename_hash.size;
1240+
size= pfs_filename_hash.size;
12411241
break;
12421242
case 143:
12431243
name= "(host_hash).count";

storage/perfschema/pfs_instr.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ PFS_thread *thread_array= NULL;
143143
File instrumentation instances array.
144144
@sa file_max
145145
@sa file_lost
146-
@sa filename_hash
146+
@sa pfs_filename_hash
147147
*/
148148
PFS_file *file_array= NULL;
149149

@@ -189,8 +189,8 @@ static unsigned char *history_stmts_digest_token_array= NULL;
189189
static char *thread_session_connect_attrs_array= NULL;
190190

191191
/** Hash table for instrumented files. */
192-
LF_HASH filename_hash;
193-
/** True if filename_hash is initialized. */
192+
LF_HASH pfs_filename_hash;
193+
/** True if pfs_filename_hash is initialized. */
194194
static bool filename_hash_inited= false;
195195

196196
/**
@@ -586,7 +586,7 @@ int init_file_hash(void)
586586
{
587587
if ((! filename_hash_inited) && (file_max > 0))
588588
{
589-
lf_hash_init(&filename_hash, sizeof(PFS_file*), LF_HASH_UNIQUE,
589+
lf_hash_init(&pfs_filename_hash, sizeof(PFS_file*), LF_HASH_UNIQUE,
590590
0, 0, filename_hash_get_key, &my_charset_bin);
591591
/* filename_hash.size= file_max; */
592592
filename_hash_inited= true;
@@ -599,7 +599,7 @@ void cleanup_file_hash(void)
599599
{
600600
if (filename_hash_inited)
601601
{
602-
lf_hash_destroy(&filename_hash);
602+
lf_hash_destroy(&pfs_filename_hash);
603603
filename_hash_inited= false;
604604
}
605605
}
@@ -1186,7 +1186,7 @@ void destroy_thread(PFS_thread *pfs)
11861186
}
11871187

11881188
/**
1189-
Get the hash pins for @filename_hash.
1189+
Get the hash pins for @pfs_filename_hash.
11901190
@param thread The running thread.
11911191
@returns The LF_HASH pins for the thread.
11921192
*/
@@ -1196,7 +1196,7 @@ LF_PINS* get_filename_hash_pins(PFS_thread *thread)
11961196
{
11971197
if (! filename_hash_inited)
11981198
return NULL;
1199-
thread->m_filename_hash_pins= lf_hash_get_pins(&filename_hash);
1199+
thread->m_filename_hash_pins= lf_hash_get_pins(&pfs_filename_hash);
12001200
}
12011201
return thread->m_filename_hash_pins;
12021202
}
@@ -1314,7 +1314,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
13141314
search:
13151315

13161316
entry= reinterpret_cast<PFS_file**>
1317-
(lf_hash_search(&filename_hash, pins,
1317+
(lf_hash_search(&pfs_filename_hash, pins,
13181318
normalized_filename, normalized_length));
13191319
if (entry && (entry != MY_ERRPTR))
13201320
{
@@ -1359,7 +1359,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
13591359
pfs->m_identity= (const void *)pfs;
13601360

13611361
int res;
1362-
res= lf_hash_insert(&filename_hash, thread->m_filename_hash_pins,
1362+
res= lf_hash_insert(&pfs_filename_hash, thread->m_filename_hash_pins,
13631363
&pfs);
13641364
if (likely(res == 0))
13651365
{
@@ -1426,7 +1426,7 @@ void destroy_file(PFS_thread *thread, PFS_file *pfs)
14261426
LF_PINS *pins= get_filename_hash_pins(thread);
14271427
DBUG_ASSERT(pins != NULL);
14281428

1429-
lf_hash_delete(&filename_hash, pins,
1429+
lf_hash_delete(&pfs_filename_hash, pins,
14301430
pfs->m_filename, pfs->m_filename_length);
14311431
if (klass->is_singleton())
14321432
klass->m_singleton= NULL;

storage/perfschema/pfs_instr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ void update_socket_derived_flags();
698698
/** Update derived flags for all instruments. */
699699
void update_instruments_derived_flags();
700700

701-
extern LF_HASH filename_hash;
701+
extern LF_HASH pfs_filename_hash;
702702

703703
/** @} */
704704
#endif

0 commit comments

Comments
 (0)