Revert "MXS-3301 Look for "xpand" to find out whether server is Xpand"

This reverts commit 4728730510409fc15d2b3a55fa6e00008651794d.

The clustrix -> xpand name change causes too much trouble when merging
to 2.5.
This commit is contained in:
Johan Wikman
2020-11-17 17:21:14 +02:00
parent 4728730510
commit 64ca695c84
5 changed files with 25 additions and 26 deletions

View File

@ -141,7 +141,7 @@ public:
{ {
MARIADB, MARIADB,
MYSQL, MYSQL,
XPAND CLUSTRIX
}; };
enum class RLagState enum class RLagState

View File

@ -1150,10 +1150,9 @@ void Server::VersionInfo::set(uint64_t version, const std::string& version_str)
m_version_num.patch = patch; m_version_num.patch = patch;
careful_strcpy(m_version_str, MAX_VERSION_LEN, version_str); careful_strcpy(m_version_str, MAX_VERSION_LEN, version_str);
if (strcasestr(version_str.c_str(), "xpand") != NULL if (strcasestr(version_str.c_str(), "clustrix") != NULL)
|| strcasestr(version_str.c_str(), "clustrix") != NULL)
{ {
m_type = Type::XPAND; m_type = Type::CLUSTRIX;
} }
else if (strcasestr(version_str.c_str(), "mariadb") != NULL) else if (strcasestr(version_str.c_str(), "mariadb") != NULL)
{ {

View File

@ -51,7 +51,7 @@ const char* mariadb_users_query_format =
"FROM mysql.user AS u LEFT JOIN mysql.tables_priv AS t " "FROM mysql.user AS u LEFT JOIN mysql.tables_priv AS t "
"ON (u.user = t.user AND u.host = t.host) WHERE u.plugin IN ('', 'mysql_native_password') %s"; "ON (u.user = t.user AND u.host = t.host) WHERE u.plugin IN ('', 'mysql_native_password') %s";
const char* xpand_users_query_format = const char* clustrix_users_query_format =
"SELECT u.username AS user, u.host, a.dbname AS db, " "SELECT u.username AS user, u.host, a.dbname AS db, "
" IF(a.privileges & 1048576, 'Y', 'N') AS select_priv, u.password " " IF(a.privileges & 1048576, 'Y', 'N') AS select_priv, u.password "
"FROM system.users AS u LEFT JOIN system.user_acl AS a ON (u.user = a.role) " "FROM system.users AS u LEFT JOIN system.user_acl AS a ON (u.user = a.role) "
@ -144,7 +144,7 @@ enum server_category_t
{ {
SERVER_NO_ROLES, SERVER_NO_ROLES,
SERVER_ROLES, SERVER_ROLES,
SERVER_XPAND SERVER_CLUSTRIX
}; };
static int get_users(Listener* listener, bool skip_local, SERVER** srv); static int get_users(Listener* listener, bool skip_local, SERVER** srv);
@ -208,7 +208,7 @@ static char* get_mariadb_users_query(bool include_root, const SERVER::Version& v
return rval; return rval;
} }
static char* get_xpand_users_query(bool include_root) static char* get_clustrix_users_query(bool include_root)
{ {
const char* with_root; const char* with_root;
@ -223,10 +223,10 @@ static char* get_xpand_users_query(bool include_root)
with_root = "AND u.username <> 'root'"; with_root = "AND u.username <> 'root'";
} }
size_t n_bytes = snprintf(NULL, 0, xpand_users_query_format, with_root); size_t n_bytes = snprintf(NULL, 0, clustrix_users_query_format, with_root);
char* rval = static_cast<char*>(MXS_MALLOC(n_bytes + 1)); char* rval = static_cast<char*>(MXS_MALLOC(n_bytes + 1));
MXS_ABORT_IF_NULL(rval); MXS_ABORT_IF_NULL(rval);
snprintf(rval, n_bytes + 1, xpand_users_query_format, with_root); snprintf(rval, n_bytes + 1, clustrix_users_query_format, with_root);
return rval; return rval;
} }
@ -243,8 +243,8 @@ static char* get_users_query(const SERVER::Version& version, bool include_root,
get_mariadb_101_users_query(include_root); get_mariadb_101_users_query(include_root);
break; break;
case SERVER_XPAND: case SERVER_CLUSTRIX:
rval = get_xpand_users_query(include_root); rval = get_clustrix_users_query(include_root);
break; break;
case SERVER_NO_ROLES: case SERVER_NO_ROLES:
@ -866,14 +866,14 @@ static bool check_default_table_permissions(MYSQL* mysql,
} }
/** /**
* @brief Check table permissions on a Xpand server * @brief Check table permissions on a Clustrix server
* *
* @return True if the table permissions are OK, false otherwise. * @return True if the table permissions are OK, false otherwise.
*/ */
static bool check_xpand_table_permissions(MYSQL* mysql, static bool check_clustrix_table_permissions(MYSQL* mysql,
SERVICE* service, SERVICE* service,
SERVER* server, SERVER* server,
const char* user) const char* user)
{ {
bool rval = true; bool rval = true;
@ -948,9 +948,9 @@ static bool check_server_permissions(SERVICE* service,
} }
bool rval = true; bool rval = true;
if (server->type() == SERVER::Type::XPAND) if (server->type() == SERVER::Type::CLUSTRIX)
{ {
rval = check_xpand_table_permissions(mysql, service, server, user); rval = check_clustrix_table_permissions(mysql, service, server, user);
} }
else else
{ {
@ -1113,9 +1113,9 @@ struct User
bool query_and_process_users(const char* query, MYSQL* con, SERVICE* service, int* users, bool query_and_process_users(const char* query, MYSQL* con, SERVICE* service, int* users,
std::vector<User>* userlist, server_category_t category) std::vector<User>* userlist, server_category_t category)
{ {
// Xpand does not have a mysql database. If non-xpand we set the // Clustrix does not have a mysql database. If non-clustrix we set the
// default database in case CTEs are used. // default database in case CTEs are used.
bool rval = (category == SERVER_XPAND || mxs_mysql_query(con, "USE mysql") == 0); bool rval = (category == SERVER_CLUSTRIX || mxs_mysql_query(con, "USE mysql") == 0);
if (rval && mxs_mysql_query(con, query) == 0) if (rval && mxs_mysql_query(con, query) == 0)
{ {
@ -1197,9 +1197,9 @@ int get_users_from_server(MYSQL* con, SERVER* server, SERVICE* service, Listener
} }
server_category_t category; server_category_t category;
if (server->type() == SERVER::Type::XPAND) if (server->type() == SERVER::Type::CLUSTRIX)
{ {
category = SERVER_XPAND; category = SERVER_CLUSTRIX;
} }
else if (roles_are_available(con, service, server)) else if (roles_are_available(con, service, server))
{ {

View File

@ -232,7 +232,7 @@ bool MariaDBServer::do_show_slave_status(string* errmsg_out)
unsigned int columns = 0; unsigned int columns = 0;
string query; string query;
bool all_slaves_status = false; bool all_slaves_status = false;
if (m_srv_type == server_type::XPAND) if (m_srv_type == server_type::CLUSTRIX)
{ {
return false; return false;
} }
@ -898,9 +898,9 @@ void MariaDBServer::update_server_version()
m_srv_type = server_type::UNKNOWN; // TODO: Use type information in SERVER directly m_srv_type = server_type::UNKNOWN; // TODO: Use type information in SERVER directly
auto base_server_type = srv->type(); auto base_server_type = srv->type();
MYSQL_RES* result; MYSQL_RES* result;
if (base_server_type == SERVER::Type::XPAND) if (base_server_type == SERVER::Type::CLUSTRIX)
{ {
m_srv_type = server_type::XPAND; m_srv_type = server_type::CLUSTRIX;
} }
// Check whether this server is a MaxScale Binlog Server. // Check whether this server is a MaxScale Binlog Server.
else if (mxs_mysql_query(conn, "SELECT @@maxscale_version") == 0 else if (mxs_mysql_query(conn, "SELECT @@maxscale_version") == 0

View File

@ -89,7 +89,7 @@ public:
UNKNOWN, /* Totally unknown. Server has not been connected to yet. */ UNKNOWN, /* Totally unknown. Server has not been connected to yet. */
NORMAL, /* A normal MariaDB/MySQL server, possibly supported. */ NORMAL, /* A normal MariaDB/MySQL server, possibly supported. */
BINLOG_ROUTER, /* MaxScale binlog server. Requires special handling. */ BINLOG_ROUTER, /* MaxScale binlog server. Requires special handling. */
XPAND /* Xpand server. Requires special handling. */ CLUSTRIX /* Clustrix server. Requires special handling. */
}; };
enum class BinlogMode enum class BinlogMode