postgresql-interfaces/psqlodbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: jarvis24young (@jarvis24young) <[email protected]>
To: postgresql-interfaces/psqlodbc <[email protected]>
Subject: Re: [postgresql-interfaces/psqlodbc] PR #182: Reject invalid SQLPutData lengths
Date: Fri, 08 May 2026 10:22:51 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Updated the patch based on the review feedback.

Changes made:

- Removed the newly added statement error enums and `Statement_sqlstate[]` entries.
- Reused existing statement diagnostics instead:
  - invalid negative `SQLPutData()` length now uses `STMT_INVALID_ARGUMENT_NO` (`HY024`)
  - appending after a NULL/default put-data indicator now uses `STMT_SEQUENCE_ERROR` (`HY010`)
- Added first-call handling for `SQL_DEFAULT_PARAM` so it follows the same early-exit path as `SQL_NULL_DATA` and does not fall through to allocation/copy logic with a negative length.
- Moved the negative `EXEC_used` guard before the large-object / non-large-object branch split, so both paths are protected consistently.
- Added a second regression case for the append-after-`SQL_NULL_DATA` path.

I also updated the PR description to reflect the reused diagnostics and re-ran the WSL regression test:

```text
ODBCSYSINI=. ODBCINSTINI=./odbcinst.ini ODBCINI=./odbc.ini ./exe/dataatexecution-test

connected
Result set:
2
3
Parameter	Status
Fetching result sets for array bound (2 results expected)
1: Result set:
4
2: Result set:
5
Invalid SQLPutData length rejected
SQLPutData append after null rejected
disconnecting
```


view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: github://postgresql-interfaces/psqlodbc
  Cc: [email protected], [email protected]
  Subject: Re: [postgresql-interfaces/psqlodbc] PR #182: Reject invalid SQLPutData lengths
  In-Reply-To: <<[email protected]>>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox