Skip to content
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: add a comment that JSON behaviour is similar to JSONB #45831

Merged
merged 1 commit into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions pkg/sql/logictest/testdata/logic_test/json_builtins
Original file line number Diff line number Diff line change
Expand Up @@ -324,29 +324,11 @@ SELECT to_json(x.*) FROM (VALUES (1,2)) AS x(a);
----
{"a": 1, "column2": 2}

# TODO(#44465): Implement the test cases below to be compatible with Postgres
# and delete this one
query T
SELECT to_json(x.*) FROM (VALUES (1,2)) AS x(column2);
----
{"column2": 2}

# Odd, but postgres-compatible
# query T
# SELECT to_json(x.*) FROM (VALUES (1,2)) AS x(a,a);
# ----
# {"a": 1, "a": 2}

# query T
# SELECT to_json(x.*) FROM (VALUES (1,2)) AS x(column1);
# ----
# {"column1": 1, "column2": 2}

# query T
# SELECT to_json(x.*) FROM (VALUES (1,2)) AS x(column2);
# ----
# {"column2": 1, "column2": 2}

# Regression test for #39502.
statement ok
SELECT json_agg((3808362714,))
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/sem/builtins/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -2953,6 +2953,8 @@ may increase either contention or retry errors, or both.`,
})),

// JSON functions.
// The behavior of both the JSON and JSONB data types in CockroachDB is
// similar to the behavior of the JSONB data type in Postgres.

"json_to_recordset": makeBuiltin(tree.FunctionProperties{UnsupportedWithIssue: 33285, Category: categoryJSON}),
"jsonb_to_recordset": makeBuiltin(tree.FunctionProperties{UnsupportedWithIssue: 33285, Category: categoryJSON}),
Expand Down