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
116582: workflows: tag EngFlow build with PR link r=rail a=rickystewart Epic: CRDB-8308 Release note: None 116650: sql,plpgsql: correctly handle formatting for PL/pgSQL routine redaction and rewrites r=mgartner a=DrewKimball #### plpgsqltree: check for nil before calling Visit functions This patch adds nil checks to the locations where `tree.SimpleVisit` or `tree.SimpleStmtVisit` are called by `SQLStmtVisitor`. This is necessary because those functions cannot handle nil arguments, and some fields of PL/pgSQL AST structs can be unset. Informs cockroachdb#116480 Release note: None #### plpgsql: fix formatting methods This commit includes the following fixes for the formatting methods of the PL/pgSQL AST nodes: 1. Use `FmtCtx.FormatNode` instead of `node.Format`. This ensures that formatting flags are respected, including those used for redaction. 2. Similar to (1), use the correct `FmtCtx` methods for names and type references. 3. Print loop labels before and after the loop. This ensures that PL/pgSQL loops round trip through the pretty printer. 4. Print a semicolon at the end of formatting a `NULL` statement. This also ensures the pretty-printer round trips correctly. Informs cockroachdb#116480 Release note (bug fix): Fixed the formatting for `PLpgSQL` routines, which could prevent creating a routine with loop labels, and could prevent some expressions from being redacted correctly. The bug only existed in alpha and beta versions of 23.2. #### sql,plpgsql: extend the SQL parser datadriven tests to handle PL/pgSQL This commit factors out common logic between the SQL and PL/pgSQL parser datadriven tests, so that the PL/pgSQL tests can now test that formatting flags are handled correctly, and that the pretty printer correctly round-trips. The improved testing coverage caught some bugs which have been fixed in the previous commit. Informs cockroachdb#116480 Release note: None #### redact: handle PL/pgSQL routines during redaction Previously, the redaction logic would return a syntax error upon attempting to redact a PL/pgSQL UDF or stored procedure. This patch adds logic to switch on the routine language, so that the correct parser is used during redaction. Informs cockroachdb#116480 Release note (bug fix): Fixed a bug that would cause a syntax error during redaction of a PL/pgSQL routine. The bug existed only in alpha and beta versions of the 23.2 release. #### backupccl: correctly handle PL/pgSQL routines during restore This patch adds a switch on the routine language before replacements are made in the body of a UDF or stored procedure. This avoids syntax errors due to incorrectly using the SQL parser on a PL/pgSQL routine during RESTORE. Fixes cockroachdb#116480 Release note (bug fix): Fixed a bug that would cause syntax errors when attempting to RESTORE a database with PL/pgSQL UDFs or stored procedures. This bug only affected alpha and beta versions of 23.2. 116660: Revert "roachtest: remove or roachtests without post restore workload" r=dt a=msbutler This reverts commit 1863417. We realized that it would be nice compare download job speed with and without a workload. Epic: none Release note: none Co-authored-by: Ricky Stewart <[email protected]> Co-authored-by: Drew Kimball <[email protected]> Co-authored-by: Michael Butler <[email protected]>
- Loading branch information