timeline signedness

Started by Peter Eisentrautover 12 years ago5 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

WAL timelines are unsigned 32-bit integers everywhere, except the
replication parser (replication/repl_gram.y and
replication/repl_scanner.l) treats them as signed 32-bit integers. It's
obviously a corner case, but it would be prudent to be correct about
this. It should be easy to fix in those grammar files.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Peter Eisentraut (#1)
Re: timeline signedness

On Wed, 2013-08-07 at 21:55 -0400, Peter Eisentraut wrote:

WAL timelines are unsigned 32-bit integers everywhere, except the
replication parser (replication/repl_gram.y and
replication/repl_scanner.l) treats them as signed 32-bit integers. It's
obviously a corner case, but it would be prudent to be correct about
this. It should be easy to fix in those grammar files.

Here is a patch to fix this.

Attachments:

timeline-unsigned.patchtext/x-patch; charset=UTF-8; name=timeline-unsigned.patchDownload+7-19
#3Magnus Hagander
magnus@hagander.net
In reply to: Peter Eisentraut (#2)
Re: timeline signedness

On Tue, Aug 13, 2013 at 1:31 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

On Wed, 2013-08-07 at 21:55 -0400, Peter Eisentraut wrote:

WAL timelines are unsigned 32-bit integers everywhere, except the
replication parser (replication/repl_gram.y and
replication/repl_scanner.l) treats them as signed 32-bit integers. It's
obviously a corner case, but it would be prudent to be correct about
this. It should be easy to fix in those grammar files.

Here is a patch to fix this.

Looks fine to me, and looks like the correct thing to do.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Peter Eisentraut (#2)
Re: timeline signedness

On 13.08.2013 14:31, Peter Eisentraut wrote:

On Wed, 2013-08-07 at 21:55 -0400, Peter Eisentraut wrote:

WAL timelines are unsigned 32-bit integers everywhere, except the
replication parser (replication/repl_gram.y and
replication/repl_scanner.l) treats them as signed 32-bit integers. It's
obviously a corner case, but it would be prudent to be correct about
this. It should be easy to fix in those grammar files.

+1

Here is a patch to fix this.

If I'm reading this correctly, timeline 0 no longer throws an error with
this patch.

- Heikki

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#5Peter Eisentraut
peter_e@gmx.net
In reply to: Heikki Linnakangas (#4)
Re: timeline signedness

On Wed, 2013-08-14 at 16:20 +0300, Heikki Linnakangas wrote:

On 13.08.2013 14:31, Peter Eisentraut wrote:

On Wed, 2013-08-07 at 21:55 -0400, Peter Eisentraut wrote:

WAL timelines are unsigned 32-bit integers everywhere, except the
replication parser (replication/repl_gram.y and
replication/repl_scanner.l) treats them as signed 32-bit integers. It's
obviously a corner case, but it would be prudent to be correct about
this. It should be easy to fix in those grammar files.

+1

Here is a patch to fix this.

If I'm reading this correctly, timeline 0 no longer throws an error with
this patch.

Fixed that.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers