pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael.paquier@gmail.com>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Add pg_size_bytes() to parse human-readable size strings.
Date: Sat, 20 Feb 2016 19:33:00 +0900
Message-ID: <CAB7nPqSzz-RJVA_CE_c2_UDEHyphqXuRb1sOKWPEWnoiZTpzmQ@mail.gmail.com> (raw)
In-Reply-To: <CAEZATCUKghAR7bQWNStUkuc6j8DXU0vckD1tGXqgRq_Rf-K8ng@mail.gmail.com>
References: <E1aX4RN-00011i-So@gemulon.postgresql.org>
	<CAB7nPqTRc99KNVcju8BH0NB8RPx8zki7j__S+YCmEir5caRy=A@mail.gmail.com>
	<CAEZATCUKghAR7bQWNStUkuc6j8DXU0vckD1tGXqgRq_Rf-K8ng@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

On Sat, Feb 20, 2016 at 7:17 PM, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> On 20 February 2016 at 10:12, Michael Paquier <michael.paquier@gmail.com> wrote:
>> Happy first commit.
>
> Arg. Not so much.
>
> Looks like I broke something -- looking into it now :-(

The terabyte conversion is at fault:
Expected:
!  -1tb      |    -1099511627776
Result:
!  -1tb      |            -1

+       else if (pg_strcasecmp(strptr, "gb") == 0)
+           multiplier = 1024 * 1024 * 1024;
+       else if (pg_strcasecmp(strptr, "tb") == 0)
+           multiplier = 1024 * 1024 * 1024 * 1024L;
Why adding an 'L' here?
-- 
Michael


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



view thread (9+ messages)  latest in thread

Message-ID: <CAB7nPqSzz-RJVA_CE_c2_UDEHyphqXuRb1sOKWPEWnoiZTpzmQ@mail.gmail.com>
Permalink:  ../CAB7nPqSzz-RJVA_CE_c2_UDEHyphqXuRb1sOKWPEWnoiZTpzmQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CAB7nPqSzz-RJVA_CE_c2_UDEHyphqXuRb1sOKWPEWnoiZTpzmQ@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael.paquier@gmail.com, dean.a.rasheed@gmail.com
  Subject: Re: pgsql: Add pg_size_bytes() to parse human-readable size strings.
  In-Reply-To: <CAB7nPqSzz-RJVA_CE_c2_UDEHyphqXuRb1sOKWPEWnoiZTpzmQ@mail.gmail.com>
  References: <E1aX4RN-00011i-So@gemulon.postgresql.org> <CAB7nPqTRc99KNVcju8BH0NB8RPx8zki7j__S+YCmEir5caRy=A@mail.gmail.com> <CAEZATCUKghAR7bQWNStUkuc6j8DXU0vckD1tGXqgRq_Rf-K8ng@mail.gmail.com> <CAB7nPqSzz-RJVA_CE_c2_UDEHyphqXuRb1sOKWPEWnoiZTpzmQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox