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

BINARY sql type comes back as string instead of ubyte[] #225

Open
webloft opened this issue Feb 15, 2021 · 4 comments
Open

BINARY sql type comes back as string instead of ubyte[] #225

webloft opened this issue Feb 15, 2021 · 4 comments

Comments

@webloft
Copy link

webloft commented Feb 15, 2021

According to https://dev.mysql.com/doc/dev/connector-net/6.10/html/T_MySql_Data_MySqlClient_MySqlDbType.htm there are more types to support.

BINARY is currently treaten as string.

@schveiguy
Copy link
Collaborator

This came up recently. I looked into it further, the reason it comes back as string is because that's what the server is reporting. A CHAR/VARCHAR with character set of BINARY.

However, I think it makes sense that the BINARY type should be mapped to ubyte[].

I think this is the only thing that is missing, right?

@schveiguy schveiguy changed the title SQLType is incomplete BINARY sql type comes back as string instead of ubyte[] Sep 1, 2022
@webloft
Copy link
Author

webloft commented Sep 1, 2022

Yeah, defintely since that padded string may not conform with a UTF-sequence. And VARBINARY could also be a non-UTF string, so both should be ubyte[].

I would say GEOMETRY is the last missing type like POINT, POLYGON, LINESTRING, MULTILINESTRING, etc but I don't know how these types get transported. I read about WKB (Well-Known Binary) serialization format. If it comes in this format then there should be a proper mapping for it, I think. Or is it just text?

@schveiguy
Copy link
Collaborator

What type do you get back from the server for GEOMETRY?

@webloft
Copy link
Author

webloft commented Sep 1, 2022

Did a quick test with a script: If I put a POINT in it, a binary string is returned. Looks like that WKB format.

Edit: No sorry, looks a like a BLOB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants