Open
Description
Encoding of ScaledDecimal in MySQLBindParameter>>decimalBytes drops first digit of parameter value. Test case (where c is a connected MySQLDriver):
c query: 'drop table if exists decimal_test'.
c query: 'create table decimal_test (d decimal(10,2))'.
r := c prepare: 'insert into decimal_test(d) values(?)'.
s := (MySQLDriverStatement onConnection: c) stmtId: r prepareOkay stmtHandlerId; cursoredFetch: false; yourself.
s addBinding: 123.45s2.
s execute.
(c query: 'select * from decimal_test') rows first at: 1 " '23.45' "
Issue can be resolved as follows:
decimalBytes
"For scaled decimal"
ByteArray streamContents: [:strm |
MySQLHelper encodeLcs: (paramValue abs printString allButLast:2) asByteArray on: strm.
^ strm contents]
Metadata
Metadata
Assignees
Labels
No labels