[MCOL-179] DIV operator returns wrong result on 252 of 1179 tests Created: 2016-06-23  Updated: 2020-05-12  Resolved: 2019-12-10

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2.6

Type: Bug Priority: Major
Reporter: Justin Swanhart (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
is blocked by MCOL-350 can't select date value of 0000-00-00 Closed
Epic Link: ColumnStore Compatibility Improvements
Sprint: 2019-06

 Description   

git clone https://github.com/greenlion/columnstore_tests.git
sudo yum install php-cli php-mysql php-pear
cd columnstore_tests
git checkout only_div
php run_tests --record # record results against MyISAM table
php run_tests --debug | tee out.txt #compare to CS table
Examine out.txt and you will find that the DIV operator returns wrong results for CS compared to MyISAM in 252 of 1179 tests.



 Comments   
Comment by Daniel Lee (Inactive) [ 2018-05-04 ]

Build tested: 1.1.4-1

Autopilot tests also reported the following issues:

test case: DIV.NM.sql

Comment by David Hall (Inactive) [ 2019-07-17 ]

When dealing with integers, it's possible that CS is properly rounding and MyISAM is not. Need to check in what is supposed to happen.

There are more failures than that, so look.

Comment by David Hall (Inactive) [ 2019-07-31 ]

There are three reasons for the mis-compare:

1) Columnstore rounds the answer, whilst InnoDB truncates. I have submitted a PR for this such that Columnstore doesn't round.
2) For DIV (integer divide) Floating point numbers of small magnitude are treated as 0. InnoDB somehow makes use of them. The same patch fixes this. Basically, do the divide, then truncate. Seems to be what is happening in InnoDB.
3) Columnstore now treats '0xdeadb33f' (quotes included) as a valid integer. InnoDB does not. I believe this is OK.

Comment by David Hall (Inactive) [ 2019-07-31 ]

This can be closed. Some are won't fix, some are fixed.

Comment by David Hall (Inactive) [ 2019-12-10 ]

QA: compare DIV against InnoDB for Integer types.
Columnstore does not now and may never accept a quoted hex value in this case.

Comment by Daniel Lee (Inactive) [ 2019-12-10 ]

Build verified: 1.2.6-1

engine commit:
d4173ef

This rounding issue has been fixed. The Autopilot features.functions test, DIV test case has much less difference now. Remaining difference is due to other know behavior (supported value range for data types)

Generated at Thu Feb 08 02:19:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.