#1053484 tclodbc: Off-by-one error in SQLDescribeParam() call

Package:
tclodbc
Source:
tclodbc
Description:
ODBC extension for Tcl
Submitter:
Christian Werner
Date:
2023-10-05 04:36:03 UTC
Severity:
normal
#1053484#5
Date:
2023-10-05 04:33:49 UTC
From:
To:
Dear Maintainer,

according to its description, the SQLDescribeParam() ODBC API counts
the parameter numbers starting with 1. However, in the statemnt.cxx
a loop over the parameters of a query is run starting with 0 as
parameter number. In consequence, data type mapping of the client
parameters to the query might become wrong heavily depending on the
actual query itself. Problem can be easily resolved by changing

 SQLDescribeParam(..., i, ...);

to

 SQLDescribeParam(..., i+1, ...);

BR,
Christian