[MCOL-78] ROUND() function returns incorrect value Created: 2016-05-23  Updated: 2016-10-05  Resolved: 2016-10-05

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

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

Issue Links:
PartOf
is part of MCOL-280 Beta issues Closed
Sprint: 1.0.2-1, 1.0.2-2, 2016-19

 Description   

Build tested:

InfiniDB> getcalpontsoft
getcalpontsoftwareinfo Mon May 23 16:47:57 2016

Name : infinidb-platform Relocations: (not relocatable)
Version : 5.0 Vendor: MariaDB, Inc.
Release : 0 Build Date: Sun 15 May 2016 07:24:29 PM CDT
Install Date: Mon 16 May 2016 05:21:51 PM CDT Build Host: srvbuilder
Group : Applications Source RPM: infinidb-5.0-0.src.rpm

ColumnStore returns:

select cidx, CDECIMAL1, ROUND(CDECIMAL1,-1) from datatypetestm order by cidx

cidx CDECIMAL1 ROUND(CDECIMAL1,-1)
1 -9 -9
2 -8 -9
3 -7 -9
4 -6 -9
5 -5 -9
6 5 9
7 6 9
8 7 9
9 8 9
10 9 9
11 0 0
11 rows in set

MySQL and MariaDB returns:

select cidx, CDECIMAL1, ROUND(CDECIMAL1,-1) from datatypetestm order by cidx

cidx CDECIMAL1 ROUND(CDECIMAL1,-1)
1 -9 -10
2 -8 -10
3 -7 -10
4 -6 -10
5 -5 -10
6 5 10
7 6 10
8 7 10
9 8 10
10 9 10
11 0 0
11 rows in set



 Comments   
Comment by Dipti Joshi (Inactive) [ 2016-05-31 ]

dleeyh Is this still happening ? Your autopilot results that you shared on May 24th was showing that ROUND function is still working.

Comment by Andrew Hutchings (Inactive) [ 2016-09-07 ]

Review done. Good fix!

Comment by Daniel Lee (Inactive) [ 2016-09-13 ]

Build tested:

getsoftwareinfo Tue Sep 13 16:53:08 2016

Name : mariadb-columnstore-platform
Version : 1.0.3
Release : 1
Architecture: x86_64
Install Date: Mon 12 Sep 2016 09:48:35 AM CDT

This build does not have the fix.

MariaDB [mytest]> select cidx, CDECIMAL1, ROUND(CDECIMAL1,-1) from datatypetestm order by cidx;
----------------------------------

cidx CDECIMAL1 ROUND(CDECIMAL1,-1)

----------------------------------

1 -9 -9
2 -8 -9
3 -7 -9
4 -6 -9
5 -5 -9
6 5 9
7 6 9
8 7 9
9 8 9
10 9 9
11 0 0

----------------------------------
11 rows in set (0.08 sec)

Comment by Daniel Lee (Inactive) [ 2016-09-15 ]

Build tested:

mscadmin> getsoft
getsoftwareinfo Thu Sep 15 12:06:24 2016

Name : mariadb-columnstore-platform
Version : 1.0.3
Release : 1
Architecture: x86_64
Install Date: Thu 15 Sep 2016 11:39:01 AM CDT
Group : Applications
Size : 25431329
License : Copyright (c) 2016 MariaDB Corporation Ab., all rights reserved; redistributable under the terms of the GPL, see the file COPYING for details.
Signature : (none)
Source RPM : mariadb-columnstore-1.0.3-1.src.rpm
Build Date : Thu 15 Sep 2016 09:56:11 AM CDT

The fix is in the build, not working. The issue still exists.
MariaDB [mytest]> select cidx, CDECIMAL1, ROUND(CDECIMAL1,-1) from datatypetestm order by cidx;
----------------------------------

cidx CDECIMAL1 ROUND(CDECIMAL1,-1)

----------------------------------

1 -9 -9
2 -8 -9
3 -7 -9
4 -6 -9
5 -5 -9
6 5 9
7 6 9
8 7 9
9 8 9
10 9 9
11 0 0

----------------------------------
11 rows in set (0.17 sec)

Comment by Andrew Hutchings (Inactive) [ 2016-09-15 ]

confirmed, patch does not fix the problem

Comment by Andrew Hutchings (Inactive) [ 2016-09-24 ]

Ben: can you open a pull request for your fix? Then I can review it

Comment by Andrew Hutchings (Inactive) [ 2016-09-26 ]

Moving to Daniel for QA. Real fix should be in there now

Comment by Daniel Lee (Inactive) [ 2016-10-05 ]

Build verified: 1.0.4-1

mcsadmin> getsoft
getsoftwareinfo Tue Oct 4 22:29:41 2016

Name : mariadb-columnstore-platform
Version : 1.0.4
Release : 1
Architecture: x86_64
Install Date: Tue 04 Oct 2016 01:38:36 PM CDT
Group : Applications/Databases
Size : 11506458
License : Copyright (c) 2016 MariaDB Corporation Ab., all rights reserved; redistributable under the terms of the GPL, see the file COPYING for details.
Signature : (none)
Source RPM : mariadb-columnstore-platform-1.0.4-1.src.rpm
Build Date : Fri 30 Sep 2016 01:02:40 PM

MariaDB [mytest]> select cidx, CDECIMAL1, ROUND(CDECIMAL1,-1) from datatypetestm order by cidx
->
-> ;
----------------------------------

cidx CDECIMAL1 ROUND(CDECIMAL1,-1)

----------------------------------

1 -9 -10
2 -8 -10
3 -7 -10
4 -6 -10
5 -5 -10
6 5 10
7 6 10
8 7 10
9 8 10
10 9 10
11 0 0

----------------------------------
11 rows in set (0.03 sec)

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