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

md5 function does not recognize binary keyword #8785

Open
nicktobey opened this issue Jan 23, 2025 · 1 comment
Open

md5 function does not recognize binary keyword #8785

nicktobey opened this issue Jan 23, 2025 · 1 comment
Labels
bug Something isn't working correctness We don't return the same result as MySQL

Comments

@nicktobey
Copy link
Contributor

Steps to reproduce:

# create a random binary file
head -c 100 </dev/urandom >myfile
dolt sql -q "select md5(binary load_file('./myfile'));"

Expected output: the md5 hash of the file
Actual output: invalid string for charset utf8mb4: '[bytes]'

@nicktobey
Copy link
Contributor Author

I can't compare to MySQL because I can't seem to get load_file to work on my MySQL server.

I believe the binary keyword is necessary in MySQL because md5 expects a string, and this prevents the engine from attempting to convert the file into a string with the default collation (which will likely fail, as we see above.)

@timsehn timsehn added bug Something isn't working correctness We don't return the same result as MySQL labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctness We don't return the same result as MySQL
Projects
None yet
Development

No branches or pull requests

2 participants