summaryrefslogtreecommitdiff
path: root/storage/perfschema
diff options
context:
space:
mode:
Diffstat (limited to 'storage/perfschema')
-rw-r--r--storage/perfschema/ha_perfschema.cc3
-rw-r--r--storage/perfschema/ha_perfschema.h2
-rw-r--r--storage/perfschema/pfs_engine_table.cc6
-rw-r--r--storage/perfschema/pfs_engine_table.h4
-rw-r--r--storage/perfschema/pfs_instr.cc20
-rw-r--r--storage/perfschema/pfs_instr.h2
-rw-r--r--storage/perfschema/pfs_server.h2
-rw-r--r--storage/perfschema/table_setup_actors.cc2
-rw-r--r--storage/perfschema/table_setup_actors.h2
-rw-r--r--storage/perfschema/table_setup_objects.cc2
-rw-r--r--storage/perfschema/table_setup_objects.h2
-rw-r--r--storage/perfschema/unittest/pfs_server_stubs.cc2
12 files changed, 23 insertions, 26 deletions
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index 0754bb5a7e7..8860046fa26 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -27,7 +27,6 @@
#include "sql_plugin.h"
#include "my_pthread.h"
-#include "my_atomic.h"
#include "ha_perfschema.h"
#include "pfs_engine_table.h"
#include "pfs_column_values.h"
@@ -258,7 +257,7 @@ int ha_perfschema::close(void)
DBUG_RETURN(0);
}
-int ha_perfschema::write_row(uchar *buf)
+int ha_perfschema::write_row(const uchar *buf)
{
int result;
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index dd57ff31088..18ac035831d 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -127,7 +127,7 @@ public:
@param buf the row to write
@return 0 on success
*/
- int write_row(uchar *buf);
+ int write_row(const uchar *buf);
void use_hidden_primary_key();
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 46937d00ecf..acab0e73a3d 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -185,7 +185,7 @@ ha_rows PFS_engine_table_share::get_row_count(void) const
return m_records;
}
-int PFS_engine_table_share::write_row(TABLE *table, unsigned char *buf,
+int PFS_engine_table_share::write_row(TABLE *table, const unsigned char *buf,
Field **fields) const
{
if (m_write_row == NULL)
@@ -1233,11 +1233,11 @@ bool pfs_show_status(handlerton *hton, THD *thd,
break;
case 141:
name= "(filename_hash).count";
- size= filename_hash.count;
+ size= pfs_filename_hash.count;
break;
case 142:
name= "(filename_hash).size";
- size= filename_hash.size;
+ size= pfs_filename_hash.size;
break;
case 143:
name= "(host_hash).count";
diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h
index 52ad203db24..03a2b6a9d28 100644
--- a/storage/perfschema/pfs_engine_table.h
+++ b/storage/perfschema/pfs_engine_table.h
@@ -207,7 +207,7 @@ protected:
typedef PFS_engine_table* (*pfs_open_table_t)(void);
/** Callback to write a row. */
typedef int (*pfs_write_row_t)(TABLE *table,
- unsigned char *buf, Field **fields);
+ const unsigned char *buf, Field **fields);
/** Callback to delete all rows. */
typedef int (*pfs_delete_all_rows_t)(void);
/** Callback to get a row count. */
@@ -224,7 +224,7 @@ struct PFS_engine_table_share
/** Get the row count. */
ha_rows get_row_count(void) const;
/** Write a row. */
- int write_row(TABLE *table, unsigned char *buf, Field **fields) const;
+ int write_row(TABLE *table, const unsigned char *buf, Field **fields) const;
/** Table name. */
LEX_STRING m_name;
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index ca9e0385021..fd8da77fe40 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -143,7 +143,7 @@ PFS_thread *thread_array= NULL;
File instrumentation instances array.
@sa file_max
@sa file_lost
- @sa filename_hash
+ @sa pfs_filename_hash
*/
PFS_file *file_array= NULL;
@@ -189,8 +189,8 @@ static unsigned char *history_stmts_digest_token_array= NULL;
static char *thread_session_connect_attrs_array= NULL;
/** Hash table for instrumented files. */
-LF_HASH filename_hash;
-/** True if filename_hash is initialized. */
+LF_HASH pfs_filename_hash;
+/** True if pfs_filename_hash is initialized. */
static bool filename_hash_inited= false;
/**
@@ -586,7 +586,7 @@ int init_file_hash(void)
{
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);
/* filename_hash.size= file_max; */
filename_hash_inited= true;
@@ -599,7 +599,7 @@ void cleanup_file_hash(void)
{
if (filename_hash_inited)
{
- lf_hash_destroy(&filename_hash);
+ lf_hash_destroy(&pfs_filename_hash);
filename_hash_inited= false;
}
}
@@ -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.
@returns The LF_HASH pins for the thread.
*/
@@ -1196,7 +1196,7 @@ LF_PINS* get_filename_hash_pins(PFS_thread *thread)
{
if (! filename_hash_inited)
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;
}
@@ -1314,7 +1314,7 @@ find_or_create_file(PFS_thread *thread, PFS_file_class *klass,
search:
entry= reinterpret_cast<PFS_file**>
- (lf_hash_search(&filename_hash, pins,
+ (lf_hash_search(&pfs_filename_hash, pins,
normalized_filename, normalized_length));
if (entry && (entry != MY_ERRPTR))
{
@@ -1359,7 +1359,7 @@ search:
pfs->m_identity= (const void *)pfs;
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);
if (likely(res == 0))
{
@@ -1426,7 +1426,7 @@ void destroy_file(PFS_thread *thread, PFS_file *pfs)
LF_PINS *pins= get_filename_hash_pins(thread);
DBUG_ASSERT(pins != NULL);
- lf_hash_delete(&filename_hash, pins,
+ lf_hash_delete(&pfs_filename_hash, pins,
pfs->m_filename, pfs->m_filename_length);
if (klass->is_singleton())
klass->m_singleton= NULL;
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index 81bc52d1d75..a5ff3b4a17d 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -698,7 +698,7 @@ void update_socket_derived_flags();
/** Update derived flags for all instruments. */
void update_instruments_derived_flags();
-extern LF_HASH filename_hash;
+extern LF_HASH pfs_filename_hash;
/** @} */
#endif
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h
index 3457a91d376..9f904e6545b 100644
--- a/storage/perfschema/pfs_server.h
+++ b/storage/perfschema/pfs_server.h
@@ -35,7 +35,7 @@
#define PFS_MAX_RWLOCK_CLASS 40
#endif
#ifndef PFS_MAX_COND_CLASS
- #define PFS_MAX_COND_CLASS 80
+ #define PFS_MAX_COND_CLASS 90
#endif
#ifndef PFS_MAX_THREAD_CLASS
#define PFS_MAX_THREAD_CLASS 50
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index f1f1b4b008f..f18d6ceee20 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -59,7 +59,7 @@ PFS_engine_table* table_setup_actors::create()
return new table_setup_actors();
}
-int table_setup_actors::write_row(TABLE *table, unsigned char *buf,
+int table_setup_actors::write_row(TABLE *table, const unsigned char *buf,
Field **fields)
{
Field *f;
diff --git a/storage/perfschema/table_setup_actors.h b/storage/perfschema/table_setup_actors.h
index 748c57850b0..6bfc480a9c5 100644
--- a/storage/perfschema/table_setup_actors.h
+++ b/storage/perfschema/table_setup_actors.h
@@ -62,7 +62,7 @@ public:
static PFS_engine_table_share m_share;
/** Table builder. */
static PFS_engine_table* create();
- static int write_row(TABLE *table, unsigned char *buf, Field **fields);
+ static int write_row(TABLE *table, const unsigned char *buf, Field **fields);
static int delete_all_rows();
static ha_rows get_row_count();
diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc
index af6481ae98c..f3d11b7f26f 100644
--- a/storage/perfschema/table_setup_objects.cc
+++ b/storage/perfschema/table_setup_objects.cc
@@ -73,7 +73,7 @@ PFS_engine_table* table_setup_objects::create(void)
return new table_setup_objects();
}
-int table_setup_objects::write_row(TABLE *table, unsigned char *buf,
+int table_setup_objects::write_row(TABLE *table, const unsigned char *buf,
Field **fields)
{
int result;
diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h
index 560346c577f..570acc865ad 100644
--- a/storage/perfschema/table_setup_objects.h
+++ b/storage/perfschema/table_setup_objects.h
@@ -65,7 +65,7 @@ public:
static PFS_engine_table_share m_share;
/** Table builder. */
static PFS_engine_table* create();
- static int write_row(TABLE *table, unsigned char *buf, Field **fields);
+ static int write_row(TABLE *table, const unsigned char *buf, Field **fields);
static int delete_all_rows();
static ha_rows get_row_count();
diff --git a/storage/perfschema/unittest/pfs_server_stubs.cc b/storage/perfschema/unittest/pfs_server_stubs.cc
index db1600faf9f..0cabce37e51 100644
--- a/storage/perfschema/unittest/pfs_server_stubs.cc
+++ b/storage/perfschema/unittest/pfs_server_stubs.cc
@@ -31,8 +31,6 @@
struct sql_digest_storage;
-volatile bool ready_to_exit= false;
-
uint lower_case_table_names= 0;
CHARSET_INFO *files_charset_info= NULL;
CHARSET_INFO *system_charset_info= NULL;