-
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
133220: opt: plan row-level BEFORE triggers for cascading mutations r=DrewKimball a=DrewKimball #### opt: mechanical changes for BEFORE triggers on cascades This commit consists of the following changes to prepare for adding support for row-level BEFORE triggers to cascading mutations: * Added `unsafe_allow_triggers_modifying_cascades` which will determine whether a trigger can modify the rows mutated by a cascade, default off. * Added a "cascade" argument to `buildRowLevelBeforeTriggers` to provide the context when building a row-level BEFORE trigger. * Refactoring the logic for invoking `crdb_internal.plpgsql_raise` to be re-used for triggers. Informs #132971 Release note: None #### opt: plan row-level BEFORE triggers for cascading mutations This commit adds logic to invoke the functions for row-level BEFORE triggers that are fired by a cascade's mutation. This is mostly straightforward, except for the fact that a row-level BEFORE trigger can actually modify or filter rows-to-be-mutated. In Postgres, it's possible to cause constraint violations via this behavior. This commit adds a runtime check to ensure that trigger functions do not modify cascading updates/deletes. The check is gated behind `unsafe_allow_triggers_modifying_cascades`, default off. Fixes #132971 Release note (sql change): Cascades can now fire row-level BEFORE triggers. By default, attempting to modify or eliminate the cascading update/delete will result in a `Triggered Data Change Violation` error. Users that wish to do this anyway can set `unsafe_allow_triggers_modifying_cascades`. Note that doing so could result in constraint violations, similar to Postgres. #### sql: fix queuing behavior for checks and triggers This commit fixes a bug in `PlanAndRunPostQueries` that could cause check queries to be run more than once. This would cause problems with unclosed resources after query completion. This commit also fixes a minor bug that could cause triggers queued by triggers to be run before newly-queued checks and cascades, instead of after. The following commit includes a regression test. Fixes #133792 Release note: None #### opt: don't add spurious check queries after BEFORE trigger This commit fixes a bug that could cause spurious constraint violation errors when a BEFORE trigger was planned on a cascaded mutation. Since we don't allow triggers to modify the rows of a cascaded mutation, it is safe to avoid the extra check entirely. This commit also adds a diamond-pattern cascade test, with triggers on each table. Fixes #133784 Release note: None 134005: ui: delete old db pages r=xinhaoz a=xinhaoz Delete legacy db pages and related functionality. These pages are now replaced by the v2 db pages. Deleted - Database overview page and related apis - Database details page and related apis - Database table page and related apis Epic: none Release note (ui change): As of 25.1 the legacy db page which was previously available via Advanced Debug is no longer available. 134313: opt: make `max-stack` opt tester option more reliable r=mgartner a=mgartner The `max-stack` opt tester option now runs the test command in a separate goroutine. A fresh stack makes tests using this setting more reliable. It also decreases the `max-stack` of the original test that motivated the `max-stack` option (see #132701) to 100KB, between 65KB in which the test fails after the fix in #132701 and 135KB in which the test fails before the fix. Finally, the test has been disabled under `race` builds which increase the size of stack frames and would cause this test to fail. Epic: None Release note: None 134353: mixedversion: update skip upgrades logic r=RaduBerinde a=RaduBerinde This commit updates the logic that determines which versions support skipping the previous major release during upgrade. Epic: REL-1292 Release note: None Co-authored-by: Drew Kimball <[email protected]> Co-authored-by: Xin Hao Zhang <[email protected]> Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: Radu Berinde <[email protected]>
- Loading branch information
Showing
90 changed files
with
1,111 additions
and
10,336 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
Oops, something went wrong.