-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
JSON + whereNull/whereNotNull is non-intuitive or broken #31473
Comments
@staudenmeir since you sent in #27847 can you maybe weigh in here? Thanks. |
I'll look into it. |
If you want more information on this, there is a MySQL bug on this exact subject (JSON not returning SQL NULL in some cases). This is a distinct behavior in MySQL and I haven't seen this in other SQL engines. https://bugs.mysql.com/bug.php?id=85755 Edit: This also applies to boolean values, JSON functions inside MySQL does not return a SQL boolean type for those either. |
Closing this since this is a MySQL bug. |
@driesvints, this is not a bug in general, please read mysql.com carefully - this is special behavior to distinguish when key exists and when not (same as |
@LastDragon-ru can you point to the parts where it says that? |
@driesvints https://bugs.mysql.com/bug.php?id=85755 (2nd reply)
|
Gotcha thanks. Feel free to send in a PR for this. |
Description:
The
whereNull('a->b')
will generatejson_unquote(json_extract(`a`, '$."b"')) is null
that doesn't work as expected:Desired behavior:
whereNull
should cover both cases:null
(theJSON_TYPE(json_extract(@a, '$."b"')) = 'NULL'
can be used)whereNull
behavior.Also, this issue similar to #27696
The text was updated successfully, but these errors were encountered: