Support VARBINARY query parameter#299
Merged
Merged
Conversation
02cd3f5 to
19c51a1
Compare
hovaesco
approved these changes
Dec 14, 2022
| .add_field(sql="X'65683F'", python='ZWg/') \ | ||
| .add_field(sql="X''", python='') \ | ||
| .add_field(sql="CAST('' AS VARBINARY)", python='') \ | ||
| .add_field(sql="from_utf8(CAST('😂😂😂😂😂😂' AS VARBINARY))", python='😂😂😂😂😂😂') \ |
Contributor
Author
There was a problem hiding this comment.
Because from_utf8 converts into VARCHAR so it is not relevant here.
hovaesco
approved these changes
Dec 15, 2022
Contributor
Author
|
@hashhar: PTAL |
hashhar
approved these changes
Dec 20, 2022
| def test_binary_query_param(trino_connection): | ||
| cur = trino_connection.cursor(experimental_python_types=True) | ||
|
|
||
| cur.execute("SELECT ?", params=(bytearray("a", "utf-8"),)) |
Member
There was a problem hiding this comment.
Also add a case with non-utf-8 bytes (to make sure implementation isn't doing the stupid thing of converting to str and then decoding/encoding to byte-array).
19c51a1 to
f1904f7
Compare
hashhar
approved these changes
Dec 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Non-technical explanation
Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: