Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backupccl: fix backup restore tests for public schema to expect an error #102889

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/ccl/backupccl/backup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10147,7 +10147,11 @@ func TestBackupRestoreTelemetryForPublicSchema(t *testing.T) {
// event.
beforeRestore := timeutil.Now()
restoreQuery := `RESTORE system.public.* FROM LATEST IN $1 WITH into_db=$2`
sqlDB.Exec(t, restoreQuery, loc1, "restore_system")

// This particular restore should error out due to the fact that we don't
// restore some system tables such as the leases table. The expected key
// rewriter error is just the first error that we encounter.
sqlDB.ExpectErr(t, "no rewrite for span", restoreQuery, loc1, "restore_system")

expectedRestoreEvent := eventpb.RecoveryEvent{
CommonEventDetails: logpb.CommonEventDetails{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Test that backing up and restoring the public schema from the system database
# succeeds.
# does not panic.

new-server name=s1 allow-implicit-access
----
Expand All @@ -12,6 +12,10 @@ exec-sql
BACKUP system.public.* INTO 'userfile:///test';
----

exec-sql
# This particular restore should error out due to the fact that we don't
# restore some system tables such as the leases table. The expected key
# rewriter error is just the first error that we encounter.
exec-sql expect-error-regex=(no rewrite for span)
RESTORE system.public.* FROM latest IN 'userfile:///test' WITH into_db='restoredb';
----
regex matches error