diff options
author | Tor Didriksen <tor.didriksen@oracle.com> | 2011-07-18 11:21:14 +0200 |
---|---|---|
committer | Tor Didriksen <tor.didriksen@oracle.com> | 2011-07-18 11:21:14 +0200 |
commit | d72fefe98652646c82ab2ba0aba690c18e9b82c4 (patch) | |
tree | 28b394c9742e4dced4c6b2c8a429478342e430c4 /mysql-test/t/func_math.test | |
parent | 1a02a372432cbf023fa9291badf772f0f2bc55fd (diff) | |
download | mariadb-git-d72fefe98652646c82ab2ba0aba690c18e9b82c4.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/func_math.test')
-rw-r--r-- | mysql-test/t/func_math.test | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index b6890bdab17..a1df990fa8e 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -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; |