Bug#12711164 - 61676: RESULT OF DIV WITH DECIMAL AND INTEGER DOES NOT MAKE SENSE

Truncate result of decimal division before converting to integer.


mysql-test/r/func_math.result:
  New test case.
mysql-test/t/func_math.test:
  New test case.
sql/item_func.cc:
  Item_func_int_div::val_int():
  Truncate result of decimal division before converting to integer.
This commit is contained in:
Tor Didriksen 2011-07-18 11:21:14 +02:00
commit d72fefe986
3 changed files with 36 additions and 1 deletions

View file

@ -547,3 +547,14 @@ let $nine_81=
eval select $nine_81 % 0.1 as foo;
eval select $nine_81 % 0.0 as foo;
--echo #
--echo # Bug#12711164 - 61676:
--echo # RESULT OF DIV WITH DECIMAL AND INTEGER DOES NOT MAKE SENSE
--echo #
select 5 div 2;
select 5.0 div 2.0;
select 5.0 div 2;
select 5 div 2.0;
select 5.9 div 2, 1.23456789e3 DIV 2, 1.23456789e9 DIV 2, 1.23456789e19 DIV 2;