Skip to content

Commit

Permalink
MXS-3301 Rename clustrix -> xpand everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Wikman committed Nov 19, 2020
1 parent 47e1c04 commit 5657588
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion include/maxscale/server.hh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public:
{
MARIADB,
MYSQL,
CLUSTRIX
XPAND
};

enum class RLagState
Expand Down
2 changes: 1 addition & 1 deletion server/core/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ void Server::VersionInfo::set(uint64_t version, const std::string& version_str)
if (strcasestr(version_str.c_str(), "xpand") != NULL
|| strcasestr(version_str.c_str(), "clustrix") != NULL)
{
m_type = Type::CLUSTRIX;
m_type = Type::XPAND;
}
else if (strcasestr(version_str.c_str(), "mariadb") != NULL)
{
Expand Down
36 changes: 18 additions & 18 deletions server/modules/authenticator/MariaDBAuth/dbusers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const char* mariadb_users_query_format =
"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";

const char* clustrix_users_query_format =
const char* xpand_users_query_format =
"SELECT u.username AS user, u.host, a.dbname AS db, "
" 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) "
Expand Down Expand Up @@ -144,7 +144,7 @@ enum server_category_t
{
SERVER_NO_ROLES,
SERVER_ROLES,
SERVER_CLUSTRIX
SERVER_XPAND
};

static int get_users(Listener* listener, bool skip_local, SERVER** srv);
Expand Down Expand Up @@ -208,7 +208,7 @@ static char* get_mariadb_users_query(bool include_root, const SERVER::Version& v
return rval;
}

static char* get_clustrix_users_query(bool include_root)
static char* get_xpand_users_query(bool include_root)
{
const char* with_root;

Expand All @@ -223,10 +223,10 @@ static char* get_clustrix_users_query(bool include_root)
with_root = "AND u.username <> 'root'";
}

size_t n_bytes = snprintf(NULL, 0, clustrix_users_query_format, with_root);
size_t n_bytes = snprintf(NULL, 0, xpand_users_query_format, with_root);
char* rval = static_cast<char*>(MXS_MALLOC(n_bytes + 1));
MXS_ABORT_IF_NULL(rval);
snprintf(rval, n_bytes + 1, clustrix_users_query_format, with_root);
snprintf(rval, n_bytes + 1, xpand_users_query_format, with_root);

return rval;
}
Expand All @@ -243,8 +243,8 @@ static char* get_users_query(const SERVER::Version& version, bool include_root,
get_mariadb_101_users_query(include_root);
break;

case SERVER_CLUSTRIX:
rval = get_clustrix_users_query(include_root);
case SERVER_XPAND:
rval = get_xpand_users_query(include_root);
break;

case SERVER_NO_ROLES:
Expand Down Expand Up @@ -866,14 +866,14 @@ static bool check_default_table_permissions(MYSQL* mysql,
}

/**
* @brief Check table permissions on a Clustrix server
* @brief Check table permissions on a Xpand server
*
* @return True if the table permissions are OK, false otherwise.
*/
static bool check_clustrix_table_permissions(MYSQL* mysql,
SERVICE* service,
SERVER* server,
const char* user)
static bool check_xpand_table_permissions(MYSQL* mysql,
SERVICE* service,
SERVER* server,
const char* user)
{
bool rval = true;

Expand Down Expand Up @@ -948,9 +948,9 @@ static bool check_server_permissions(SERVICE* service,
}

bool rval = true;
if (server->type() == SERVER::Type::CLUSTRIX)
if (server->type() == SERVER::Type::XPAND)
{
rval = check_clustrix_table_permissions(mysql, service, server, user);
rval = check_xpand_table_permissions(mysql, service, server, user);
}
else
{
Expand Down Expand Up @@ -1113,9 +1113,9 @@ struct User
bool query_and_process_users(const char* query, MYSQL* con, SERVICE* service, int* users,
std::vector<User>* userlist, server_category_t category)
{
// Clustrix does not have a mysql database. If non-clustrix we set the
// Xpand does not have a mysql database. If non-xpand we set the
// default database in case CTEs are used.
bool rval = (category == SERVER_CLUSTRIX || mxs_mysql_query(con, "USE mysql") == 0);
bool rval = (category == SERVER_XPAND || mxs_mysql_query(con, "USE mysql") == 0);

if (rval && mxs_mysql_query(con, query) == 0)
{
Expand Down Expand Up @@ -1197,9 +1197,9 @@ int get_users_from_server(MYSQL* con, SERVER* server, SERVICE* service, Listener
}

server_category_t category;
if (server->type() == SERVER::Type::CLUSTRIX)
if (server->type() == SERVER::Type::XPAND)
{
category = SERVER_CLUSTRIX;
category = SERVER_XPAND;
}
else if (roles_are_available(con, service, server))
{
Expand Down
6 changes: 3 additions & 3 deletions server/modules/monitor/mariadbmon/mariadbserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ bool MariaDBServer::do_show_slave_status(string* errmsg_out)
unsigned int columns = 0;
string query;
bool all_slaves_status = false;
if (m_srv_type == server_type::CLUSTRIX)
if (m_srv_type == server_type::XPAND)
{
return false;
}
Expand Down Expand Up @@ -898,9 +898,9 @@ void MariaDBServer::update_server_version()
m_srv_type = server_type::UNKNOWN; // TODO: Use type information in SERVER directly
auto base_server_type = srv->type();
MYSQL_RES* result;
if (base_server_type == SERVER::Type::CLUSTRIX)
if (base_server_type == SERVER::Type::XPAND)
{
m_srv_type = server_type::CLUSTRIX;
m_srv_type = server_type::XPAND;
}
// Check whether this server is a MaxScale Binlog Server.
else if (mxs_mysql_query(conn, "SELECT @@maxscale_version") == 0
Expand Down
2 changes: 1 addition & 1 deletion server/modules/monitor/mariadbmon/mariadbserver.hh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public:
UNKNOWN, /* Totally unknown. Server has not been connected to yet. */
NORMAL, /* A normal MariaDB/MySQL server, possibly supported. */
BINLOG_ROUTER, /* MaxScale binlog server. Requires special handling. */
CLUSTRIX /* Clustrix server. Requires special handling. */
XPAND /* Xpand server. Requires special handling. */
};

enum class BinlogMode
Expand Down

0 comments on commit 5657588

Please sign in to comment.