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

Update show warnings example to use text protocol #177

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

greg-rychlewski
Copy link
Member

When I was attempting to see the warnings from a query I got this error using the binary protocol:

** (MyXQL.Error) (1295) (ER_UNSUPPORTED_PS) This command is not supported in the prepared statement protocol yet
     
         query: SHOW WARNINGS

Copy link
Member

@wojtekmach wojtekmach left a comment

Choose a reason for hiding this comment

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

Thanks!

For posterity: I was surprised this didn't just work because we have a feature to gracefully handle these errors. It is by setting MyXQL.query!(..., ..., query_type: :binary_then_text). The default is query_type: :binary. I believe Ecto is using :binary_then_text.

@greg-rychlewski greg-rychlewski merged commit 280b3ac into elixir-ecto:master Feb 19, 2024
10 checks passed
@greg-rychlewski greg-rychlewski deleted the show_warnings branch February 19, 2024 14:36
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