From aa414896f00f6e24261dffec507162902244eb3a Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 18 Jan 2005 15:59:39 -0800 Subject: [PATCH] Fix query cache to not respond to old clients with a 4.1-protocol response. (Bug #6511) --- sql/mysql_priv.h | 1 + sql/sql_cache.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 4b785aafc5f..314c6928c1c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -377,6 +377,7 @@ Item *negate_expression(THD *thd, Item *expr); struct Query_cache_query_flags { unsigned int client_long_flag:1; + unsigned int client_protocol_41:1; uint character_set_client_num; uint character_set_results_num; uint collation_connection_num; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index bd42a2c1720..8491457179f 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -776,6 +776,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) bzero(&flags, QUERY_CACHE_FLAGS_SIZE); flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? 1 : 0); + flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? + 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= @@ -968,6 +970,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) bzero(&flags, QUERY_CACHE_FLAGS_SIZE); flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? 1 : 0); + flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? + 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= (thd->variables.character_set_results ?