Bug #13319 Incorrect quotation for binary strings
Submitted: 19 Sep 2005 12:26 Modified: 10 May 2007 2:30
Reporter: Bogdan Degtyariov Email Updates:
Status: Duplicate Impact on me:
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.11-2 OS:Microsoft Windows (Windows)
Assigned to: CPU Architecture:Any

[19 Sep 2005 12:26] Bogdan Degtyariov
Bit string type causes incorrect behavior of insert_param function (ececute.c: line 287).

How to repeat:
Public Sub mainsub()
        Dim cmd As ADODB.Command
        Dim conn As ADODB.Connection
        Dim par As ADODB.Parameter
        Set cmd = CreateObject("ADODB.Command")
        cmd.ActiveConnection = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;Database=test;Uid=myUID;Pwd=myPwd;"
        cmd.CommandText = "INSERT INTO MyTable VALUES(?, ?)"
        Set par = cmd.CreateParameter("", adInteger, adParamInput, , 4)
        cmd.Parameters.Append par
        Set par = cmd.CreateParameter("", adBSTR, adParamInput, 31, "Ne""ve'rmind")
        cmd.Parameters.Append par
End Sub
[7 May 2007 23:08] Jim Winstead
I can't figure out how to create a C test for this. As near as I can figure, a parameter of type adBSTR is just a character string with nil termination. Please provide a trace of what is going on, or a C test case, if this still fails.
[10 May 2007 2:30] Jim Winstead
This is a duplicate of Bug #16235. It appears that sometimes adBSTR is getting mapped to SQL_C_WVARCHAR, which we do not handle properly. (So although the other bug is reported later, it has more complete info.)