-
Notifications
You must be signed in to change notification settings - Fork 99
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
zero byte in middle of binary array #38
Comments
Interestingly, if my input value (in SQL Server) is a binary(n) or varbinary(n) then I get the error I described before, but if it is a varbinary(max) then the srctype comes in as SYBIMAGE, the bytes are converted to an actual string, which is then converted to a hex value for each ascii character. So \xFA00BC comes back as \x666130306263, since \x66 is hex for 'F', etc. I still expect this to be fixed as part of issue 37, and I'll include SYBIMAGE in the case selection. |
After pushing the commit for issue #37, this does appear to be fixed. Created a table on MS SQL Server:
Then in PostgreSQL:
The results look good:
|
Actually, the constant needs to have two zeros in a row, since each pair is a byte - e.g., \x01020004. I did a similar test and found that it was indeed fixed. |
Ah, of course! My mistake. I'm glad it's fixed. |
Fixed in 1.0.6. |
When there is a zero byte in the middle of a binary array postgresql interprets it as end-of-string in BuildTupleFromCStrings, so the rest of the array gets cut off.
This issue might be resolved as part of issue 37, in which case I'll close this one. But in case it isn't I'm opening this so it doesn't get forgotten.
The text was updated successfully, but these errors were encountered: