Use signed type for error status#193
Merged
davecramer merged 5 commits intoJul 1, 2026
Merged
Conversation
slproweb.com no longer hosts the 3.5.6 installer (returns 404), which broke the Windows CI download step. Bump to 3.5.7, which is available.
The GitHub Actions windows runner image rolled to Visual Studio 18.0 (VS 2026, MSVC 14.51). The build scripts' hardcoded version switches only recognized up to VS 17.0, so Find-MSBuild threw 'Please use VC10 or later'. BuildAll.ps1 caught that and returned without compiling any drivers, and the WiX step then failed with confusing 'cannot find psqlodbc30a.dll' errors. Map VS 18.0 to MSBuild toolset 18, PlatformToolset v145 (VS 2026's toolset; v144 was skipped by Microsoft), and reuse the vs2022 mimalloc project files (the pinned mimalloc submodule has no vs2026 ide dir; the build passes PlatformToolset=v145 explicitly).
The install step configured the postgresql-x64-17 service to auto-start but never started it in the current job, so tests had no server to connect to. Explicitly start the service and wait briefly for it to accept connections.
timeout /t requires interactive console input, which GitHub Actions does
not provide ("ERROR: Input redirection is not supported"). Use
ping -n 6 127.0.0.1 as a ~5s delay that works in non-interactive shells.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PG_ErrorInfo.statusis currently declared asUInt4, but it stores signed diagnostic codes.Statement warnings are explicitly represented by negative values, for example:
STMT_ERROR_IN_ROW = -6STMT_TRUNCATED = -2STMT_INFO_ONLY = -1Descriptor warnings also use negative values. The diagnostic value flows through the following path:
As a result, a negative warning is first converted to an unsigned value and later converted back to a signed
SQLINTEGER. The latter conversion is implementation-defined when the unsigned value is outside the signed range, and stricter compilers report a signed/unsigned conversion warning.Change
Change
PG_ErrorInfo.statusfromUInt4toInt4.This makes the field consistent with its existing value domain and keeps negative warning codes signed throughout the diagnostic path.
Int4andUInt4are the corresponding signed and unsignedinttypes, so this change does not alter the structure size or alignment. Existing positive error codes are unaffected.Validation
Built both the ANSI and Unicode drivers on Linux with GCC:
The build completed successfully.