Skip to content

Commit c50ee6c

Browse files
author
Sergei Golubchik
committed
MDEV-4088 Replication 10.0 -> 5.5 fails
1 parent da7eca0 commit c50ee6c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

include/mysql_com.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
#define MYSQL50_TABLE_NAME_PREFIX_LENGTH (sizeof(MYSQL50_TABLE_NAME_PREFIX)-1)
3535
#define SAFE_NAME_LEN (NAME_LEN + MYSQL50_TABLE_NAME_PREFIX_LENGTH)
3636

37+
#ifdef EMBEDDED_LIBRARY
38+
#define RPL_VERSION_HACK ""
39+
#else
40+
/* this version must be the one that *does not* support pluggable auth */
41+
#define RPL_VERSION_HACK "5.5.5-"
42+
#endif
43+
3744
#define SERVER_VERSION_LENGTH 60
3845
#define SQLSTATE_LENGTH 5
3946
#define LIST_PROCESS_HOST_LEN 64

sql-common/client.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,6 +3416,12 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
34163416
strmov(mysql->server_version,(char*) net->read_pos+1);
34173417
mysql->port=port;
34183418

3419+
/* remove the rpl hack from the version string */
3420+
if (mysql->server_capabilities & CLIENT_PLUGIN_AUTH &&
3421+
strncmp(mysql->server_version, RPL_VERSION_HACK,
3422+
sizeof(RPL_VERSION_HACK) - 1) == 0)
3423+
mysql->server_version+= sizeof(RPL_VERSION_HACK) - 1;
3424+
34193425
if (pkt_end >= end + SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323 + 1)
34203426
{
34213427
/*

sql/sql_acl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7957,7 +7957,7 @@ static bool send_server_handshake_packet(MPVIO_EXT *mpvio,
79577957
data_len= SCRAMBLE_LENGTH;
79587958
}
79597959

7960-
end= strnmov(end, server_version, SERVER_VERSION_LENGTH) + 1;
7960+
end= strxnmov(end, SERVER_VERSION_LENGTH, RPL_VERSION_HACK, server_version, NullS) + 1;
79617961
int4store((uchar*) end, mpvio->thd->thread_id);
79627962
end+= 4;
79637963

0 commit comments

Comments
 (0)