mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
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:
parent
1a02a37243
commit
d72fefe986
3 changed files with 36 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue