Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-9059

protocol: bundle first command with the authentication packet

Details

    • Task
    • Status: Stalled (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • None
    • 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).

      Attachments

        Issue Links

          Activity

            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

            sanja Oleksandr Byelkin added a comment - 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 —

            does Connector/C support it?

            serg Sergei Golubchik added a comment - does Connector/C support it?

            waiting for CONC-149

            serg Sergei Golubchik added a comment - waiting for CONC-149
            diego dupin Diego Dupin added a comment - - edited

            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
            diego dupin Diego Dupin added a comment - - edited 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

            github tree is bb-10.3-MDEV-9059

            sanja Oleksandr Byelkin added a comment - github tree is bb-10.3- MDEV-9059

            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

            sanja Oleksandr Byelkin added a comment - 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 —

            Now Georg add tests to connector C

            sanja Oleksandr Byelkin added a comment - Now Georg add tests to connector C
            wlad Vladislav Vaintroub added a comment - Review done : commented on https://github.com/mariadb/server/commit/d62ea85e6f6c273a712f951da907ced06f01bc03

            People

              sanja Oleksandr Byelkin
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.