Commit 0df09c4c authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix MYSQL Bug#60057 : sel_arg_range_seq_next loops in optimized compilation/VS2010

When mariadb 5.3 is compiler with VS2010, several tests would enter infinite loop in 
sel_arg_range_seq_next(). The reason is compiler backend bug. This bug is not
present in either VS2008  or VS2010 SP1 RC.

Workaround is to compile this function without most aggresive optimization flag
 (-Og )  using #pragma optimize ("g", {on|off}) for this version of MSVC compiler.
parent da2715f8
...@@ -120,6 +120,14 @@ static void step_down_to(SEL_ARG_RANGE_SEQ *arg, SEL_ARG *key_tree) ...@@ -120,6 +120,14 @@ static void step_down_to(SEL_ARG_RANGE_SEQ *arg, SEL_ARG *key_tree)
TRUE No more ranges in the sequence TRUE No more ranges in the sequence
*/ */
#if (_MSC_FULL_VER == 160030319)
/*
Workaround Visual Studio 2010 RTM compiler backend bug, the function enters
infinite loop.
*/
#pragma optimize("g", off)
#endif
bool sel_arg_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range) bool sel_arg_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
{ {
SEL_ARG *key_tree; SEL_ARG *key_tree;
...@@ -273,6 +281,12 @@ bool sel_arg_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range) ...@@ -273,6 +281,12 @@ bool sel_arg_range_seq_next(range_seq_t rseq, KEY_MULTI_RANGE *range)
return 0; return 0;
} }
#if (_MSC_FULL_VER == 160030319)
/* VS2010 compiler bug workaround */
#pragma optimize("g", on)
#endif
/**************************************************************************** /****************************************************************************
MRR Range Sequence Interface implementation that walks array<QUICK_RANGE> MRR Range Sequence Interface implementation that walks array<QUICK_RANGE>
****************************************************************************/ ****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment