@@ -62,7 +62,7 @@ CREATE TABLE data.sc.t2 (a data.welcome);
6262
6363 const full , inc , inc2 = localFoo + "/full" , localFoo + "/inc" , localFoo + "/inc2"
6464
65- beforeTS := sqlDB .QueryStr (t , `SELECT now()::timestamp ::string` )[0 ][0 ]
65+ beforeTS := sqlDB .QueryStr (t , `SELECT now()::timestamptz ::string` )[0 ][0 ]
6666 sqlDB .Exec (t , fmt .Sprintf (`BACKUP DATABASE data TO $1 AS OF SYSTEM TIME '%s'` , beforeTS ), full )
6767
6868 res := sqlDB .QueryStr (t , `
@@ -93,7 +93,7 @@ ORDER BY object_type, object_name`, full)
9393
9494 // Backup the changes by appending to the base and by making a separate
9595 // inc backup.
96- incTS := sqlDB .QueryStr (t , `SELECT now()::timestamp ::string` )[0 ][0 ]
96+ incTS := sqlDB .QueryStr (t , `SELECT now()::timestamptz ::string` )[0 ][0 ]
9797 sqlDB .Exec (t , fmt .Sprintf (`BACKUP DATABASE data TO $1 AS OF SYSTEM TIME '%s'` , incTS ), full )
9898 sqlDB .Exec (t , fmt .Sprintf (`BACKUP DATABASE data TO $1 AS OF SYSTEM TIME '%s' INCREMENTAL FROM $2` , incTS ), inc , full )
9999
@@ -124,9 +124,9 @@ ORDER BY object_type, object_name`, full)
124124 // Truncate decimal places so Go's very rigid parsing will work.
125125 // TODO(bardin): Consider using a third-party library for this, or some kind
126126 // of time-freezing on the test cluster.
127- truncateBackupTimeRE := regexp .MustCompile (`^(.*\.[0-9]{2})[0-9]*$` )
127+ truncateBackupTimeRE := regexp .MustCompile (`^(.*\.[0-9]{2})[0-9]*\+00 $` )
128128 matchResult := truncateBackupTimeRE .FindStringSubmatch (beforeTS )
129- require .NotNil (t , matchResult )
129+ require .NotNil (t , matchResult , "%s does not match %s" , beforeTS , truncateBackupTimeRE )
130130 backupTime , err := time .Parse ("2006-01-02 15:04:05.00" , matchResult [1 ])
131131 require .NoError (t , err )
132132 backupFolder := backupTime .Format (backupbase .DateBasedIntoFolderName )
@@ -168,7 +168,7 @@ ORDER BY object_type, object_name`, full)
168168
169169 // Backup the changes again, by appending to the base and by making a
170170 // separate inc backup.
171- inc2TS := sqlDB .QueryStr (t , `SELECT now()::timestamp ::string` )[0 ][0 ]
171+ inc2TS := sqlDB .QueryStr (t , `SELECT now()::timestamptz ::string` )[0 ][0 ]
172172 sqlDB .Exec (t , fmt .Sprintf (`BACKUP DATABASE data TO $1 AS OF SYSTEM TIME '%s'` , inc2TS ), full )
173173 sqlDB .Exec (t , fmt .Sprintf (`BACKUP DATABASE data TO $1 AS OF SYSTEM TIME '%s' INCREMENTAL FROM $2, $3` , inc2TS ), inc2 , full , inc )
174174
@@ -633,7 +633,7 @@ func TestShowBackupTenants(t *testing.T) {
633633 defer conn10 .Close ()
634634 tenant10 := sqlutils .MakeSQLRunner (conn10 )
635635 tenant10 .Exec (t , `CREATE DATABASE foo; CREATE TABLE foo.bar(i int primary key); INSERT INTO foo.bar VALUES (110), (210)` )
636- beforeTS := systemDB .QueryStr (t , `SELECT now()::timestamp ::string` )[0 ][0 ]
636+ beforeTS := systemDB .QueryStr (t , `SELECT now()::timestamptz ::string` )[0 ][0 ]
637637
638638 systemDB .Exec (t , fmt .Sprintf (`BACKUP TENANT 10 TO 'nodelocal://1/t10' AS OF SYSTEM TIME '%s'` , beforeTS ))
639639
@@ -726,7 +726,7 @@ func TestShowBackupWithDebugIDs(t *testing.T) {
726726
727727 const full = localFoo + "/full"
728728
729- beforeTS := sqlDB .QueryStr (t , `SELECT now()::timestamp ::string` )[0 ][0 ]
729+ beforeTS := sqlDB .QueryStr (t , `SELECT now()::timestamptz ::string` )[0 ][0 ]
730730 sqlDB .Exec (t , fmt .Sprintf (`BACKUP DATABASE data TO $1 AS OF SYSTEM TIME '%s'` , beforeTS ), full )
731731
732732 // extract the object IDs for the database and public schema
0 commit comments