Skip to content

Added codec for built-in type tid #285

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

Merged
merged 1 commit into from
Apr 26, 2018
Merged

Conversation

fantix
Copy link
Member

@fantix fantix commented Apr 26, 2018

Fixed issue that SELECT ctid, * FROM xxx and SELECT * FROM xxx WHERE ctid = $1 are not working, by adding a new codec for tid. Now tid values are output as a two-item tuple, and both tuple and list with exactly two items are accepted for input.

asyncpg.protocol.protocol.BufferError: unexpected trailing 2 bytes in buffer

(Because tid has 6 bytes, current asyncpg consumes only 4.)

References:

Copy link
Member

@elprans elprans left a comment

Choose a reason for hiding this comment

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

Excellent! Thank you!

@elprans elprans merged commit cddea9c into MagicStack:master Apr 26, 2018
@fantix
Copy link
Member Author

fantix commented Apr 27, 2018

Thanks for merging!

fantix added a commit to fantix/asyncpg that referenced this pull request Apr 28, 2018
@fantix
Copy link
Member Author

fantix commented Apr 28, 2018

@elprans Apologies, looks like pg is using unsigned integers for presentation. I’ve fixed this in a new commit, even though previous patch worked anyway (consistent encode and decode should do, just mismatched pg presentation). Please let me know if the fix is okay and should I create a new PR. Thanks for your time!

@elprans
Copy link
Member

elprans commented Apr 30, 2018

@fantix No worries, please make a followup PR.

@fantix fantix mentioned this pull request May 1, 2018
elprans pushed a commit that referenced this pull request May 1, 2018
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