pgwire: add encoding for JSON arguments#88379
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Sep 23, 2022
Merged
Conversation
Member
7b1da83 to
f3f6fa5
Compare
otan
approved these changes
Sep 21, 2022
Contributor
otan
left a comment
There was a problem hiding this comment.
me gusta this solution vs implementing the whole type!
Contributor
|
hmm, i did miss the test failures though: that seems ... undesirable. let me know if this turns out to have a surprise change and i'll review it again. by the looks of it you "just" need an entry in |
b660d6f to
3c76d09
Compare
Collaborator
Author
|
@otan could you give it another review? i ended up taking the type out of the OidToType map since that would be too invasive. there are some smaller special cases now when decoding in pgwire. (see commit message too.) |
This adds pgwire decoding support for JSON (oid=114). This does not add oid=114 to the OidToType map in types.go since that introduces many other assumptions about the type; namely that the type can be used as the type of a column descriptor. That change would mean that existing tables that were defined with JSON would be inconsistent with new tables defined with a JSON column. Release note (sql change): The pgwire protocol implementation can now accept arguments of the JSON type (oid=114). Previously, it could only accept JSONB (oid=3802). Internally, JSON and JSONB values are still identical, so this change only affects how the values are received over the wire protocol.
3c76d09 to
1fe4c77
Compare
Collaborator
Author
|
tftr! bors r=ZhouXing19 |
Contributor
|
Build succeeded: |
ZhouXing19
added a commit
to ZhouXing19/cockroach
that referenced
this pull request
Jan 5, 2023
fixes cockroachdb#90839 Previously, with the parameter type oid (199) for JSON[], the pgwire parse message will fail to be executed with a `unknown oid type: 199`. We now aliasing it to the one for `JSONB[]`. This commit follows the changes in cockroachdb#88379. Release note (sql change): The pgwire protocol implementation can now accept arguments of the JSON[] type (oid=199). Previously, it could only accept JSONB[] (oid=3804). Internally, JSON[] and JSONB[] values are still identical, so this change only affects how the values are received over the wire protocol.
ZhouXing19
added a commit
to ZhouXing19/cockroach
that referenced
this pull request
Jan 6, 2023
fixes cockroachdb#90839 Previously, with the parameter type oid (199) for JSON[], the pgwire parse message will fail to be executed with a `unknown oid type: 199`. We now aliasing it to the one for `JSONB[]`. This commit follows the changes in cockroachdb#88379. Release note (sql change): The pgwire protocol implementation can now accept arguments of the JSON[] type (oid=199). Previously, it could only accept JSONB[] (oid=3804). Internally, JSON[] and JSONB[] values are still identical, so this change only affects how the values are received over the wire protocol.
ZhouXing19
added a commit
to ZhouXing19/cockroach
that referenced
this pull request
Jan 6, 2023
fixes cockroachdb#90839 Previously, with the parameter type oid (199) for JSON[], the pgwire parse message will fail to be executed with a `unknown oid type: 199`. We now aliasing it to the one for `JSONB[]`. This commit follows the changes in cockroachdb#88379. Release note (sql change): The pgwire protocol implementation can now accept arguments of the JSON[] type (oid=199). Previously, it could only accept JSONB[] (oid=3804). Internally, JSON[] and JSONB[] values are still identical, so this change only affects how the values are received over the wire protocol.
ZhouXing19
added a commit
to ZhouXing19/cockroach
that referenced
this pull request
Jan 18, 2023
fixes cockroachdb#90839 Previously, with the parameter type oid (199) for JSON[], the pgwire parse message will fail to be executed with a `unknown oid type: 199`. We now aliasing it to the one for `JSONB[]`. This commit follows the changes in cockroachdb#88379. Release note (sql change): The pgwire protocol implementation can now accept arguments of the JSON[] type (oid=199). Previously, it could only accept JSONB[] (oid=3804). Internally, JSON[] and JSONB[] values are still identical, so this change only affects how the values are received over the wire protocol.
ZhouXing19
added a commit
to ZhouXing19/cockroach
that referenced
this pull request
Jan 19, 2023
fixes cockroachdb#90839 Previously, with the parameter type oid (199) for JSON[], the pgwire parse message will fail to be executed with a `unknown oid type: 199`. We now aliasing it to the one for `JSONB[]`. This commit follows the changes in cockroachdb#88379. Release note (sql change): The pgwire protocol implementation can now accept arguments of the JSON[] type (oid=199). Previously, it could only accept JSONB[] (oid=3804). Internally, JSON[] and JSONB[] values are still identical, so this change only affects how the values are received over the wire protocol.
craig bot
pushed a commit
that referenced
this pull request
Jan 19, 2023
94705: sql/pgwire: support for decoding JSON[] OID by aliasing to JSONB[] OID r=ZhouXing19 a=ZhouXing19 Previously, with the parameter type oid (199) for JSON[], the pgwire parse message will fail to be executed with a `unknown oid type: 199`. We now aliasing it to the one for `JSONB[]`. This PR also includes a test revealing #95434. This commit follows the changes in #88379. fixes #90839 Release note (sql change): The pgwire protocol implementation can now accept arguments of the JSON[] type (oid=199). Previously, it could only accept JSONB[] (oid=3804). Internally, JSON[] and JSONB[] values are still identical, so this change only affects how the values are received over the wire protocol. Co-authored-by: Jane Xing <zhouxing@uchicago.edu>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #88355
This adds pgwire decoding support for JSON (oid=114). This does not add
oid=114 to the OidToType map in types.go since that introduces many
other assumptions about the type; namely that the type can be used as
the type of a column descriptor. That change would mean that existing
tables that were defined with JSON would be inconsistent with new tables
defined with a JSON column.
Release note (sql change): The pgwire protocol implementation can
now accept arguments of the JSON type (oid=114). Previously, it could
only accept JSONB (oid=3802). Internally, JSON and JSONB values are
still identical, so this change only affects how the values are received
over the wire protocol.