Skip to content

Conversation

mrotteveel
Copy link
Member

@mrotteveel mrotteveel commented Sep 12, 2025

Fix for #8739

Except for bad_db_handle, I've replaced the invalid handle errors that were associated with 08003 with HY000 (CLI-specific condition - invalid handle as defined in ISO/IEC 9075-9), as already used by for example bad_svc_handle. We could also opt to define a custom subclass of HY for our use (the standard explicitly allows this, as the invalid handle error has no subclass, which means it must either be 000, or implementation-specific, i.e. a subclass starting with 5-9 or I-Z), as HY000 is pretty generic.

One could also argue that it can be 42000 (syntax error or access rule violation as defined in ISO/IEC 9075-2), as already used by bad_req_handle, bad_segstr_handle.

The error alias_conflict_err of the original issues was changed to 42000, just like its siblings procedure_conflict_error and relation_conflict_error already used.

The error batch_open was changed from 08002 to HY010 (CLI-specific condition - function sequence error as defined in ISO/IEC 9075-9), as that seems to match cases in the standard (book 9), where the error is a result of the user calling API functions out of sequence. It can be argued it can be 42000 (syntax error or access rule violation as defined in ISO/IEC 9075-2) as well.

@mrotteveel
Copy link
Member Author

Once we've settled on the SQLstates. I'll also backport this to Firebird 3, 4 and 5.

@dyemanov dyemanov linked an issue Sep 14, 2025 that may be closed by this pull request
@mrotteveel mrotteveel self-assigned this Sep 14, 2025
@mrotteveel mrotteveel merged commit 402365e into FirebirdSQL:master Sep 15, 2025
23 checks passed
@mrotteveel mrotteveel deleted the fix-8739-master branch September 15, 2025 08:47
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.

Wrong SQLSTATE in case of table alias conflict

3 participants