-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
59490: add licensing info to README r=bdarnell a=gemma-shay Added a section on licensing info. Links to the new Licensing doc (#9338) will not work yet, so will wait to merge until they are up. Closes cockroachdb/docs#7441 60513: sql: ensure REGIONAL BY ROW statements roundtrip r=ajstorm a=otan Resolves #59362 See individual commits for details. 60552: sql: add descriptor validation on write r=postamar a=postamar Previously, we didn't systematically validate descriptors when they were written. Furthermore, there existed no common method to validate descriptors across all descriptor subtypes This commit adds three methods to the catalog.Descriptor interface: 1. ValidateSelf ( context.Context ) error 2. Validate ( context.Context, catalog.DescGetter ) error 3. ValidateTxnCommit ( context.Context, catalog.DescGetter) error Each performs a subset the checks performed by the next. ValidateSelf contains all checks which can be performed in isolation, Validate also performs all those involving DescGetters (i.e. cross-reference checks) and ValidateTxnCommit also performs checks which should only be done at commit-time. An example of the latter is checking that a table has a primary key: dropping the PK is allowed within a transaction as long as a new PK is subsequently provided before committing. This commit adds new validation calls when writing descriptors: 1. ValidateSelf is called prior to Collection adding a descriptor Put to a kv.Batch. At this point, we want descriptors to be at least internally-consistent, both to catch validation errors early and because it's not possible to do cross-reference checking at this point (changes on FKs for instance involve multiple descriptors). 2. ValidateTxnCommit is called on the descs.Collection's uncommitted descriptors when the corresponding txn is about to commit, just prior to the two-version-invariant check. These validations may be disabled using a new cluster setting: sql.catalog.descs.validate_on_write.enabled Setting this to false makes it possible to corrupt the descriptor state using the crdb_internal.unsafe_* functions. Release note: None 60616: builtins: add builtin to retrieve the payload(s) for a span. r=knz,irfansharif a=angelapwen Part of addressing #55733 The `payloads_for_span` builtin retrieves all payloads for a given span ID, given that the span is part of an active trace. The payloads are returned in JSONB format. If the span is not found, or if the span does not have any payloads, the builtin returns an empty JSON object. With the appropriate usage of this builtin and the `crdb_internal.trace_id` builtin as shown in the `contention_event` logic test, all payloads for the current trace may be surfaced. Release note (sql change): add `payloads_for_span` builtin that takes in a span ID and returns its paylods in JSONB format. If the span is not found, or if the span does not have any payloads, the builtin returns an empty JSON object. 60692: sql: add tests for inverted indexes on virtual columns r=mgartner a=mgartner No code changes were needed to support inverted indexes on virtual columns. Release note: None Co-authored-by: Gemma Shay <[email protected]> Co-authored-by: Oliver Tan <[email protected]> Co-authored-by: Marius Posta <[email protected]> Co-authored-by: angelapwen <[email protected]> Co-authored-by: Marcus Gartner <[email protected]>
- Loading branch information
Showing
60 changed files
with
1,129 additions
and
423 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "multiregionccl", | ||
srcs = ["multiregion.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/multiregionccl", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
go_test( | ||
name = "multiregionccl_test", | ||
srcs = [ | ||
"main_test.go", | ||
"regional_by_row_test.go", | ||
"show_test.go", | ||
], | ||
deps = [ | ||
"//pkg/base", | ||
"//pkg/ccl/partitionccl", | ||
"//pkg/ccl/utilccl", | ||
"//pkg/jobs", | ||
"//pkg/keys", | ||
"//pkg/roachpb", | ||
"//pkg/security", | ||
"//pkg/security/securitytest", | ||
"//pkg/server", | ||
"//pkg/sql", | ||
"//pkg/sql/catalog/catalogkv", | ||
"//pkg/sql/execinfra", | ||
"//pkg/sql/sqltestutils", | ||
"//pkg/sql/tests", | ||
"//pkg/testutils", | ||
"//pkg/testutils/serverutils", | ||
"//pkg/testutils/testcluster", | ||
"//pkg/util", | ||
"//pkg/util/leaktest", | ||
"//pkg/util/log", | ||
"//pkg/util/randutil", | ||
"@com_github_cockroachdb_errors//:errors", | ||
"@com_github_stretchr_testify//require", | ||
], | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Licensed as a CockroachDB Enterprise file under the Cockroach Community | ||
// License (the "License"); you may not use this file except in compliance with | ||
// the License. You may obtain a copy of the License at | ||
// | ||
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt | ||
|
||
package multiregionccl_test | ||
|
||
import ( | ||
"os" | ||
"testing" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/ccl/utilccl" | ||
"github.com/cockroachdb/cockroach/pkg/security" | ||
"github.com/cockroachdb/cockroach/pkg/security/securitytest" | ||
"github.com/cockroachdb/cockroach/pkg/server" | ||
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils" | ||
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster" | ||
"github.com/cockroachdb/cockroach/pkg/util/randutil" | ||
) | ||
|
||
//go:generate ../../util/leaktest/add-leaktest.sh *_test.go | ||
|
||
func TestMain(m *testing.M) { | ||
defer utilccl.TestingEnableEnterprise()() | ||
security.SetAssetLoader(securitytest.EmbeddedAssets) | ||
randutil.SeedForTests() | ||
serverutils.InitTestServerFactory(server.TestServerFactory) | ||
serverutils.InitTestClusterFactory(testcluster.TestClusterFactory) | ||
os.Exit(m.Run()) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Licensed as a CockroachDB Enterprise file under the Cockroach Community | ||
// License (the "License"); you may not use this file except in compliance with | ||
// the License. You may obtain a copy of the License at | ||
// | ||
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt | ||
|
||
package multiregionccl |
This file contains 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
Oops, something went wrong.