summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 4800fdedbe5..8a6d4bf9802 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1471,8 +1471,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
sure the new current database has a name with the same length
as the previous one.
*/
- size_t *db_len= (size_t *) (sql + query_length + 1);
- if (thd->db_length != *db_len)
+ size_t db_len;
+ memcpy((char *) &db_len, (sql + query_length + 1), sizeof(size_t));
+ if (thd->db_length != db_len)
{
/*
We should probably reallocate the buffer in this case,