Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.2.6, 3.2.10
-
None
-
Linux x86_64 (openSUSE Tumbleweed), unixODBC 2.3.14, MariaDB Server 11.8.9; 3.2.6 = distribution package, 3.2.10 = fedora43 tarball from dlm.mariadb.com (bundled libmariadb 3.4.11)
Description
An INSERT executed with a parameter array (SQL_ATTR_PARAMSET_SIZE > 1) fails if one of the parameters is bound as SQL_C_TYPE_DATE (or SQL_C_DATE):
[HY000] [ma-3.2.10][11.8.9-MariaDB-ubu2404]Error while retrieving parameter from callback function
|
No row is inserted. With PCALLBACK=0 in the DSN the same program inserts all rows correctly. SQL_C_TYPE_TIMESTAMP arrays, and SQL_C_TYPE_DATE in a single row execute, work.
Steps to reproduce (program attached, date.c):
- CREATE TABLE odbc_date_arr (id INT, d DATE)
- SQLPrepare "INSERT INTO odbc_date_arr (id, d) VALUES (?, ?)"
- SQL_ATTR_PARAM_BIND_TYPE = SQL_PARAM_BIND_BY_COLUMN, SQL_ATTR_PARAMSET_SIZE = 3
- SQLBindParameter 1: SQL_C_LONG / SQL_INTEGER, SQLINTEGER[3]
- SQLBindParameter 2: SQL_C_TYPE_DATE / SQL_TYPE_DATE, column size 10, SQL_DATE_STRUCT[3]
{2026-02-01, 2026-02-02, 1999-12-31}
, indicators 0
- SQLExecute
gcc -o date date.c -lodbc
|
./date <DSN> <user> <password>
|
|
|
PCALLBACK=1 (default), 3.2.6 and 3.2.10:
|
SQLExecute (3 rows): rc=-1 [HY000] [ma-3.2.10][11.8.9-MariaDB-ubu2404]Error while retrieving parameter from callback function
|
rows inserted: 0 (expected 3)
|
|
|
PCALLBACK=0:
|
SQLExecute (3 rows): rc=0
|
rows inserted: 3 (expected 3)
|
The same happens with NULL indicators in some rows. Possibly related: CONC-623 (return code of the parameter callback).
Workaround: PCALLBACK=0 in the DSN.
The analysis and the test program were made with AI assistance (Claude); I have verified the results.