cpimport decimal import error
Bug #891286 reported by
David Walling
on 2011-11-16
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.
Robert Adams (radams-calpont)
on 2011-12-05
Changed in infinidb: | |
status: | Incomplete → Invalid |
David Walling (walling-l) wrote : | #2 |
I'm still consistently getting this behaviour
Jerry ma (jerryma) wrote : | #3 |
hi,I'm also getting this error behavior on mariadb-
and I can confirm this is a bug. why this bug is marked by invalid?
To post a comment you must log in.
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)