Fix matching check in recovery test 042_low_level_backup
authorMichael Paquier <michael@paquier.xyz>
Fri, 17 Oct 2025 04:06:04 +0000 (13:06 +0900)
committerMichael Paquier <michael@paquier.xyz>
Fri, 17 Oct 2025 04:06:04 +0000 (13:06 +0900)
042_low_level_backup compared the result of a query two times with a
comparison operator based on an integer, while the result should be
compared with a string.

The outcome of the tests is currently not impacted by this change.
However, it could be possible that the tests fail to detect future
issues if the query results become different, for some reason.

Oversight in 99b4a63bef94.

Author: Sadhuprasad Patro <b.sadhu@gmail.com>
Discussion: https://postgr.es/m/CAFF0-CHhwNx_Cv2uy7tKjODUbeOgPrJpW4Rpf1jqB16_1bU2sg@mail.gmail.com
Backpatch-through: 17

src/test/recovery/t/042_low_level_backup.pl

index 5749a1df533039226e2f7a81f8a2b1c39601a40d..20b1abf89994e7874ae0c325ad111e3e0b422044 100644 (file)
@@ -105,8 +105,8 @@ copy(
 
 $node_replica->start;
 
-ok($node_replica->safe_psql('postgres', $canary_query) == 0,
-   'canary is missing');
+is($node_replica->safe_psql('postgres', $canary_query),
+   '0', 'canary is missing');
 
 # Check log to ensure that crash recovery was used as there is no
 # backup_label.
@@ -134,8 +134,8 @@ $node_replica->init_from_backup($node_primary, $backup_name,
    has_restoring => 1);
 $node_replica->start;
 
-ok($node_replica->safe_psql('postgres', $canary_query) == 1,
-   'canary is present');
+is($node_replica->safe_psql('postgres', $canary_query),
+   '1', 'canary is present');
 
 # Check log to ensure that backup_label was used for recovery.
 ok($node_replica->log_contains('starting backup recovery with redo LSN'),