Skip to content

Commit

Permalink
MDEV-27030 vcol.vcol_keys_myisam fails on Windows x64, with Visual St…
Browse files Browse the repository at this point in the history
…udio 2022

Upon investigation, decided this to be a compiler bug
(happens with new compiler, on code that did not change for the last 15 years)

Fixed by de-optimizing single function remove_key(), using MSVC pragma
  • Loading branch information
vaintroub committed Nov 11, 2021
1 parent 3163d9e commit 628c281
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions storage/myisam/mi_delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,10 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
returns how many chars was removed or 0 on error
*/

#if defined(_MSC_VER) && defined(_M_X64) && _MSC_VER >= 1930
#pragma optimize("g", off)
#endif

static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag,
uchar *keypos, /* Where key starts */
uchar *lastkey, /* key to be removed */
Expand Down Expand Up @@ -891,3 +895,7 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag,
(uint) (page_end-start-s_length));
DBUG_RETURN((uint) s_length);
} /* remove_key */

#if defined(_MSC_VER) && defined(_M_X64) && _MSC_VER >= 1930
#pragma optimize("",on)
#endif

0 comments on commit 628c281

Please sign in to comment.