summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-05-24 17:35:30 +0200
committerSergei Golubchik <sergii@pisem.net>2013-05-24 17:35:30 +0200
commit34ebf981abaa8a0b9e5557a56d17e8daa0273bdf (patch)
treed815bff43f3ddb3a2dc77e234c6ed38d69f0d2a1
parent3b3f870994299c905627c7925c4af473e948d78d (diff)
downloadmariadb-git-34ebf981abaa8a0b9e5557a56d17e8daa0273bdf.tar.gz
MDEV-4575 MySQL client doesn't strip off 5.5.5- prefix while connecting to 10.x server
extend 5.1 client library to read 4 byte capabilities from the first handshake packet. two higher bytes are always zeros for 5.1 servers.
-rw-r--r--sql-common/client.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index a1f3909c023..55c73eb382c 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -2221,6 +2221,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* New protocol with 16 bytes to describe server characteristics */
mysql->server_language=end[2];
mysql->server_status=uint2korr(end+3);
+ mysql->server_capabilities|= uint2korr(end+5) << 16;
}
end+= 18;
if (pkt_length >= (uint) (end + SCRAMBLE_LENGTH - SCRAMBLE_LENGTH_323 + 1 -