[MDEV-9059] protocol: bundle first command with the authentication packet Created: 2015-11-02  Updated: 2022-04-25

Status: Stalled
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: Connectors

Issue Links:
Blocks
blocks CONJ-463 faster connection with bundle first c... Stalled
is blocked by CONC-149 protocol: bundle first command with t... Closed
Relates
relates to MXS-1574 Add support for bundled first command Closed
Sprint: 10.2.0-10, 10.2.0-11, 10.2.1-1, 10.2.1-3, 10.2.1-4, 10.2.1-5, 10.2.3-2

 Description   

Optimistically assuming that the authentication was successful, the client doesn't need to wait for the ok packet from the server, but can send the first command right away, including it in the authentication packet.

The idea is to store the command in separate buffer (or just make new network buffer) before authentication, then in case of success of the authentication execute it (auth itself can cause exchange of the packet that is why storing is requited).



 Comments   
Comment by Oleksandr Byelkin [ 2016-10-11 ]

revision-id: e52317b01a50ee51d703913fb046f5419432dc2f (mariadb-10.2.2-35-ge52317b)
parent(s): 553ca406cd44946d454d84c08a7247ef595378f5
committer: Oleksandr Byelkin
timestamp: 2016-10-11 15:56:54 +0200
message:

MDEV-9059: protocol: bundle first command with the authentication packet

Comment by Sergei Golubchik [ 2016-11-30 ]

does Connector/C support it?

Comment by Sergei Golubchik [ 2016-12-27 ]

waiting for CONC-149

Comment by Diego Dupin [ 2017-11-01 ]

protocol change :

new capability :

(number has now to change since 34 has been used for MARIADB_CLIENT_STMT_BULK_OPERATIONS, but that's what is implemented in branch)
MARIADB_CLIENT_COM_IN_AUTH = 1L << 34; /* support bundle first command with the authentication packet*/

Handshake response packet

  • int<4> client capabilities
  • int<4> max packet size
  • int<1> client character collation
  • string<19> reserved
  • if not (server_capabilities & CLIENT_MYSQL)
    • int<4> extended client capabilities
  • else
    • string<4> reserved
  • string<NUL> username
  • if (server_capabilities & PLUGIN_AUTH_LENENC_CLIENT_DATA)
    • string<lenenc> authentication data
  • else if (server_capabilities & CLIENT_SECURE_CONNECTION)
    • int<1> length of authentication response
    • string<fix> authentication response (length is indicated by previous field)
  • else
    • int<1> 0x00
  • if (server_capabilities & CLIENT_CONNECT_WITH_DB)
    • string<NUL> default schema name
  • if (server_capabilities & CLIENT_PLUGIN_AUTH)
    • string<NUL> authentication plugin name
  • if (server_capabilities & CLIENT_CONNECT_ATTRS)
    • int<lenenc> size of connection attributes
    • loop {
      • string<lenenc> key
      • string<lenenc> value
  • if (server_capabilities & MARIADB_CLIENT_COM_IN_AUTH)
    • int<lenenc> COM_MULTI command length
    • byte<xxx> COM_MULTI command, with xxx equal to command length

The result of this COM_MULTI command (if MARIADB_CLIENT_COM_IN_AUTH will be received after authentication is complete

COM_MULTI command

  • int<1> 0xfe (COM_MULTI header)
  • loop
    • byte<1> command header
    • string<xxx> command
Comment by Oleksandr Byelkin [ 2017-11-06 ]

github tree is bb-10.3-MDEV-9059

Comment by Oleksandr Byelkin [ 2017-11-07 ]

revision-id: d62ea85e6f6c273a712f951da907ced06f01bc03 (mariadb-10.3.2-39-gd62ea85e6f6)
parent(s): 2ba1616e5d0f7008d5f6bf2c6cbc439935f6138b
author: Oleksandr Byelkin
committer: Oleksandr Byelkin
timestamp: 2017-11-07 17:39:29 +0100
message:

MDEV-9059: protocol: bundle first command with the authentication packet

Comment by Oleksandr Byelkin [ 2017-11-07 ]

Now Georg add tests to connector C

Comment by Vladislav Vaintroub [ 2018-11-21 ]

Review done : commented on https://github.com/mariadb/server/commit/d62ea85e6f6c273a712f951da907ced06f01bc03

Generated at Thu Feb 08 07:31:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.