Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
110565: sql, insights: record error message for failed stmts r=yuzefovich a=xinhaoz ### Commit 1 sql: modify HasViewActivityOrViewActivityRedactedRole signature This commit adds an additional return value to the function `HasViewActivityOrViewActivityRedactedRole` which returns true if the user has either `VIEWACTIVITY` or `VIEWACTIVITYREDACTED` roles. In addition to that, the function will now return a boolean indicating whether the user is not admin and has the `VIEWACTIVITYREDACTED` role. This simplifies areas where we need to redact values based on the presence of this role, allowing callers to skip an additional role check for admin and VIEWACTIVITYREDACTED. Epic: none Release note: None ### Commit 2 sql, insights: record error message for failed stmts Part of: #87785. Previously, the insights subsystem did not keep track of the error messages for failed executions, only the error codes. This commit updates the `[cluster|node]_execution_insights` and `[cluster|node]_txn_execution_insights` virtual tables to include a `last_error` column which contains the most recent error message. Release note (sql change): adds `last_error` column to the `[cluster|node]_execution_insights` and `[cluster|node]_txn_execution_insights` tables which keeps track of the error message for failed executions. 110966: sql: fix gist decoding in foreign DB r=yuzefovich a=cucaroach When a gist is exported and decoded in a foreign DB it should still decode w/o panic. If a table scan result columns are fed into a group by column the group by column code expects the result columns to be in tact and panics. Fix this by making fake "unknown" result columns so we can print the plan. Making this change led to an unintended change in gists_tpce, this is because the catalog was shared between the test files and I added a table. Fix this for the future by creating a new catalog for each file. But with this change the table ids encoded in the gists_tpce got smaller. Epic: None Fixes: #110964 Release note (bug fix): Fixed panic when decoding gist in DB without the table referred to by the gist. Co-authored-by: Xin Hao Zhang <xzhang@cockroachlabs.com> Co-authored-by: Xin Hao Zhang <xzhang@cockroahchlabs.com> Co-authored-by: Tommy Reilly <treilly@cockroachlabs.com>
- Loading branch information