forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
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
96045: opt: check UDFs and UDTs by name when checking metadata dependencies r=DrewKimball a=DrewKimball #### tree: distinguish UDFs and builtins that use a SQL string body This refactor changes the meaning of the `Overload.IsUDF` field to be true only for user-defined functions - meaning those created using `CREATE FUNCTION`. This is contrasted with builtin functions that are defined with a SQL string set in `Overload.Body`. Logic that cares only about user-defined functions can continue checking `Overload.IsUDF`, while cases that deal with the SQL body should use `Overload.HasSQLBody()`. Note that it is insufficient to check whether `Overload.Body` is empty because it is possible to define a UDF with an empty body. #### opt: refactor metadata dependency tracking This commit performs some refactoring for the way data source objects are tracked in `opt.Metadata` in order to make future changes to UDT and UDF dependency tracking easier. More particularly, UDTs and UDFs will be able to re-resolve any references by name. This is necessary in order to handle cases where changes to the search-path cause names in the query to resolve to different objects. #### opt: track UDT references by name in the Metadata Previously, it was possible for invalid queries to be kept in the cache after a schema change, since user-defined types were tracked only by OID. This missed cases where the search path changed which object a name in the query resolved to (or whether it resolved at all). This patch fixes this behavior by tracking UDT references by name, similar to what was already done for data sources. This ensures that the query staleness check doesn't miss changes to the search path. #### opt: track UDFs in the Metadata This patch adds tracking for user-defined functions in `opt.Metadata`. This ensures that the query cache will be correctly invalidated after a schema change or search-path change that could change the query's semantics, or cause it to error. Fixes cockroachdb#95214 Fixes cockroachdb#93082 Fixes cockroachdb#93321 Fixes cockroachdb#96674 Release note (bug fix): Fixed a bug that could prevent a cached query from being invalidated when a UDF or UDT referenced by that query was altered or dropped, or when the schema or database of a UDF or UDT was altered or dropped. 98319: pkg/server: fix `/demologin` to properly redirect to home page r=dhartunian a=abarganier With the introduction of the server controller, we introduced a layer between the HTTP handler and the HTTP server. When this was introduced, the logic to attempt a login to all tenants forgot to handle a specific case for `/demologin`, where the status code is set to a 302 redirect, instead of a 200 status OK. This broke the redirect piece of the `/demologin` endpoint. This patch updates the `attemptLoginToAllTenants` HTTP handler to properly set the 302 response code in the case where the underlying login function does so on the sessionWriter. Release note: none Epic: CRDB-12100 Fixes: cockroachdb#98253 98696: sql: disallow using cluster_logical_timestamp as column default when backfilling r=Xiang-Gu a=Xiang-Gu Previously, `ADD COLUMN ... DEFAULT cluster_logical_timestamp()` would crash the node and leave the table in a corrupt state. The root cause is a nil pointer dereference. This commit fixed it by returning an unimplemented error and hence disallow using this builtin function as default value when backfilling. Fixes: cockroachdb#98269 Release note (bug fix): fixed a bug as detailed in cockroachdb#98269. Co-authored-by: Drew Kimball <drewk@cockroachlabs.com> Co-authored-by: Alex Barganier <abarganier@cockroachlabs.com> Co-authored-by: Xiang Gu <xiang@cockroachlabs.com>
- Loading branch information
Showing
25 changed files
with
683 additions
and
154 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
Oops, something went wrong.