MDEV-19237 Skip sending metadata when possible for binary protocol.

Do not resend metadata, if metadata does not change between prepare and
execute of prepared statement, or between executes.

Currently, metadata of *every* prepared statement will be checksummed,
and change is detected once checksum changes.

This is not from ideal, performance-wise. The code for
better/faster detection of unchanged metadata, is already in place, but
currently disabled due to PS bugs, such as MDEV-23913.
This commit is contained in:
Vladislav Vaintroub 2020-11-23 19:24:31 +01:00
commit 295f3e4cfb
8 changed files with 450 additions and 19 deletions

View file

@ -93,7 +93,7 @@ public:
virtual ~Protocol() {}
void init(THD* thd_arg);
enum { SEND_NUM_ROWS= 1, SEND_EOF= 2 };
enum { SEND_NUM_ROWS= 1, SEND_EOF= 2, SEND_FORCE_COLUMN_INFO= 4 };
virtual bool send_result_set_metadata(List<Item> *list, uint flags);
bool send_list_fields(List<Field> *list, const TABLE_LIST *table_list);
bool send_result_set_row(List<Item> *row_items);