Issues with bound parameters using ODBC Connector 8.4 & 9.0
Posted by:
Jon Bird
Date: July 05, 2024 05:26AM
Hi,
I'm experiencing some erroneous/erratic behaviour using the latest ODBC connectors (8.4 and now 9.0) on Win64 where bound parameters are concerned (these issues are not apparent with earlier versions).
Firstly, when connecting to a 5.7x database, every query I execute that has a bound parameter fails with the following error:
[MySQL][ODBC 9.0(w) Driver][mysqld-5.7.44-0ubuntu0.18.04.1+esm1]No data supplied for parameters in prepared statement;
What is interesting though is that looking at the traffic to/from the server, I can see no problems at this level, the connector is issuing a prepare statement which the server responds to with a success status.
Secondly, when connecting to a 8.0x database, the behaviour is generally ok however there are particular scenarios where it fails. I have one particular query, that will always fail the first time I run it. In this instance, it comes back with this error:
[MySQL][ODBC 9.0(w) Driver][mysqld-8.0.37-0ubuntu0.22.04.3]Using unsupported buffer type: %d (parameter: %d)
Of an in itself that error is weird in that it looks like a template string, in that I would expect at least one of those "%d" tokens to be populated. However if I then run that query again, without changing any of the bound parameters ie. literally calling SQLExecDirect again, it will succeed.
Again, looking at the traffic between the client and server, I see what appears to be an identical exchange as with the 5.7 one - a prepare statement is sent and is acknowledged successfully by the server.
Jon.