[MCOL-299] CHARACTER_LENGTH(float/decimal) returns wrong length Created: 2016-09-14  Updated: 2016-10-05  Resolved: 2016-10-05

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

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

CentOS


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

 Description   

The CHARACTER_LENGTH function returns too large an answer for FLOAT and too small ans answer for DOUBLE. This is because the columnstore function uses sprintf default behavior to determine the string to be sized, while the final display of MariaDB uses something different with a slightly different format.

These two formats need to be reconciled.



 Comments   
Comment by David Hall (Inactive) [ 2016-09-22 ]

Multi MCOL checkin

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

Moving to QA

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 CDT

MariaDB [mytest]> select cfloat, character_length(cfloat), cdouble, character_length(cdouble) from datatypetestm;
------------------------------------------------------------------------------+

cfloat character_length(cfloat) cdouble character_length(cdouble)

------------------------------------------------------------------------------+

-3.40287e18 11 -1.797693231e108 16
-3.40287e18 11 -1.79769323e108 15
-3.40286e18 11 -1.797693229e108 16
-3.40286e18 11 -1.797693228e108 16
-3.40286e18 11 -1.797693227e108 16
3.40286e18 10 1.797693227e108 15
3.40286e18 10 1.797693228e108 15
3.40286e18 10 1.797693229e108 15
3.40287e18 10 1.79769323e108 14
3.40287e18 10 1.797693231e108 15
0 1 0 1

------------------------------------------------------------------------------+
11 rows in set (0.14 sec)

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