You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
101260: sql: replicating JSON empty array ordering found in Postgres r=mgartner a=Shivs11
Currently, cockroachdb#97928 and cockroachdb#99275 are responsible for laying out a
lexicographical ordering for JSON columns to be forward indexable in
nature. This ordering is based on the rules posted by Postgres and is
in cockroachdb#99849.
However, Postgres currently sorts the empty JSON array before any other
JSON values. A Postgres bug report for this has been opened:
https://www.postgresql.org/message-id/17873-826fdc8bbcace4f1%40postgresql.org
This PR intends on replicating the Postgres behavior.
Fixescockroachdb#105668
Epic: CRDB-24501
Release note: None
108160: roachtest/awsdms: run once a week instead r=Jeremyyang920 a=otan
Save a bit of mad dosh by running awsdms once a weekly instead of daily. We don't need this tested every week.
Epic: None
Release note: None
108300: schemachanger: Unskip some backup tests r=Xiang-Gu a=Xiang-Gu
Randomly skip subtests in the BACKUP/RESTORE suites before parallelizing them.
Epic: None
Release note: None
108328: rowexec: fix TestUncertaintyErrorIsReturned under race r=yuzefovich a=yuzefovich
We just saw a case when `TestUncertaintyErrorIsReturned` failed under race because we got a different DistSQL plan. This seems plausible in case the range cache population (which the test does explicitly) isn't quick enough for some reason, so this commit allows for the DistSQL plan to match the expectation via `SucceedsSoon` (if we happen to get a bad plan, then the following query execution should have the up-to-date range cache).
Fixes: cockroachdb#108250.
Release note: None
108341: importer: fix stale comment on mysqlStrToDatum r=mgartner,DrewKimball a=otan
Release note: None
Epic: None
From cockroachdb#108286 (review)
108370: go.mod: bump Pebble to fffe02a195e3 r=RahulAggarwal1016 a=RahulAggarwal1016
fffe02a1 db: simplify ScanInternal()
df7e2ae1 vfs: deflake TestDiskHealthChecking_Filesystem ff5c929a Rate Limit Scan Statistics
af8c5f27 internal/cache: mark panic messages as redaction-safe
Epic: none
Release note: none
108379: changefeedccl: deflake TestChangefeedSchemaChangeBackfillCheckpoint r=miretskiy a=jayshrivastava
Previously, the test `TestChangefeedSchemaChangeBackfillCheckpoint` would fail because it would read a table span too early. A schema change using the delcarative schema changer will update a table span to point to a new set of ranges. Previously, this test would use the span from before the schema change, which is incorrect. This change makes it use the span from after the schema change.
I stress tested this 30k times under the new schema changer and 10k times under the legacy schema changer to ensure the test is not flaky anymore.
Fixes: cockroachdb#108084
Release note: None
Epic: None
Co-authored-by: Shivam Saraf <[email protected]>
Co-authored-by: Oliver Tan <[email protected]>
Co-authored-by: Xiang Gu <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
Co-authored-by: Rahul Aggarwal <[email protected]>
Co-authored-by: Jayant Shrivastava <[email protected]>
Copy file name to clipboardExpand all lines: docs/tech-notes/jsonb_forward_indexing.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,10 +44,18 @@ The following rules were kept in mind while designing this form of encoding, as
44
44
5. Objects with an equal number of key value pairs are compared in the order:
45
45
`key1`, `value1`, `key2`, `value2`, ….
46
46
47
+
**NOTE:** There is one exception to these rules, which is neither documented by
48
+
Postgres, nor mentioned in the source code: empty arrays are the minimum JSON
49
+
value. As far as we can tell, this is a Postgres bug that has existed for some
50
+
time. We've decided to replicate this behavior to remain consistent with
51
+
Postgres. We've filed a [Postgres bug report](https://www.postgresql.org/message-id/17873-826fdc8bbcace4f1%40postgresql.org)
52
+
to track the issue.
53
+
47
54
In order to satisfy property 1 at all times, tags are defined in an increasing order of bytes.
48
55
These tags will also have to be defined in a way where the tag representing an object is a large byte representation
49
56
for a hexadecimal value (such as 0xff) and the subsequent objects have a value 1 less than the previous one,
50
-
where the ordering is described in point 1 above.
57
+
where the ordering is described in point 1 above. There is a special tag for empty JSON arrays
58
+
in order to handle the special case of empty arrays being ordered before all other JSON values.
51
59
52
60
Additionally, tags representing terminators will also be defined. There will be two terminators, one for the ascending designation and the other for the descending one, and will be required to denote the end of a key encoding of the following JSON values: Objects, Arrays, Number and Strings. JSON Boolean and JSON Null are not required to have the terminator since they do not have variable length encoding due to the presence of a single tag (as explained later in this document).
0 commit comments