[MDEV-9058] protocol: COM_MULTI command Created: 2015-11-02  Updated: 2020-09-09  Resolved: 2016-03-18

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: 10.2.0

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 2
Labels: None

Issue Links:
Blocks
blocks MDEV-10169 Optimize INSERT for COM_MULTI batch Closed
Relates
relates to CONC-157 COM_MULTI support Open
relates to MDEV-9117 Client Server capability negotiation ... Closed
relates to MDEV-9947 COM_MULTI united response Closed
relates to CONJ-296 Support COM_MULTI Closed
Sprint: 10.2.0-2, 10.2.0-3, 10.2.0-4, 10.2.0-5, 10.2.0-8, 10.1.13

 Description   

Implement COM_MULTI protocol command. Just as COM_QUERY support multiple queries in one packet, COM_MULTI will bundle many COM_xxx commands in one packet.

May be the server should only support COM_MULTI if CLIENT_MULTI_RESULTS flag is set? Probably not

Packets included in one COM_MULTI probably do not need packet number as well as separate compression, so only 3 bytes of length for each.

For prepared statement to be able prepare / execute / deallocate the command in one COM_MULTI batch will be special prepared statement ID (0 or -1) which mean ID of previous command.

Packet structure:

  • 4 or 7 bytes: of packet header (read by my_real_read())
  • 1 byte: COM_MULTI
    • 3 bytes: length of subcommand 1
    • N1 bytes: subcommand1
    • 3 bytes: length of subcommand 2
    • N2 bytes: subcommand 2
      ...
    • 3 bytes: length of subcommand m
    • Nm bytes: subcommand m

COM_MULTI should be numbered from the "end" i.e. 255

There should be capability flag for it.



 Comments   
Comment by Oleksandr Byelkin [ 2016-01-08 ]

I'll send you a dif also it can be reviewed on bb-sanja-10.2 on github, commits:

commit b92189b69d68a560240692d84155095607337ce5
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date: Fri Jan 8 12:55:34 2016 +0100

Check ability to accept multi-results.

commit 3704e74a38d74cd33e6889c81f0abcf8e4515ddb
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date: Thu Jan 7 19:06:38 2016 +0100

Last statement fix after talk to wlad.

commit 4474a9c0b5d657723bf01124c0689ad6de03fecf
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date: Thu Jan 7 16:00:02 2016 +0100

MDEV-9058: protocol: COM_MULTI command (part 3)

Support of "previuousely used statement ID".
All IDs with highest bit ON reserved for special use.

commit 6c48449d90dc94bc58af0ef7adcf019a11014193
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date: Tue Jan 5 20:44:45 2016 +0100

MDEV-9058: protocol: COM_MULTI command (part 2)

simple COM_MULTI support (no prepared statements chain yet).

commit b78a53f18337c1c457b99e0ddb2da709c289fab2
Author: Oleksandr Byelkin <sanja@mariadb.com>
Date: Thu Nov 26 11:21:56 2015 +0100

MDEV-9058: protocol: COM_MULTI command (part 1)

Adding a command from the end of avaliable commands numering space (255)

Comment by Oleksandr Byelkin [ 2016-01-13 ]

Everything mentioned in the review answered on replies to review e-mail or fixed in this revisions:

revision-id: ec9b1f6f6d95d9a004d38dac4927fbd7512b7752 (mariadb-10.1.8-75-gec9b1f6)
parent(s): b92189b69d68a560240692d84155095607337ce5
committer: Oleksandr Byelkin
timestamp: 2016-01-13 19:36:00 +0100
message:

MDEV-9058: post-review changes.

revision-id: 65d0c9f8b8ea24ab6a5443bcde01880b081215c5 (mariadb-10.1.8-76-g65d0c9f)
parent(s): ec9b1f6f6d95d9a004d38dac4927fbd7512b7752
committer: Oleksandr Byelkin
timestamp: 2016-01-13 19:52:27 +0100
message:

MDEV-9058: usage of flags explained

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