]> git.ipfire.org Git - thirdparty/postgresql.git/commit
logical decoding: fix decoding of a commit's commit time.
authorAndres Freund <andres@anarazel.de>
Thu, 3 Mar 2016 07:42:21 +0000 (23:42 -0800)
committerAndres Freund <andres@anarazel.de>
Thu, 3 Mar 2016 07:43:42 +0000 (23:43 -0800)
commitf8a75881f90f88f4dc54f3692e4e1691cf2c0a91
tree84cd09a785ce39a44985af604a56d21187f4b314
parent429d6846572fe43dc11496adfeaecadf23925e3f
logical decoding: fix decoding of a commit's commit time.

When adding replication origins in 5aa235042, I somehow managed to set
the timestamp of decoded transactions to InvalidXLogRecptr when decoding
one made without a replication origin. Fix that, and the wrong type of
the new commit_time variable.

This didn't trigger a regression test failure because we explicitly
don't show commit timestamps in the regression tests, as they obviously
are variable. Add a test that checks that a decoded commit's timestamp
is within minutes of NOW() from before the commit.

Reported-By: Weiping Qu
Diagnosed-By: Artur Zakirov
Discussion: 56D4197E.9050706@informatik.uni-kl.de,
    56D42918.1010108@postgrespro.ru
Backpatch: 9.5, where 5aa235042 originates.
contrib/test_decoding/Makefile
contrib/test_decoding/expected/time.out [new file with mode: 0644]
contrib/test_decoding/sql/time.sql [new file with mode: 0644]
src/backend/replication/logical/decode.c