Commit 2628fa2d authored by Daniel Black's avatar Daniel Black

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.
parent ad0f0d2b
...@@ -1233,11 +1233,11 @@ bool pfs_show_status(handlerton *hton, THD *thd, ...@@ -1233,11 +1233,11 @@ bool pfs_show_status(handlerton *hton, THD *thd,
break; break;
case 141: case 141:
name= "(filename_hash).count"; name= "(filename_hash).count";
size= filename_hash.count; size= pfs_filename_hash.count;
break; break;
case 142: case 142:
name= "(filename_hash).size"; name= "(filename_hash).size";
size= filename_hash.size; size= pfs_filename_hash.size;
break; break;
case 143: case 143:
name= "(host_hash).count"; name= "(host_hash).count";
......
...@@ -143,7 +143,7 @@ PFS_thread *thread_array= NULL; ...@@ -143,7 +143,7 @@ PFS_thread *thread_array= NULL;
File instrumentation instances array. File instrumentation instances array.
@sa file_max @sa file_max
@sa file_lost @sa file_lost
@sa filename_hash @sa pfs_filename_hash
*/ */
PFS_file *file_array= NULL; PFS_file *file_array= NULL;
...@@ -189,8 +189,8 @@ static unsigned char *history_stmts_digest_token_array= NULL; ...@@ -189,8 +189,8 @@ static unsigned char *history_stmts_digest_token_array= NULL;
static char *thread_session_connect_attrs_array= NULL; static char *thread_session_connect_attrs_array= NULL;
/** Hash table for instrumented files. */ /** Hash table for instrumented files. */
LF_HASH filename_hash; LF_HASH pfs_filename_hash;
/** True if filename_hash is initialized. */ /** True if pfs_filename_hash is initialized. */
static bool filename_hash_inited= false; static bool filename_hash_inited= false;
/** /**
...@@ -586,7 +586,7 @@ int init_file_hash(void) ...@@ -586,7 +586,7 @@ int init_file_hash(void)
{ {
if ((! filename_hash_inited) && (file_max > 0)) if ((! filename_hash_inited) && (file_max > 0))
{ {
lf_hash_init(&filename_hash, sizeof(PFS_file*), LF_HASH_UNIQUE, lf_hash_init(&pfs_filename_hash, sizeof(PFS_file*), LF_HASH_UNIQUE,
0, 0, filename_hash_get_key, &my_charset_bin); 0, 0, filename_hash_get_key, &my_charset_bin);
/* filename_hash.size= file_max; */ /* filename_hash.size= file_max; */
filename_hash_inited= true; filename_hash_inited= true;
...@@ -599,7 +599,7 @@ void cleanup_file_hash(void) ...@@ -599,7 +599,7 @@ void cleanup_file_hash(void)
{ {
if (filename_hash_inited) if (filename_hash_inited)
{ {
lf_hash_destroy(&filename_hash); lf_hash_destroy(&pfs_filename_hash);
filename_hash_inited= false; filename_hash_inited= false;
} }
} }
...@@ -1186,7 +1186,7 @@ void destroy_thread(PFS_thread *pfs) ...@@ -1186,7 +1186,7 @@ void destroy_thread(PFS_thread *pfs)
} }
/** /**
Get the hash pins for @filename_hash. Get the hash pins for @pfs_filename_hash.
@param thread The running thread. @param thread The running thread.
@returns The LF_HASH pins for the thread. @returns The LF_HASH pins for the thread.
*/ */
...@@ -1196,7 +1196,7 @@ LF_PINS* get_filename_hash_pins(PFS_thread *thread) ...@@ -1196,7 +1196,7 @@ LF_PINS* get_filename_hash_pins(PFS_thread *thread)
{ {
if (! filename_hash_inited) if (! filename_hash_inited)
return NULL; return NULL;
thread->m_filename_hash_pins= lf_hash_get_pins(&filename_hash); thread->m_filename_hash_pins= lf_hash_get_pins(&pfs_filename_hash);
} }
return thread->m_filename_hash_pins; return thread->m_filename_hash_pins;
} }
...@@ -1314,7 +1314,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass, ...@@ -1314,7 +1314,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
search: search:
entry= reinterpret_cast<PFS_file**> entry= reinterpret_cast<PFS_file**>
(lf_hash_search(&filename_hash, pins, (lf_hash_search(&pfs_filename_hash, pins,
normalized_filename, normalized_length)); normalized_filename, normalized_length));
if (entry && (entry != MY_ERRPTR)) if (entry && (entry != MY_ERRPTR))
{ {
...@@ -1359,7 +1359,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass, ...@@ -1359,7 +1359,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
pfs->m_identity= (const void *)pfs; pfs->m_identity= (const void *)pfs;
int res; int res;
res= lf_hash_insert(&filename_hash, thread->m_filename_hash_pins, res= lf_hash_insert(&pfs_filename_hash, thread->m_filename_hash_pins,
&pfs); &pfs);
if (likely(res == 0)) if (likely(res == 0))
{ {
...@@ -1426,7 +1426,7 @@ void destroy_file(PFS_thread *thread, PFS_file *pfs) ...@@ -1426,7 +1426,7 @@ void destroy_file(PFS_thread *thread, PFS_file *pfs)
LF_PINS *pins= get_filename_hash_pins(thread); LF_PINS *pins= get_filename_hash_pins(thread);
DBUG_ASSERT(pins != NULL); DBUG_ASSERT(pins != NULL);
lf_hash_delete(&filename_hash, pins, lf_hash_delete(&pfs_filename_hash, pins,
pfs->m_filename, pfs->m_filename_length); pfs->m_filename, pfs->m_filename_length);
if (klass->is_singleton()) if (klass->is_singleton())
klass->m_singleton= NULL; klass->m_singleton= NULL;
......
...@@ -698,7 +698,7 @@ void update_socket_derived_flags(); ...@@ -698,7 +698,7 @@ void update_socket_derived_flags();
/** Update derived flags for all instruments. */ /** Update derived flags for all instruments. */
void update_instruments_derived_flags(); void update_instruments_derived_flags();
extern LF_HASH filename_hash; extern LF_HASH pfs_filename_hash;
/** @} */ /** @} */
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment