Fix overflow in DecodeInterval - Mailing list pgsql-hackers

From Joseph Koshakow
Subject Fix overflow in DecodeInterval
Date
Msg-id CAAvxfHff0JLYHwyBrtMx_=6wr=k2Xp+D+-X3vEhHjJYMj+mQcg@mail.gmail.com
Whole thread Raw
Responses Re: Fix overflow in DecodeInterval  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
The attached patch fixes an overflow bug in DecodeInterval when applying the units week, decade, century, and millennium. The overflow check logic was modelled after the overflow check at the beginning of `int tm2interval(struct pg_tm *tm, fsec_t fsec, Interval *span);` in timestamp.c.

This is my first patch, so apologies if I screwed up the process somewhere.

- Joe Koshakow
Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Race condition in TransactionIdIsInProgress
Next
From: Tomas Vondra
Date:
Subject: Re: postgres_fdw: using TABLESAMPLE to collect remote sample