Skip to content

Commit

Permalink
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
4 people committed Dec 18, 2023
4 parents 4da8eda + 77428c2 + f554a1f + dc07a0b commit 1f6a6f1
Show file tree
Hide file tree
Showing 47 changed files with 3,886 additions and 500 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/experimental-github-actions-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
# Instead, we want to check out the PR as is.
ref: ${{ github.event.pull_request.head.sha }}
- run: ./build/github/get-engflow-keys.sh
- run: bazel test //pkg:all_tests --config engflowpublic --config crosslinux --jobs 300 --tls_client_certificate=/home/agent/engflow.crt --tls_client_key=/home/agent/engflow.key --remote_download_minimal
- run: bazel test //pkg:all_tests --config engflowpublic --config crosslinux --jobs 300 --tls_client_certificate=/home/agent/engflow.crt --tls_client_key=/home/agent/engflow.key --remote_download_minimal --bes_keywords=github_pr_number=${{ github.event.pull_request.number }}
- name: clean up
if: always()
run: rm -f /home/agent/engflow.*
Loading

0 comments on commit 1f6a6f1

Please sign in to comment.