Skip to content

Output diagnostics when SQLFetch with SQL_ERROR - #15256

Closed
cmb69 wants to merge 1 commit into
php:masterfrom
cmb69:cmb/fetch-diagnostics
Closed

cmb69 wants to merge 1 commit into
php:masterfrom
cmb69:cmb/fetch-diagnostics

Conversation

@cmb69

@cmb69 cmb69 commented Aug 6, 2024

Copy link
Copy Markdown
Member

These diagnostics can be useful, and if not for users, at least for the ext/odbc maintainers. We only call odbc_sql_error() if the previous SQLFetch() or SQLFetchExtended() return SQL_ERROR, because otherwise the diagnostic would be unhelpful ("Failed to fetch error message, SQL state HY000").

Note that the diagnostic is emitted as E_WARNING so technically this is a small BC break.

These diagnostics can be useful, and if not for users, at least for the
ext/odbc maintainers.  We only call `odbc_sql_error()` if the previous
`SQLFetch()` or `SQLFetchExtended()` return `SQL_ERROR`, because
otherwise the diagnostic would be unhelpful ("Failed to fetch error
message, SQL state HY000").

Note that the diagnostic is emitted as `E_WARNING` so technically this
is a small BC break.

@NattyNarwhal NattyNarwhal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be turned into a macro but LGTM

@cmb69 cmb69 closed this in 9c4aa2b Aug 6, 2024
@cmb69

cmb69 commented Aug 6, 2024

Copy link
Copy Markdown
Member Author

could be turned into a macro

I'll leave that for another day; the whole error handling in php_odbc.c is a bit messy. :)

@cmb69
cmb69 deleted the cmb/fetch-diagnostics branch August 6, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants