Bug #39961 Using ADO Recordset and Update to set Decimal field causes wrong value
Submitted: 9 Oct 2008 21:29 Modified: 21 Nov 2008 16:11
Reporter: Meelis Lilbok
Status: Closed
Category:Connector/ODBC Severity:S1 (Critical)
Version:5.1.5 OS:Any
Assigned to: Jess Balint Target Version:
Triage: D2 (Serious)

[9 Oct 2008 21:29] Meelis Lilbok
Description:
Seting ADO Recordset decimal field value to 44.56 cause wrong value 445600.0000

How to repeat:
Dim r As New Recordset
r.open "select * from kogud where id=1", "dsn=mysql", adOpenKeyset, adLockBatchOptimistic,
adCmdText
r.fields("m1").Value = 44.56
r.Update

Result - m1= 445600.0000
[9 Oct 2008 21:31] Meelis Lilbok
SQL Trace Log

Attachment: sql.log (application/octet-stream, text), 134.70 KiB.

[9 Oct 2008 21:32] Meelis Lilbok
SHOW CREATE table

Attachment: create table.txt (text/plain), 1.79 KiB.

[9 Oct 2008 21:37] Meelis Lilbok
ODBC 5.1.1 Windows, MySQL Server 5.1(Windows) and 5.0.32-Debian_7etch6-log
[9 Oct 2008 23:42] Jess Balint
Verified using server side cursor. Client cursor not affected.
[10 Oct 2008 1:11] Jess Balint
Code pushed to:
https://code.launchpad.net/~myodbc-developers/myodbc/bug39961
[14 Nov 2008 18:21] Jess Balint
Pushed as rev 812, will be released in 5.1.6.
[21 Nov 2008 16:11] Tony Bedford
An entry was added to the 5.1.6 changelog:

Setting the ADO Recordset decimal field value to 44.56 resulted in an incorrect value of
445600.0000 being stored when the record set was updated with the Update method.
[30 Jan 18:59] Jess Balint
Bug#42316 was marked as a duplicate of this.