Fix compilation on Windows with WAL_DEBUG
authorMichael Paquier <[email protected]>
Wed, 6 Dec 2023 05:10:39 +0000 (14:10 +0900)
committerMichael Paquier <[email protected]>
Wed, 6 Dec 2023 05:10:39 +0000 (14:10 +0900)
This has been broken since b060dbe0001a that has reworked the callback
mechanism of XLogReader, most likely unnoticed because any form of
development involving WAL happens on platforms where this compiles fine.

Author: Bharath Rupireddy
Discussion: https://postgr.es/m/CALj2ACVF14WKQMFwcJ=3okVDhiXpuK5f7YdT+BdYXbbypMHqWA@mail.gmail.com
Backpatch-through: 13

src/backend/access/transam/xlog.c

index 6526bd4f43203c9fa63dbc14551a1d0894a54f87..2d603d8dee23ccf06f593a9b8c035eddc5bb4a19 100644 (file)
@@ -1029,8 +1029,10 @@ XLogInsertRecord(XLogRecData *rdata,
 
        if (!debug_reader)
            debug_reader = XLogReaderAllocate(wal_segment_size, NULL,
-                                             XL_ROUTINE(), NULL);
-
+                                             XL_ROUTINE(.page_read = NULL,
+                                                        .segment_open = NULL,
+                                                        .segment_close = NULL),
+                                             NULL);
        if (!debug_reader)
        {
            appendStringInfoString(&buf, "error decoding record: out of memory while allocating a WAL reading processor");