summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2022-01-27 15:54:20 +0400
committerAlexander Barkov <bar@mariadb.com>2022-01-27 15:54:20 +0400
commit430d60d1fc01958f2a503d01b24154672a4189bf (patch)
tree6b27e8a0b73ce9a9b9632b64cfa33a4ba3ef642f /plugin
parent4d74bac8bc8c14c2b217391b3b8860f3dc701202 (diff)
downloadmariadb-git-430d60d1fc01958f2a503d01b24154672a4189bf.tar.gz
MDEV-24487 Error after update to 10.5.8 on CentOS-8: DBD::mysql::st execute failed: Unknown MySQL error
The problem happened because the the new client capability flag CLIENT_EXTENDED_METADATA was not put into the cache entry key. So results cached by a new client were sent to the old client (and vica versa) with a mis-matching metadata, which made the client abort the connection on an unexpected result set metadata packet format. The problem was caused by the patch for: MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRY which forgot to adjust the query cache code. Fix: - Adding a new member Query_cache_query_flags::client_extended_metadata, so only clients with equal CLIENT_EXTENDED_METADATA flag values can reuse results. - Adding a new column CLIENT_EXTENDED_METADATA into INFORMATION_SCHEMA.QUERY_CACHE_INFO (privided by the qc_info plugin).
Diffstat (limited to 'plugin')
-rw-r--r--plugin/qc_info/qc_info.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugin/qc_info/qc_info.cc b/plugin/qc_info/qc_info.cc
index 41b3c7b4991..e97f547550f 100644
--- a/plugin/qc_info/qc_info.cc
+++ b/plugin/qc_info/qc_info.cc
@@ -72,12 +72,13 @@ bool schema_table_store_record(THD *thd, TABLE *table);
#define COLUMN_CLIENT_LONG_FLAG 16
#define COLUMN_CLIENT_PROTOCOL_41 17
-#define COLUMN_PROTOCOL_TYPE 18
-#define COLUMN_MORE_RESULTS_EXISTS 19
-#define COLUMN_IN_TRANS 20
-#define COLUMN_AUTOCOMMIT 21
-#define COLUMN_PKT_NR 22
-#define COLUMN_HITS 23
+#define COLUMN_CLIENT_EXTENDED_METADATA 18
+#define COLUMN_PROTOCOL_TYPE 19
+#define COLUMN_MORE_RESULTS_EXISTS 20
+#define COLUMN_IN_TRANS 21
+#define COLUMN_AUTOCOMMIT 22
+#define COLUMN_PKT_NR 23
+#define COLUMN_HITS 24
namespace Show {
@@ -103,6 +104,7 @@ static ST_FIELD_INFO qc_info_fields[]=
Column("LC_TIME_NAMES", Varchar(100), NOT_NULL),
Column("CLIENT_LONG_FLAG", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL),
Column("CLIENT_PROTOCOL_41", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL),
+ Column("CLIENT_EXTENDED_METADATA",STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL),
Column("PROTOCOL_TYPE", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL),
Column("MORE_RESULTS_EXISTS", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL),
Column("IN_TRANS", STiny(MY_INT32_NUM_DECIMAL_DIGITS), NOT_NULL),
@@ -218,6 +220,8 @@ static int qc_info_fill_table(THD *thd, TABLE_LIST *tables,
table->field[COLUMN_CLIENT_LONG_FLAG]->store(flags.client_long_flag, 0);
table->field[COLUMN_CLIENT_PROTOCOL_41]->store(flags.client_protocol_41, 0);
+ table->field[COLUMN_CLIENT_EXTENDED_METADATA]->
+ store(flags.client_extended_metadata, 0);
table->field[COLUMN_PROTOCOL_TYPE]->store(flags.protocol_type, 0);
table->field[COLUMN_MORE_RESULTS_EXISTS]->store(flags.more_results_exists, 0);
table->field[COLUMN_IN_TRANS]->store(flags.in_trans, 0);