RE: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT

From: Huong Dangminh <huo-dangminh(at)ys(dot)jp(dot)nec(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jonathan Allen <jallen(at)americansavingslife(dot)com>, Michael Meskes <meskes(at)postgresql(dot)org>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>, "Akio Iwaasa" <aki-iwaasa(at)vt(dot)jp(dot)nec(dot)com>
Subject: RE: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT
Date: 2018-05-18 05:21:31
Message-ID: 75DB81BEEA95B445AE6D576A0A5C9E936A76E453@BPXM05GP.gisp.nec.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> It seems fairly unfortunate that this patch does not fix the problem for
> as far back as MSVC has "long long" support. From what I can tell, we could
> use _strtoi64 and _strtoui64 on older Windows versions.

Thanks. You are right.
We also should fix for older VS too.

> something like
>
> #if (_MSC_VER > 1200)
> #define HAVE_LONG_LONG_INT_64 1
> #endif
>
> ...
>
> #ifdef HAVE_LONG_LONG_INT_64
> #define HAVE_STRTOLL 1
> /* Before VS2013, use Microsoft's nonstandard equivalent function */ #if
> (_MSC_VER < 1800) #define strtoll _strtoi64 #endif #endif
>
> and similarly for strtoull.
>
> Please check that and see if it works.

Thanks, as you mentioned the attached works fine for me.
I think the code is also fine for the before VS2013 but I not yet tested.

> BTW, is it possible to set up an ecpg test case to verify that this stuff
> works?
> It'd have to handle platforms without long long though, so I'm not
> sure how to deal with that.

Yes. I was expecting that at least bigint will works fine with sqlda in linux
system but it seem did not?
Attached test patch works fine in Windows, but in Linux system
the sqlda->sqlvar[i].sqltype return ECPGt_long but not ECPGt_long_long (as expected)
when reference to bigint column.
Is this another problem in linux? Or am I wrong something?

Thanks and best regards,
---
Dang Minh Huong
NEC Solution Innovators, Ltd.
http://www.nec-solutioninnovators.co.jp/en/

Attachment Content-Type Size
ecpg_with_bigint_V2_test.patch application/octet-stream 33.1 KB
ecpg_with_bigint_V2.patch application/octet-stream 944 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Marco Palombo 2018-05-18 05:23:55 help please !
Previous Message Haribabu Kommi 2018-05-18 02:55:50 Re: BUG #15203: trigger does not recognize schema changes when passing on data