Bug #95608 Setting of statement attribute SQL_ATTR_PARAMSET_SIZE is silently ignored on OSX
Submitted: 3 Jun 2019 8:49 Modified: 24 Dec 2020 22:09
Reporter: Yves Colombani Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.3.13 and newer OS:MacOS (10.13 and 10.14)
Assigned to: CPU Architecture:x86
Tags: arrays of parameters, ODBC

[3 Jun 2019 8:49] Yves Colombani
Description:
An application using "arrays of parameters" for a parametrised query has to set the attribute 'SQL_ATTR_PARAMSET_SIZE' to a value greater than 1 (the number of parameter sets). If the driver does not support the functionality it must report an error: apparently on OSX the ODBC connector does not report an error but ignores the setting (i.e. it processes only the first set of parameters). We can observe the issue with the precompiled drivers versions 5.3.13 and 8.0.16 (no issue with older versions) connecting to servers 5.1,5.7 and 8.0. The problem is specific to OSX: everything works as expected on Linux (I have not tested yet on Windows).

How to repeat:
I have written a small C program that shows the issue: it creates a table with a single column and tries to insert 5 rows in a single operation (using an array of parameters). It then checks the size of the table.
Depending on the version of the ODBC connector the program fails when setting the size of the array (i.e. functionality not supported), succeeds and reports that 5 rows have been inserted (i.e. functionality supported and working) or succeeds but reports only 1 row (i.e. functionality apparently supported but not working).
[3 Jun 2019 8:54] Yves Colombani
A program showing the issue

Attachment: csqlbug.c (text/x-csrc), 1.99 KiB.

[3 Jun 2019 14:37] MySQL Verification Team
Thank you for the bug report.
[2 Nov 2020 10:59] Bogdan Degtyariov
Posted by developer:
 
Pushed the patch in the source tree.
[24 Dec 2020 22:09] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Connector/ODBC 8.0.23 release, and here's the proposed changelog entry from the documentation team:

On macOS, Connector/ODBC would not report an error if
SQL_ATTR_PARAMSET_SIZE was set but not supported; instead the setting was
ignored.

Thank you for the bug report.