Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: preliminary executor logic for savepoints
This commit introduces support for regular SQL savepoints in the executor. The following is supported: - recognizing the SAVEPOINT / ROLLBACK TO SAVEPOINT / RELEASE SAVEPOINT statements even when the savepoint name is not "cockroach_restart". - maintaining a list of current active savepoints, and detect when SAVEPOINT and RELEASE/ROLLBACK are mismatched. - issue the `GetSavepoint()` / `RollbackToSavepoint()` / `ReleaseSavepoint()` API calls to the KV layers. - enforce that `cockroarch_restart` (and retry savepoints in general) are not started "under" a regular savepoint. What is not supported yet: - Rejecting ROLLBACK after a DDL statement has executed successfully. - ROLLBACK when the txn is aborted (i.e. after an error). Release note (sql change): CockroachDB now provides rudimentary (incomplete) and experimental support for SQL savepoints. Release note (sql change): CockroachDB supports a new statement `SHOW SAVEPOINT STATUS` which reveals the current stack of active savepoints. This can be used to teach savepoint usage.
- Loading branch information