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

Fix logical bug in decodeJson() function #113

Merged
merged 1 commit into from
Dec 1, 2021
Merged

Conversation

crtlib
Copy link
Contributor

@crtlib crtlib commented Aug 2, 2021

😬

@bzikarsky
Copy link

While the description is not descriptive, this commit contains a rather important fix in regards to JSON unpacking. We ran into fun binary-soup-strings without this fix.

@kelunik
Copy link
Member

kelunik commented Aug 6, 2021

Could you please add a test case?

@crtlib
Copy link
Contributor Author

crtlib commented Aug 10, 2021

Added a simple test for decodeJson() function. Is it ok @kelunik ?

@kelunik
Copy link
Member

kelunik commented Aug 10, 2021

I was thinking about an integration test reading a json value from the database.

@bzikarsky
Copy link

I am not sure whether MySQL/MariaDB can be coerced to sending base64 (or non-base64) JSON on purpose. WDYT @crtlib -you triaged this so far.

@crtlib
Copy link
Contributor Author

crtlib commented Aug 16, 2021

@bzikarsky Hm, good question. Unfortunately, I can't find anything about it on the web 😒
The test I've just pushed is failing for me on MySQL 8.0.22 (without the actual fix).
@kelunik Is it good enough to merge? Or maybe you can help with forcing base64 encoding, so I can enhance the test?

@bzikarsky
Copy link

Can you add a second testcase which runs this against the CI's integration test databases? Even if it's sometimes a NOOP, it's still valuable.

@R4c00n
Copy link

R4c00n commented Nov 30, 2021

@bzikarsky Any hints on how to run it agains CI integration test database? Would really like to see this merged.

@bzikarsky
Copy link

What do you mean? If you look at the existing test code, you can see it already connects to a test database. The travis scripts install a defined version of MariaDB. It's coming down to bootstrapping a test case with a JSON column and querying it.

Btw. I am not a maintainer and just work in the same org as @crtlib. I'd also like to see this merged. 😉

@kelunik kelunik merged commit d0b9a61 into amphp:master Dec 1, 2021
@kelunik
Copy link
Member

kelunik commented Dec 1, 2021

Looking at the code, it's obviously wrong, so I've merged this now. Sorry for the long delay, will prepare a release soon.

@R4c00n
Copy link

R4c00n commented Dec 2, 2021

@kelunik Nice, thanks!

@kelunik
Copy link
Member

kelunik commented Dec 5, 2021

https://github.com/amphp/mysql/releases/tag/v2.1.2 has been tagged now! 🚀

@kelunik kelunik mentioned this pull request Dec 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants