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

Change to address asymmetric treatment of bytea <->binary values #142

Merged
merged 2 commits into from Jul 25, 2017

Conversation

sir-galahad
Copy link
Contributor

varbinary and bytea values can be compared to escaped strings in mysql and postgres respectively, but with different formats (X'0102' vs '\x0101') up until now mysql_fdw had been sending the postgres string to mysql so equality comparisons would always fail. This change converts the postgres string to mysql's format before sending.

Hopefully this change meets your approval. Thanks for creating mysql_fdw :)

varbinary and bytea values can be compared to escaped strings in mysql and postgres respectively, but with different formats (X'0102' vs '\x0101') up until now mysql_fdw had been sending the postgres string to mysql so equality comparisons would always fail. This change converts the postgres string to mysql's format before sending.
Copy link
Contributor

@ibrarahmad ibrarahmad left a comment

Choose a reason for hiding this comment

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

You need to create a new issue(bug/feature) and then in commit you should write comments along with that issue number.
Example.

Issue - (#10) - Single line comment.

Detail description of the commit.

deparse.c Outdated
@@ -758,6 +758,14 @@ mysql_deparse_const(Const *node, deparse_expr_cxt *context)
case INTERVALOID:
deparse_interval(buf, node->constvalue);
break;
case BYTEAOID:
//the string for BYTEA always seems to be in the format "\\x##"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change the comment style.

Changes to push down binary data in a way that mysql expects.  Added a BYTEAOID  case to mysql_deparse_const to change the format of the hex string from '\xdddd' to X'dddd' where d is a hexdigit
@sir-galahad
Copy link
Contributor Author

@ibrarahmad I believe I have now done what you were asking for.

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.

None yet

2 participants