Bug #98946 Crash, invaid or inconsistent data by using SQLBindParameter()
Submitted: 13 Mar 18:00 Modified: 13 Jul 11:16
Reporter: Marcus Hampel Email Updates:
Status: Open Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version: 8.00.20 OS:Microsoft Windows
Assigned to: CPU Architecture:x86 (64_x86)

[13 Mar 18:00] Marcus Hampel
Description:
Crash, invalid or inconsistent data by using SQLBindParameter() when binding columns of type double into character buffers (length of SQLColAttribute(SQL_DESC_DISPLAY_SIZE)).

How to repeat:
Test program created: https://www.dropbox.com/s/ma5jap1vsx3a6g0/test_odbc.c?dl=0

Program create table with 7 lines of id and double values.
You can select single or multiple ids (0-6) by parameter (idMin, idMax).

If i use idMin=0 and idMax=6 the result seems correct, but with different result 
by record 0:

select (SQLExecDirect):
Record 1: [0], [0]

select (SQLExecute, without parameters):
Record 1: [0], [0]

select (SQLExecute, with parameters):
Record 1: [0], [0.000000]

If i choose idMin=4 and idMax=4 i got this result:

select (SQLExecDirect):
Record 1: [4], [1.79e308]

select (SQLExecute, without parameters):
Record 1: [4], [1.79e308]

select (SQLExecute, with parameters):
Record 1: [4], [17899999999999999637689(... random data ...)]

With idMin=5 and idMax=5 this:

select (SQLExecDirect):
Record 1: [5], [-2.23e-308]

select (SQLExecute, without parameters):
Record 1: [5], [-2.23e-308]

select (SQLExecute, with parameters):
Record 1: [5], [-0.000000]

With idMin=2 and idMax=2 this:
select (SQLExecDirect):
Record 1: [2], [123456789012345]

select (SQLExecute, without parameters):
Record 1: [2], [123456789012345]

select (SQLExecute, with parameters):
Record 1: [2], [123456789012345.000000]

With Driver 5.3.14, program crashed with idMin=4 and idMax=4 and other constellations.
[7 May 15:59] MySQL Verification Team
Could you please try version 8.0.20. Thanks.
[8 May 7:55] Marcus Hampel
Same effect with 8.00.20
[13 Jul 11:06] MySQL Verification Team
Please try version 8.0.21. Thanks.
https://dev.mysql.com/downloads/connector/odbc/
[13 Jul 11:16] Marcus Hampel
same