You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0c38e91
Browse filesBrowse the repository at this point in the historyBrowse files
fix: write statement attributes at full SQLULEN width
Every non-pointer attribute on the SQLSetStmtAttr page is declared "An SQLULEN
value" — not one is SQLUINTEGER — and BufferLength is ignored for them, so the
application's buffer is SQLULEN-wide and it is the driver's job to fill it.
SQLGetStmtAttr's Comments describe the alternative as a defect to be worked
around: "some drivers may only write the lower 32-bit or 16-bit of a buffer and
leave the higher-order bit unchanged. Therefore, applications should use a
buffer of SQLULEN and initialize the value to 0 before calling this function."
An application that did not zero its buffer read SQL_ATTR_MAX_ROWS as
0xFFFFFFFF00000000 where the driver meant "no limit". Reported from the Trino
driver, reproduced here with a poisoned buffer before the fix.
On the connection side only SQL_ATTR_ASYNC_ENABLE and SQL_ATTR_ODBC_CURSORS are
SQLULEN; the rest really are SQLUINTEGER, so that stays a two-attribute
exception rather than a blanket change. The test buffers on the statement side
were u32 slots receiving the wider write, and are now SQLULEN too.
Also adds a pre-commit hook rejecting duplicate registered test names. A
function carrying two #[test] attributes is registered twice while its
neighbour, whose attribute it absorbed, stops running — both leave the suite
green, so the registered names are the only place either shows up. Verified to
fail on an injected duplicate.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments