maria-developers team mailing list archive
Mailing list archive
Re: [Commits] cae1945: MDEV-9117: Client Server capability negotiation for MariaDB specific functionality
On 17.01.2016 20:09, Sergei Golubchik wrote:
On Jan 17, Oleksandr Byelkin wrote:
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 1240d5d..d07e0a4 100644
@@ -11729,18 +11731,38 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio,
+ if (!(client_capabilities & CLIENT_MYSQL))
+ // it is client with mariadb extensions
+ client_capabilities|= CLIENT_MYSQL;
Wait, why is this?
Jast to return it "as it was" if you think that it is not needed then I
What do you mean "return"? To whom?
I don't see why you may need to pretend that this is MySQL client, when
it is not.
OK. (I set it back when it has other name but yes now it has no sens)
+ ulonglong ext_client_capabilities=
+ (((ulonglong)uint4korr(net->read_pos + 28)) << 32);
+ if (ext_client_capabilities & MARIADB_CLIENT_EXTENDED_FLAGS)
+ client_capabilities|= ext_client_capabilities;
+ DBUG_PRINT("error", ("CLIENT_PROTOCOL_41: on, "
+ "CLIENT_LONG_PASSWORD/CLIENT_MYSQL off, "
+ "but MARIADB_CLIENT_EXTENDED_FLAGS is off. "
+ "flags: %llx ext flags %llx",
+ client_capabilities, ext_client_capabilities));
+ return packet_error;
Why do you need that (MARIADB_CLIENT_EXTENDED_FLAGS and the check)?
Server read or do not read more flags depend on it.
But !(client_capabilities & CLIENT_MYSQL) already tells you that.
It's a MariaDB client = it has extended flags.
As you saw it was not.
No, I did't. What do you mean "it was not"?
I meant flag CLIENT_MYSQL. But there is other function, report extended
functionality to client (clein also can understand that it is mariaDB
server, but the flag alwais set in extended flag area is additional check.