Skip site navigation (1) Skip section navigation (2)

Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail

From: Nicolai Tufar <ntufar(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Magnus Hagander <mha(at)sollentuna(dot)net>,PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Date: 2005-03-02 06:06:35
Message-ID: d80929390503012206557ba543@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Tom lane wrote:
> With CVS-tip snprintf I get
> result = '3 42'
> result = '3 3505'

I get similar results:
result = '3 42'
result = '9e-313 1413754129'

Now I agree with you, it is fundamentally broken.
We need to replace this implementation.

Bruce Momjian wrote:
> I can confirm that using "%I64d" for the printf format allows the
> regression tests to pass for int8.

But snprintf.c code does not support "%I64d" construct. It must
be picking OS's vsnprintf()

Bruce Momjian wrote:
> I think FreeBSD does.

I started with FreeBSD's vsnprintf() at first
but was set back by it's complexity and decided to
modify the port/snprintf.c code. Now would you like me
to incorporate FreeBSD's one into the code.
Give me a week and I will come with the patch.

Best regards,
Nicolai Tufar

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2005-03-02 06:33:05
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Previous:From: Tom LaneDate: 2005-03-02 05:38:59
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail

pgsql-patches by date

Next:From: Tom LaneDate: 2005-03-02 06:33:05
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Previous:From: Tom LaneDate: 2005-03-02 05:38:59
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail

pgsql-hackers-win32 by date

Next:From: Tom LaneDate: 2005-03-02 06:33:05
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail
Previous:From: Tom LaneDate: 2005-03-02 05:38:59
Subject: Re: [pgsql-hackers-win32] [HACKERS] snprintf causes regression tests to fail

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group