Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix possible odbc invalid cursor state #29518

Merged
merged 4 commits into from
Sep 30, 2021

Conversation

kssenii
Copy link
Member

@kssenii kssenii commented Sep 29, 2021

Changelog category (leave one):

  • Bug Fix (user-visible misbehaviour in official stable or prestable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
In ODBC bridge add retries for error Invalid cursor state. It is a retriable error. Closes #29473.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Sep 29, 2021
@Avogar Avogar self-assigned this Sep 29, 2021
/// Invalid cursor state is a retriable error.
/// Invalid transaction state 25000. Truncate to 4 letters, because nanodbc does it.
/// https://docs.microsoft.com/ru-ru/sql/odbc/reference/appendixes/appendix-a-odbc-error-codes?view=sql-server-ver15
if (e.state().starts_with("08") || e.state().starts_with("24") || e.state().starts_with("2500"))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (e.state().starts_with("08") || e.state().starts_with("24") || e.state().starts_with("2500"))
if (e.state().starts_with("08") || e.state().starts_with("24") || e.state().starts_with("25"))

See https://www.postgresql.org/docs/10/errcodes-appendix.html

@kssenii
Copy link
Member Author

kssenii commented Sep 30, 2021

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Sep 30, 2021

Command update: success

Branch has been successfully updated

@kssenii kssenii merged commit ffc4614 into ClickHouse:master Sep 30, 2021
kssenii added a commit that referenced this pull request Oct 1, 2021
Backport #29518 to 21.9: Fix possible odbc invalid cursor state
kssenii added a commit that referenced this pull request Oct 1, 2021
Backport #29518 to 21.8: Fix possible odbc invalid cursor state
kssenii added a commit that referenced this pull request Oct 1, 2021
Backport #29518 to 21.10: Fix possible odbc invalid cursor state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid cursor state from ODBC bridge to SQL Server
4 participants