cpimport decimal import error

Bug #891286 reported by David Walling
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
InfiniDB Community
Invalid
Undecided
Unassigned

Bug Description

I have a column defined as decimal(7,2), when using cpimport I see the following behavior when importing values to this column.

When importing 23.45, the resulting value is 23.45.
When import 23.5, the resulting value is 2.35, should be 23.50

cpimport is shifting the decimal place if the source file value does not contain 2 decimal places.

Tags: cpimport
Revision history for this message
Robert Adams (radams-calpont) wrote :

We do not see the same behavior.

Here is my source file used for the cpimport:

# cat test_dec.tbl
2|1234|
2|123.4|
2|12.34|
2|1.234|
2|.1234|
3|23.45|
3|23.5|
3|235|
3|.235|

mysql> select * from test_dec;
+------+---------+
| id | a |
+------+---------+
| 2 | 1234.00 |
| 2 | 123.40 |
| 2 | 12.34 |
| 2 | 1.23 |
| 2 | 0.12 |
| 3 | 23.45 |
| 3 | 23.50 |
| 3 | 235.00 |
| 3 | 0.24 |
+------+---------+
9 rows in set (0.15 sec)

mysql> show create table test_dec;
+----------+---------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+----------+---------------------------------------------------------------------------------------------------------------------------------+
| test_dec | CREATE TABLE `test_dec` (
  `id` int(11) DEFAULT NULL,
  `a` decimal(7,2) DEFAULT NULL
) ENGINE=InfiniDB DEFAULT CHARSET=latin1 |
+----------+---------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

Changed in infinidb:
status: New → Incomplete
Changed in infinidb:
status: Incomplete → Invalid
Revision history for this message
David Walling (walling-l) wrote :

I'm still consistently getting this behaviour

Revision history for this message
Jerry ma (jerryma) wrote :

hi,I'm also getting this error behavior on mariadb-columnstore-1.0.9-1-centos6.x86_64.bin.tar.gz,by the way,when we change column a before column id, the cpimport result is correct!
and I can confirm this is a bug. why this bug is marked by invalid?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.