-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-27677: Implement JSON_OVERLAPS()
1) When at least one of the two json documents is of scalar type: 1.a) If value and json document both are scalar, then return true if they have same type and value. 1.b) If json document is scalar but other is array (or vice versa), then return true if array has at least one element of same type and value as scalar. 1.c) If one is scalar and other is object, then return false because it can't be compared. 2) When both arguments are of non-scalar type and below conditons are satisfied then return true: 2.a) When both arguments are arrays: Iterate over the value and json document. If there exists at least one element in other array of same type and value as that of element in value. 2.b) If both arguments are objects: Iterate over value and json document and if there exists at least one key-value pair common between two objects. 2.c) If either of json document or value is array and other is object: Iterate over the array, if an element of type object is found, then compare it with the object (which is the other arguemnt). If the entire object matches i.e all they key value pairs match.
- Loading branch information
1 parent
8680eed
commit a653dde
Showing
5 changed files
with
914 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.