From 8f161511d4567a348b142e760fe12e3bafce72cc Mon Sep 17 00:00:00 2001 From: Daniyaal Khan Date: Thu, 30 Jan 2025 10:16:30 +0530 Subject: [PATCH 1/2] Added documentation for unused bits at the end of Protocol::ColumnDefinition41 --- sql/protocol_classic.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/protocol_classic.cc b/sql/protocol_classic.cc index 5a9eb6d4b432..5b8c2a080357 100644 --- a/sql/protocol_classic.cc +++ b/sql/protocol_classic.cc @@ -3096,6 +3096,9 @@ bool Protocol_classic::end_result_metadata() {
  • 0x1f for dynamic strings, double, float
  • 0x00 to 0x51 for decimals
  • + @ref a_protocol_type_int2 "int<2>" + reserved + reserved. All 0s. @note `decimals` and `column_length` can be used for text output formatting From 16cb589e8bce7d1bc375b7c2ee702e643fab7833 Mon Sep 17 00:00:00 2001 From: Daniyaal Khan Date: Wed, 26 Feb 2025 21:22:41 +0530 Subject: [PATCH 2/2] Document previously undocumented behavior regarding the sending of default values in ColumnDefinition for CLIENT_PROTOCOL_41, along with a quick grammatical fix in mysys/pack.cc. --- mysys/pack.cc | 2 +- sql/protocol_classic.cc | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mysys/pack.cc b/mysys/pack.cc index d2e248dccb48..9155955bec4b 100644 --- a/mysys/pack.cc +++ b/mysys/pack.cc @@ -110,7 +110,7 @@ uint64_t net_field_length_ll(uchar **packet) { } /* - Store an integer with simple packing into a output package + Store an integer with simple packing into an output package SYNOPSIS net_store_length() diff --git a/sql/protocol_classic.cc b/sql/protocol_classic.cc index 5b8c2a080357..58ab15fe7267 100644 --- a/sql/protocol_classic.cc +++ b/sql/protocol_classic.cc @@ -131,7 +131,7 @@ @section sect_protocol_basic_dt_string_le Protocol::LengthEncodedString A length encoded string is a string that is prefixed with length encoded - integer describing the length of the string. + integer describing the length of the string. NULL if first byte is 0xFB. It is a special case of @ref sect_protocol_basic_dt_string_var @@ -3099,6 +3099,11 @@ bool Protocol_classic::end_result_metadata() { @ref a_protocol_type_int2 "int<2>" reserved reserved. All 0s. + if command was COM_FIELD_LIST { + @ref sect_protocol_basic_dt_string_le "string<lenenc>" + default value + NULL if 0xFB + } @note `decimals` and `column_length` can be used for text output formatting