Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
60744: sql: drop default value when its dependent sequence is dropped r=the-ericwang35 a=the-ericwang35 Fixes #51889 and #20965. Previously, we did not support `DROP SEQUENCE ... CASCADE`, and we simply disallowed dropping sequences that have usages by tables when a user tries to drop a sequence. However, we did not make this check when doing `DROP DATABASE/SCHEMA ... CASCADE`. As a result, if a sequence is used by a table in a different database/schema, we end up dropping a sequence that the table still relies on, resulting in a corrupted default expression. This patch addresses this issue by implementing `DROP SCHEMA ... CASCADE`, which solves the above issue. When we drop anything that contains/owns a sequence with `CASCADE`, we drop those sequences as if `DROP SCHEMA ... CASCADE` was called on them, which prevents the `DEFAULT` expressions from being corrupted, and also allows users to use `DROP SEQUENCE ... CASCADE. `DROP SEQUENCE ... CASCADE` behaves as in Postgres, wherein any default expressions that rely on the dropped sequences are also dropped. Release note (bug fix): Fixed a bug which could result in corrupted descriptors when dropping a database which contains a sequence that was referenced from another database. Release note (bug fix): Fixed a bug where DROP SEQUENCE CASCADE would not properly remove references to itself from table default expressions. Release note (sql change): Added support for dropping a table which owns a sequence. Release justification: low risk bug fix for existing functionality 60952: server: Migrate nodes, {hot-,}ranges, health endpoints to v2 API r=knz a=itsbilal This change adds API v2 compatible versions of the node list, range info per node, ranges info across nodes, hot ranges, and health endpoints. These endpoints all support API v2 header-based authentication, pagination (if applicable), and only return relevant information in the response payloads. One part of #55947. Release note (api change): Add these new HTTP API endpoints: - `/api/v2/nodes/`: Lists all nodes in the cluster - `/api/v2/nodes/<node_id>/ranges`: Lists all ranges on the specified node - `/api/v2/ranges/hot/`: Lists hot ranges in the cluster - `/api/v2/ranges/<range_id>/`: Describes range in more detail - `/api/v2/health/`: Returns an HTTP 200 response if node is healthy. Release justification: Adds more HTTP API endpoints in parallel that do not touch existing code. Co-authored-by: Eric Wang <[email protected]> Co-authored-by: Bilal Akhtar <[email protected]>
- Loading branch information