Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.6.1, 6.1.1
-
None
Description
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a DECIMAL(10,3)) ENGINE=ColumnStore; |
INSERT INTO t1 VALUES (0),(0.009),(0.09),(0.9); |
SELECT CONCAT(a), CAST(a AS CHAR) FROM t1; |
+-----------+-----------------+
|
| CONCAT(a) | CAST(a AS CHAR) |
|
+-----------+-----------------+
|
| 0.000 | 0.000 |
|
| .009 | .009 |
|
| .090 | .090 |
|
| 0.900 | 0.900 |
|
+-----------+-----------------+
|
Notice inconsistency:
- it prints the 0 in the integral part if the first fractional digit is not 0.
- it does not print the 0 in the integral part if the first fractional digit is zero.
Note, the problem is not repeatable with wide decimal:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a DECIMAL(30,3)) ENGINE=ColumnStore; |
INSERT INTO t1 VALUES (0),(0.009),(0.09),(0.9); |
SELECT CONCAT(a), CAST(a AS CHAR) FROM t1; |
+-----------+-----------------+
|
| CONCAT(a) | CAST(a AS CHAR) |
|
+-----------+-----------------+
|
| 0.000 | 0.000 |
|
| 0.009 | 0.009 |
|
| 0.090 | 0.090 |
|
| 0.900 | 0.900 |
|
+-----------+-----------------+
|