Skip to content

Commit 4af231b

Browse files
committed
Windows/ARM64 - workaround compiler bug
Follow-up 9e1c1d4 Item_func_hybrid_field_type::val_real_from_int_op() might return wrong result. This makes mtr fail on Windows/ARM , at least in main.func_format and main.sp-vars Many to Chengya/coneco-cy for debugging the issue and finding the cause.
1 parent 59ee33e commit 4af231b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sql/item_func.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,12 +843,22 @@ String *Item_func_hybrid_field_type::val_str_from_int_op(String *str)
843843
return str;
844844
}
845845

846+
#ifdef _M_ARM64
847+
/* MSVC on ARM incorrectly optimizes the code in val_real_from_int_op() */
848+
#pragma optimize("", off)
849+
#endif
850+
846851
double Item_func_hybrid_field_type::val_real_from_int_op()
847852
{
848853
longlong result= int_op();
849854
return unsigned_flag ? (double) ((ulonglong) result) : (double) result;
850855
}
851856

857+
#ifdef _M_ARM64
858+
#pragma optimize("", on)
859+
#endif
860+
861+
852862
my_decimal *
853863
Item_func_hybrid_field_type::val_decimal_from_int_op(my_decimal *dec)
854864
{

0 commit comments

Comments
 (0)