Skip to content

Commit ed931f0

Browse files
craig[bot]wenyihu6sumeerbholaDrewKimballjbowens
committed
158722: mmaprototype: add more tests for err in TestNormalizedVoterAllRelatio… r=wenyihu6 a=wenyihu6 Epic: CRDB-55052 Release note: none --- **mmaprototype: add more tests for err in TestNormalizedVoterAllRelationships** --- **mmaprototype: improve comment on relationship** --- **mma: additional case for non-intersecting conjunctions** A=[+region=a, +zone=a1], B=[+region=a, +zone=a2] is now classified as non-intersecting. This fixes an existing todo. --- **mmaprototype: fix conjNonIntersecting** Previously, we started returning conjNonIntersecting when we encounter same type, same key, different values. However, the fix only returned early if the differing value is encountered from cc. This commit changed it so that we also check and return early for b. --- **mmaprototype: add test cases for conjNonIntersecting** 158935: sql: more routine dependency fixes r=DrewKimball a=DrewKimball #### sql: track SET columns in routine dependencies Previously, we did not track dependencies on columns in the SET clause of an UPDATE statement while creating a routine. This meant that it was possible to break a routine by dropping such a column. This commit fixes the bug by adding target columns that are explicitly referenced by an UPDATE statement to the routine dependencies. The new behavior is gated behind the preexisting variable `use_improved_routine_dependency_tracking`. Fixes #158898 Release note (bug fix): Fixed a bug that allowed a column to be dropped from its table even if a routine referenced that column in the SET clause of an UPDATE statement. This fix only applies to newly-created routines. In versions prior to v25.3, the fix must be enabled by setting the session variable `use_improved_routine_dependency_tracking`. #### sql/logictest: rearrange trigger logic test This commit pulls out some re-arranging of the `triggers` logic test to avoid a confusing diff in the following commmit. Epic: None Release note: None #### sql: avoid unnecessary column dependencies in routines Previously, there were several cases where routines would add unnecessary column dependencies: * Columns referenced by a computed column expression would be added to the list of columns referenced by the routine. * BEFORE triggers would confuse the logic used to distinguish explicit from implicit INSERT columns, because triggers change the column IDs to be inserted. This could cause the routine to add implicitly referenced columns to its dependencies. * Dependencies from statements within a trigger would transitively apply to a routine that invoked trigger on a mutation. This commit prevents newly-created routines from adding unnecessary column dependencies in those cases, gated behind the preexisting session setting `use_improved_routine_dependency_tracking`. Fixes #158154 Release note (bug fix): Fixed a bug that caused routines to prevent dropping more columns than necessary, most notably columns referenced by computed column expressions. The fix is gated behind the session setting `use_improved_routine_dependency_tracking`, which is off by default prior to v25.3. 158985: roachtest: wait for disk space reclamation in clearrange r=jbowens a=jbowens In the clearrange roachtests, adapt the completion condition to wait for reclamation of disk space by waiting until the approximate disk size of the key range for the dropped table falls beneath 100 MiB. Additionally, slightly relax the range count condition to reduce the test time. The long tail of reducing from a dozen ranges to just 1 can take significant wall time and is not important to exericse. Epic: none Release note: none 159058: changefeedccl: opt out of db-level feed testing for offline table error r=aerfrei,asg0451 a=log-head A previous patch allowed db-level changefeeds to not end with a terminal error when a watched table becomes offline. The existing test asserted that table-level changefeeds fail with that terminal error. Metamorphic testing caused these changefeeds to instead be changed to db-level, causing the test to fail when no terminal error occurred. This patch opts out from metamorphic db-level testing for the test that asserts that a table-level changefeed fails with a terminal error when encountering an offline table. Fixes: #159056 Release note: None Co-authored-by: wenyihu6 <[email protected]> Co-authored-by: sumeerbhola <[email protected]> Co-authored-by: Drew Kimball <[email protected]> Co-authored-by: Jackson Owens <[email protected]> Co-authored-by: Matthew Lougheed <[email protected]>
5 parents 19b1cfd + a433728 + 2c9adab + a7621f7 + d0f67a1 commit ed931f0

File tree

23 files changed

+979
-487
lines changed

23 files changed

+979
-487
lines changed

pkg/ccl/changefeedccl/changefeed_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5859,7 +5859,10 @@ func TestChangefeedFailOnTableOffline(t *testing.T) {
58595859
sqlDB.Exec(t, `CREATE TABLE for_import (a INT PRIMARY KEY, b INT) WITH (schema_locked=false)`)
58605860
defer sqlDB.Exec(t, `DROP TABLE for_import`)
58615861
sqlDB.Exec(t, `INSERT INTO for_import VALUES (0, NULL)`)
5862-
forImport := feed(t, f, `CREATE CHANGEFEED FOR for_import `)
5862+
forImport := feed(t, f, `CREATE CHANGEFEED FOR for_import `,
5863+
optOutOfMetamorphicDBLevelChangefeed{
5864+
reason: "DB level changefeeds do not fail with 'CHANGEFEED cannot target offline table' terminal error",
5865+
})
58635866
defer closeFeed(t, forImport)
58645867
assertPayloads(t, forImport, []string{
58655868
`for_import: [0]->{"after": {"a": 0, "b": null}}`,
@@ -5903,7 +5906,10 @@ func TestChangefeedFailOnTableOffline(t *testing.T) {
59035906
sqlDB.CheckQueryResultsRetry(t, "SELECT count(*) FROM for_import", [][]string{{"1"}})
59045907

59055908
// Changefeed should fail regardless
5906-
forImport := feed(t, f, `CREATE CHANGEFEED FOR for_import WITH cursor=$1`, start)
5909+
forImport := feed(t, f, `CREATE CHANGEFEED FOR for_import WITH cursor=$1`, start,
5910+
optOutOfMetamorphicDBLevelChangefeed{
5911+
reason: "DB level changefeeds do not fail with 'CHANGEFEED cannot target offline table' terminal error",
5912+
})
59075913
defer closeFeed(t, forImport)
59085914
requireTerminalErrorSoon(context.Background(), t, forImport,
59095915
regexp.MustCompile(`CHANGEFEED cannot target offline table: for_import \(offline reason: "importing"\)`))

0 commit comments

Comments
 (0)