summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/table.cc13
-rw-r--r--sql/wsrep_schema.cc5
-rw-r--r--sql/wsrep_schema.h5
3 files changed, 15 insertions, 8 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 0f296a85e58..44d639e27a4 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -45,6 +45,9 @@
#include "ha_sequence.h"
#include "sql_show.h"
#include "opt_trace.h"
+#ifdef WITH_WSREP
+#include "wsrep_schema.h"
+#endif
/* For MySQL 5.7 virtual fields */
#define MYSQL57_GENERATED_FIELD 128
@@ -264,10 +267,14 @@ TABLE_CATEGORY get_table_category(const LEX_CSTRING *db,
DBUG_ASSERT(name != NULL);
#ifdef WITH_WSREP
- if (my_strcasecmp(system_charset_info, db->str, "mysql") == 0 &&
- my_strcasecmp(system_charset_info, name->str, "wsrep_streaming_log") == 0)
+ if (my_strcasecmp(system_charset_info, db->str, WSREP_SCHEMA) == 0)
{
- return TABLE_CATEGORY_INFORMATION;
+ if ((my_strcasecmp(system_charset_info, name->str, WSREP_STREAMING_TABLE) == 0 ||
+ my_strcasecmp(system_charset_info, name->str, WSREP_CLUSTER_TABLE) == 0 ||
+ my_strcasecmp(system_charset_info, name->str, WSREP_MEMBERS_TABLE) == 0))
+ {
+ return TABLE_CATEGORY_INFORMATION;
+ }
}
#endif /* WITH_WSREP */
if (is_infoschema_db(db))
diff --git a/sql/wsrep_schema.cc b/sql/wsrep_schema.cc
index 1bc8dd5c98f..94eef413dc5 100644
--- a/sql/wsrep_schema.cc
+++ b/sql/wsrep_schema.cc
@@ -35,11 +35,6 @@
#include <string>
#include <sstream>
-#define WSREP_SCHEMA "mysql"
-#define WSREP_STREAMING_TABLE "wsrep_streaming_log"
-#define WSREP_CLUSTER_TABLE "wsrep_cluster"
-#define WSREP_MEMBERS_TABLE "wsrep_cluster_members"
-
const char* wsrep_sr_table_name_full= WSREP_SCHEMA "/" WSREP_STREAMING_TABLE;
static const std::string wsrep_schema_str= WSREP_SCHEMA;
diff --git a/sql/wsrep_schema.h b/sql/wsrep_schema.h
index 36e23998d19..979b175481c 100644
--- a/sql/wsrep_schema.h
+++ b/sql/wsrep_schema.h
@@ -33,6 +33,11 @@ struct TABLE_LIST;
struct st_mysql_lex_string;
typedef struct st_mysql_lex_string LEX_STRING;
+#define WSREP_SCHEMA "mysql"
+#define WSREP_STREAMING_TABLE "wsrep_streaming_log"
+#define WSREP_CLUSTER_TABLE "wsrep_cluster"
+#define WSREP_MEMBERS_TABLE "wsrep_cluster_members"
+
/** Name of the table in `wsrep_schema_str` used for storing streaming
replication data. In an InnoDB full format, e.g. "database/tablename". */
extern const char* wsrep_sr_table_name_full;