Skip to content

Commit 51a9dd6

Browse files
committed
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 0515577.
1 parent abaeeff commit 51a9dd6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sql/table.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3745,7 +3745,8 @@ bool copy_keys_from_share(TABLE *outparam, MEM_ROOT *root)
37453745
key_info++)
37463746
{
37473747
key_info->table= outparam;
3748-
(uchar*&)(key_info->key_part)+= adjust_ptrs;
3748+
key_info->key_part= reinterpret_cast<KEY_PART_INFO*>
3749+
(reinterpret_cast<char*>(key_info->key_part) + adjust_ptrs);
37493750
if (key_info->algorithm == HA_KEY_ALG_LONG_HASH)
37503751
key_info->flags&= ~HA_NOSAME;
37513752
}

0 commit comments

Comments
 (0)