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
sql: implement json compare #43123
Comments
@justinj do you have memories about why this is? For example cockroach/pkg/util/json/json_test.go Line 73 in 1c54631
|
I don't think there's a technical reason, I didn't do it because I thought it would be tricky/error prone (but possible) and not that helpful, but it's caused problems so if someone has the bandwidth to do it it would probably be worthwhile. |
The pg docs have an entry somewhere that details the json compare algorithm. If we add the operator we should follow that doc to the letter. |
There's also an entry about array compares. |
We have marked this issue as stale because it has been inactive for |
[triage] @mgartner to verify that this is now fixed |
While working on sqlsmith, we discovered that the json type doesn't implement the < and <= (and > and >=) operators. There's a json.Compare method, so I went ahead and just added it to the list, assuming that it had been merely forgotten. I wrote a test to generate some json stuff and compare them, and ran it against postgres. The results differed, and should probably be fixed before we add this feature to postgres.
cockroach:
postgres:
Although the orders differ here (which is weird?), the output also differs. Take the
1, []
case, where postgres saysfalse, false
and cockroach saystrue, true
.Jira issue: CRDB-5297
The text was updated successfully, but these errors were encountered: