Skip to content

JSON partial updates make empty holes #310

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

Open
rusuly opened this issue Jan 31, 2020 · 0 comments
Open

JSON partial updates make empty holes #310

rusuly opened this issue Jan 31, 2020 · 0 comments

Comments

@rusuly
Copy link
Contributor

rusuly commented Jan 31, 2020

Hi,

I'm working on a similar library for .NET and just wanted to share about some behavior that the library may have ignored.
As described in JSON spec JSON partial updates may create empty spaces between keys and values. Some users experience the problem starting from MySQL 8.0.16

Steps to reproduce:
UPDATE t1 SET JsonColumn='{"id": 1, "name": "Monica", "types":[1,"123"]}' WHERE Id = 1; UPDATE t1 SET JsonColumn = JSON_SET(JsonColumn, '$.name', 'Mon') WHERE id = 1;

In my lib I solved the problem by using the offsets and advancing the empty holes although not sure whether it's the correct solution

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

No branches or pull requests

1 participant