diff --git a/pkg/ccl/backupccl/create_scheduled_backup.go b/pkg/ccl/backupccl/create_scheduled_backup.go index b2225ddf265b..cc1c62d8ac2f 100644 --- a/pkg/ccl/backupccl/create_scheduled_backup.go +++ b/pkg/ccl/backupccl/create_scheduled_backup.go @@ -349,7 +349,7 @@ func doCreateBackupSchedules( if err != nil { return errors.Wrapf(err, "failed to evaluate backup encryption_passphrase") } - backupNode.Options.EncryptionPassphrase = tree.NewDString(pw) + backupNode.Options.EncryptionPassphrase = tree.NewStrVal(pw) } // Evaluate encryption KMS URIs if set. @@ -363,7 +363,7 @@ func doCreateBackupSchedules( } for _, kmsURI := range kmsURIs { backupNode.Options.EncryptionKMSURI = append(backupNode.Options.EncryptionKMSURI, - tree.NewDString(kmsURI)) + tree.NewStrVal(kmsURI)) } } @@ -374,7 +374,7 @@ func doCreateBackupSchedules( } for _, dest := range destinations { - backupNode.To = append(backupNode.To, tree.NewDString(dest)) + backupNode.To = append(backupNode.To, tree.NewStrVal(dest)) } backupNode.Targets = eval.Targets @@ -603,10 +603,7 @@ func makeBackupSchedule( // We do not set backupNode.AsOf: this is done when the scheduler kicks off the backup. // Serialize backup statement and set schedule executor and its args. - // - // TODO(bulkio): this serialization is erroneous, see issue - // https://github.com/cockroachdb/cockroach/issues/63216 - args.BackupStatement = tree.AsStringWithFlags(backupNode, tree.FmtSimple|tree.FmtShowPasswords) + args.BackupStatement = tree.AsStringWithFlags(backupNode, tree.FmtParsable|tree.FmtShowPasswords) any, err := pbtypes.MarshalAny(args) if err != nil { return nil, nil, err