Skip to content

Conversation

@stancl
Copy link

@stancl stancl commented Oct 19, 2025

Since php/php-src#17741, dbh->error_mode is stored as uint8_t. We cast the value to pdo_error_mode for the assignment to work.

Since php/php-src#17742, query_stmt_zval has been replaced by query_stmt_obj. The diff in the linked PR shows the new destructor usage. We follow that same usage in this commit.


A few notes:

  • I have limited experience with php-src, so please review with care. The context in the linked PRs should be sufficient.
  • I did not guard the changes in pdo_dbh.cpp with PHP version checks. I assume (but do not know) that casting from pdo_error_mode to pdo_error_mode (in PHP <= 8.4) shouldn't emit any compiler warnings.
  • Initially I used just (pdo_error_mode) dbh->error_mode but noticed that existing code uses static_cast. I don't have experience with C++ but assume this should be correct.

The changes are confirmed to compile for me locally, but this should be confirmed in CI.

Since php/php-src#17741, dbh->error_mode is
stored as uint8_t. We cast the value to pdo_error_mode for the
assignment to work.

Since php/php-src#17742, query_stmt_zval has
been replaced by query_stmt_obj. The diff in the linked PR shows
the new destructor usage. We follow that same usage in this commit.
@stancl
Copy link
Author

stancl commented Oct 19, 2025

@microsoft-github-policy-service agree

@stancl stancl mentioned this pull request Oct 19, 2025
@Jan-E
Copy link

Jan-E commented Oct 22, 2025

It compiles under Windoiws (VS17). I do not have a running sqlsrv database, so I did not run the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants