From 51a9dd67931b0f674c2d827ef307ec28b402e3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 1 Apr 2020 11:33:58 +0300 Subject: [PATCH] Fix GCC 9.3.0 -Wstrict-aliasing copy_keys_from_share(): Use reinterpret_cast instead of manipulating a reference to a type-punned pointer. This cleans up after the cleanup commit 0515577d128318e1b62511846d88d0c56226168d. --- sql/table.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/table.cc b/sql/table.cc index 99ecd8450bb..54e8ceaeff0 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3745,7 +3745,8 @@ bool copy_keys_from_share(TABLE *outparam, MEM_ROOT *root) key_info++) { key_info->table= outparam; - (uchar*&)(key_info->key_part)+= adjust_ptrs; + key_info->key_part= reinterpret_cast + (reinterpret_cast(key_info->key_part) + adjust_ptrs); if (key_info->algorithm == HA_KEY_ALG_LONG_HASH) key_info->flags&= ~HA_NOSAME; }