@@ -1244,7 +1244,7 @@ pg_ptrack_get_and_clear_db(Oid dbOid, Oid tblspcOid)
1244
1244
char * dbname ;
1245
1245
PGresult * res_db ;
1246
1246
PGresult * res ;
1247
- char * result ;
1247
+ bool result ;
1248
1248
1249
1249
params [0 ] = palloc (64 );
1250
1250
params [1 ] = palloc (64 );
@@ -1277,13 +1277,17 @@ pg_ptrack_get_and_clear_db(Oid dbOid, Oid tblspcOid)
1277
1277
1278
1278
if (PQnfields (res ) != 1 )
1279
1279
elog (ERROR , "cannot perform pg_ptrack_get_and_clear_db()" );
1280
-
1281
- result = PQgetvalue (res , 0 , 0 );
1280
+
1281
+ if (!parse_bool (PQgetvalue (res , 0 , 0 ), & result ))
1282
+ elog (ERROR ,
1283
+ "result of pg_ptrack_get_and_clear_db() is invalid: %s" ,
1284
+ PQgetvalue (res , 0 , 0 ));
1285
+
1282
1286
PQclear (res );
1283
1287
pfree (params [0 ]);
1284
1288
pfree (params [1 ]);
1285
1289
1286
- return ( strcmp ( result , "t" ) == 0 ) ;
1290
+ return result ;
1287
1291
}
1288
1292
1289
1293
/* Read and clear ptrack files of the target relation.
@@ -1791,11 +1795,11 @@ pg_stop_backup(pgBackup *backup)
1791
1795
if (sscanf (PQgetvalue (res , 0 , 0 ), XID_FMT , & recovery_xid ) != 1 )
1792
1796
elog (ERROR ,
1793
1797
"result of txid_snapshot_xmax() is invalid: %s" ,
1794
- PQerrorMessage ( conn ));
1798
+ PQgetvalue ( res , 0 , 0 ));
1795
1799
if (!parse_time (PQgetvalue (res , 0 , 1 ), & recovery_time ))
1796
1800
elog (ERROR ,
1797
1801
"result of current_timestamp is invalid: %s" ,
1798
- PQerrorMessage ( conn ));
1802
+ PQgetvalue ( res , 0 , 1 ));
1799
1803
1800
1804
/* Get content for tablespace_map from stop_backup results
1801
1805
* in case of non-exclusive backup
0 commit comments