You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
MariaDB Server detection fix
Use mariadb_connection() instead of checking 5.5.5 rpl hack to detect if we are connected to a MariaDB Server.
This commit is contained in:
@@ -1356,7 +1356,6 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
|
|||||||
MA_PVIO_CINFO cinfo= {NULL, NULL, 0, -1, NULL};
|
MA_PVIO_CINFO cinfo= {NULL, NULL, 0, -1, NULL};
|
||||||
MARIADB_PVIO *pvio= NULL;
|
MARIADB_PVIO *pvio= NULL;
|
||||||
char *scramble_data;
|
char *scramble_data;
|
||||||
my_bool is_maria= 0;
|
|
||||||
const char *scramble_plugin;
|
const char *scramble_plugin;
|
||||||
uint pkt_length, scramble_len, pkt_scramble_len= 0;
|
uint pkt_length, scramble_len, pkt_scramble_len= 0;
|
||||||
NET *net= &mysql->net;
|
NET *net= &mysql->net;
|
||||||
@@ -1566,7 +1565,6 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
|
|||||||
if (strncmp(end, MA_RPL_VERSION_HACK, sizeof(MA_RPL_VERSION_HACK) - 1) == 0)
|
if (strncmp(end, MA_RPL_VERSION_HACK, sizeof(MA_RPL_VERSION_HACK) - 1) == 0)
|
||||||
{
|
{
|
||||||
mysql->server_version= strdup(end + sizeof(MA_RPL_VERSION_HACK) - 1);
|
mysql->server_version= strdup(end + sizeof(MA_RPL_VERSION_HACK) - 1);
|
||||||
is_maria= 1;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1575,7 +1573,6 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
|
|||||||
SET_CLIENT_ERROR(mysql, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
|
SET_CLIENT_ERROR(mysql, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
is_maria= mariadb_connection(mysql);
|
|
||||||
}
|
}
|
||||||
end+= strlen(end) + 1;
|
end+= strlen(end) + 1;
|
||||||
|
|
||||||
@@ -1606,7 +1603,7 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
|
|||||||
pkt_scramble_len= uint1korr(end + 7);
|
pkt_scramble_len= uint1korr(end + 7);
|
||||||
|
|
||||||
/* check if MariaD2B specific capabilities are available */
|
/* check if MariaD2B specific capabilities are available */
|
||||||
if (is_maria && !(mysql->server_capabilities & CLIENT_MYSQL))
|
if (mariadb_connection(mysql) && !(mysql->server_capabilities & CLIENT_MYSQL))
|
||||||
{
|
{
|
||||||
mysql->extension->mariadb_server_capabilities= (ulonglong) uint4korr(end + 14);
|
mysql->extension->mariadb_server_capabilities= (ulonglong) uint4korr(end + 14);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user