History log of /PHP-8.2/ext/pdo_odbc/tests/gh9372.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# f5aaa8f1 18-Oct-2022 Christoph M. Becker

Fix GH-9372: HY010 when binding overlong parameter

If `SQLPutData()` *fails*, we should not call `SQLParamData()` again,
because that yields the confusing `HY010` (Function sequence erro

Fix GH-9372: HY010 when binding overlong parameter

If `SQLPutData()` *fails*, we should not call `SQLParamData()` again,
because that yields the confusing `HY010` (Function sequence error).
Instead we properly handle `SQLPutData()` errors.

For the given case (paramter length > column length), some drivers let
`SQLPutData()` fail, while others do not. Either behavior seems to
conform to the ODBC specification. Anyhow, we do not want to silently
truncate the given parameter, since that would break the behavior for
drivers which do not fail, but still don't simply truncate the given
parameter. So it is finally up to userland to avoid passing overlong
parameters – with this patch they at least get useful information about
the actual issue.

Closes GH-9541.

show more ...