RE: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT
Huong Dangminh <huo-dangminh@ys.jp.nec.com>
From: Huong Dangminh <huo-dangminh@ys.jp.nec.com>
To: Tom Lane <tgl@sss.pgh.pa.us>,
Jonathan Allen <jallen@americansavingslife.com>
Cc: Michael Meskes <meskes@postgresql.org>,
Andrew Gierth <andrew@tao11.riddles.org.uk>,
"pgsql-bugs@lists.postgresql.org" <pgsql-bugs@lists.postgresql.org>,
Akio Iwaasa <aki-iwaasa@vt.jp.nec.com>
Date: 2018-05-17T11:35:00Z
Lists: pgsql-bugs
Attachments
- ecpg_with_bigint.patch (application/octet-stream) patch
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: Friday, May 11, 2018 12:36 PM
> To: Jonathan Allen <jallen@americansavingslife.com>
> Cc: Michael Meskes <meskes@postgresql.org>; Andrew Gierth
> <andrew@tao11.riddles.org.uk>; pgsql-bugs@lists.postgresql.org
> Subject: Re: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT
>
> Jonathan Allen <jallen@americansavingslife.com> writes:
> > I saw the release of v10.4 today and was very excited to try using the
> official version of ecpg, but unfortunately I'm getting the same
> "unsupported type "long long" on line x" error. SQL State: YE000, SQL Code:
> -200.
> > ...did this fix not make it into the May release?
>
> Well, we committed *something* about that:
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=fda
> 3e65786763bd43abc576a23035a4cd24ed138
>
> Does that not match the fix you were using?
I confirmed that the above commit fix the case of not define HAVE_LONG_LONG_INT.
But We found another case that causes "unsupported type "long long"" error in
Windows environment.
In our case, We got the same error "unsupported type ...", because of the flag
HAVE_STRTOLL and HAVE_STRTOULL are not defined (*1).
I created a patch which defines the above two flags in Visual Studio 2013 or greater.
# The two functions strtoll and strtoull are support from Visual Studio 2013
Please confirm the attached.
(*1)
In our case, we got the error because the below code was ignored.
src/interfaces/ecpg/ecpglib/data.c
--------------
...
#ifdef HAVE_LONG_LONG_INT
#ifdef HAVE_STRTOLL
case ECPGt_long_long:
*((long long int *) (var + offset * act_tuple)) = strtoll(pval, &scan_length, 10);
if (garbage_left(isarray, &scan_length, compat))
{
ecpg_raise(lineno, ECPG_INT_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
return (false);
}
pval = scan_length;
break;
#endif /* HAVE_STRTOLL */
#ifdef HAVE_STRTOULL
case ECPGt_unsigned_long_long:
*((unsigned long long int *) (var + offset * act_tuple)) = strtoull(pval, &scan_length, 10);
if (garbage_left(isarray, &scan_length, compat))
{
ecpg_raise(lineno, ECPG_UINT_FORMAT, ECPG_SQLSTATE_DATATYPE_MISMATCH, pval);
return (false);
}
pval = scan_length;
break;
#endif /* HAVE_STRTOULL */
#endif /* HAVE_LONG_LONG_INT */
...
--------------
Thanks and best regards,
---
Dang Minh Huong
NEC Solution Innovators, Ltd.
http://www.nec-solutioninnovators.co.jp/en/
Commits
-
Remove configure's check for nonstandard "long long" printf modifiers.
- b929614f5e86 11.0 landed
-
printf("%lf") is not portable, so omit the "l".
- 0aa97b86f902 9.3.24 landed
- fa2cfb962c05 10.5 landed
- e52cabff7054 9.4.19 landed
- c6e846446d17 11.0 landed
- 9c515f77d6cf 9.6.10 landed
- 29a4db65fbb7 9.5.14 landed
-
Support platforms where strtoll/strtoull are spelled __strtoll/__strtoull.
- 91f3bcc9e423 9.3.24 landed
- 8109f201da77 9.4.19 landed
- a5be529aaade 10.5 landed
- 7329af6b9ebf 9.5.14 landed
- 22d22e4bddf6 9.6.10 landed
- 06f66cff9e0b 11.0 landed
-
Arrange to supply declarations for strtoll/strtoull if needed.
- e9f475f991fb 9.3.24 landed
- c964c2147136 10.5 landed
- a6228128fc48 11.0 landed
- 95fef6e82a7d 9.5.14 landed
- 4ffd7909c63a 9.6.10 landed
- 023aa76e1952 9.4.19 landed
-
Hot-fix ecpg regression test for missing ecpg_config.h inclusion.
- d73857d5719e 9.3.24 landed
- 54ae787ca732 9.4.19 landed
- bc8656cf980e 9.5.14 landed
- 4ca492425cd9 9.6.10 landed
- e55a5516deee 10.5 landed
- 5e79405d8299 11.0 landed
-
Add some test coverage for ecpg's "long long" support.
- ec99e9aa110a 9.6.10 landed
- e75c832b29b1 9.4.19 landed
- e21085da56a9 10.5 landed
- dbccdd375b41 11.0 landed
- d9cbe9c9fce9 9.3.24 landed
- 9d6616708d3f 9.5.14 landed
-
Recognize that MSVC can support strtoll() and strtoull().
- f586f8638929 11.0 landed
- cf39aebf17c5 10.5 landed
- 63d3e787f954 9.3.24 landed
- 385f4acbf824 9.4.19 landed
- 25caeae8d279 9.6.10 landed
- 11a110595c72 9.5.14 landed
-
Fix up ecpg's configuration so it handles "long long int" in MSVC builds.
- fda3e6578676 10.4 landed
- f171cbe0d90e 9.5.13 landed
- 87b7e1e88772 9.3.23 landed
- 7ee8005ceddf 9.6.9 landed
- 51057feaa6bd 11.0 landed
- 49f9014c8c1e 9.4.18 landed