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
119493: sql: support OUT parameters in PLpgSQL UDFs r=yuzefovich a=yuzefovich This commit (mostly) adds the support for INOUT / OUT parameters in PLpgSQL UDFs. OUT parameters are not included into the signature (for overload resolution), but they result in uninitialized variables. Any parameter can be left unnamed but can still be referenced via `$i` notation which is unsupported so far. Unlike for SQL UDFs, in PLpgSQL input and output parameters share the same namespace for duplication check. Additionally, this commit fixes a few issues: - for UDFs only input parameters need to be added to the scope of the body - for procedures, all parameters (including OUT) are used for overload resolution. - UDF returning VOID with empty body previously would hit an index out of bounds internal error. Addresses: cockroachdb#100405. Fixes: cockroachdb#119208. Epic: CRDB-30611 Fixes: cockroachdb#119841. Release note: None 119820: sql: fix redaction and visibility of SHOW SESSIONS and SHOW QUERIES r=rafiss a=rafiss Release note (bug fix): If a user has the VIEWACTIVITYREDACTED privilege, then they should not be able to see constants inside of queries that originate from other users in the SHOW SESSIONS result. This redaction was not occurring, but now this is fixed. Release note (bug fix): The SHOW QUERIES and SHOW STATEMENTS commands were incorrectly requiring that the user has the VIEWACTIVITY or VIEWACTIVITYREDACTED privilege. However, a user always should be able to view their own queries, even without this privilege. This is fixed now. Epic: CRDB-35306 119840: restore: limit restore spans to 200 files r=dt a=dt Previously we would limit restore spans to 384MB, but if a backup contained many small files, a large number of these files could be grouped into such a span before it hit the 384MB target. Unfortunately this caused the restore process to open all of those files to process the restore span, leading to very large numbers of concurrent connections when restoring a backup consisting of tiny files. This patch limits the restore spans to 384MB or 200 files, whichever is hit first. Restores of backups with large numbers of tiny files may thus be slightly slower but will better limit their concurrent outbound connections. Fixes cockroachdb#119785. NB: This breaks the test cases for the experimental/disabled support for memory-monitored restores. Given we have no plans to actually enable these at this time, but do need to fix this bug in the normal restore path and backport such a fix, to reduce churn in said backports the tests of the disabled mode are simply skipped in this diff rather modified, in anticipation of removing them completely from the development branch, tracked in cockroachdb#119836. Release note (bug fix): fix a bug where RESTORE on certain backups would open a very large number of concurrent connections to the backup storage provider. Epic: none. Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: David Taylor <[email protected]>
- Loading branch information