summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2004-01-12 22:47:26 -0400
committerunknown <vva@eagle.mysql.r18.ru>2004-01-12 22:47:26 -0400
commite1d5f62041deaf97e139e660bc57a0de784f76e6 (patch)
tree9a2d1d70ecd1146084719b4ef4ae1d796c10ecea /sql/item_func.cc
parentcf2ecf37026b89640f539f2dc34a1d2f63501918 (diff)
downloadmariadb-git-e1d5f62041deaf97e139e660bc57a0de784f76e6.tar.gz
Fixed Bug #2338 Trigonometric arithmetic problem
by fixing optimizer bug with help of 'volatile' keyword mysql-test/r/func_math.result: added tests for BUG #2338 Trigonometric arithmetic problems mysql-test/t/func_math.test: added tests for BUG #2338 Trigonometric arithmetic problems sql/item_func.cc: added keyword volatile in Item_func_acos::val and Item_func_asin::val to calm optimizer down and to avoid it's bug
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 217768db2c5..28a1c428cab 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -456,7 +456,8 @@ double Item_func_pow::val()
double Item_func_acos::val()
{
- double value=args[0]->val();
+ // this 'volatile' was added as a fix for BUG #2338 to calm optimizer down
+ volatile double value=args[0]->val();
if ((null_value=(args[0]->null_value || (value < -1.0 || value > 1.0))))
return 0.0;
return fix_result(acos(value));
@@ -464,7 +465,8 @@ double Item_func_acos::val()
double Item_func_asin::val()
{
- double value=args[0]->val();
+ // this 'volatile' was added as a fix for BUG #2338 to calm optimizer down
+ volatile double value=args[0]->val();
if ((null_value=(args[0]->null_value || (value < -1.0 || value > 1.0))))
return 0.0;
return fix_result(asin(value));