-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
pgwire: add encoding for JSON arguments #88379
Conversation
7b1da83
to
f3f6fa5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
me gusta this solution vs implementing the whole type!
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
@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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
tftr! bors r=ZhouXing19 |
Build succeeded: |
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.
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.
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.
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.
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.
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 <[email protected]>
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.