Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5035d7b

Browse files
committed
pg_atoi() does range check on int4 data only if
"HAS_LONG_LONG" is defined based on the assumption thatstrtol() would return ERANGE if a platform does not support64-bit integers. In current PostgreSQL 6.5 (and 6.4.2)distribution, "HAS_LONG_LONG" is defined only if platformis "alpha". (See include/port/alpha.h) I think the int4range check should apply to linux_alpha as well. (I havenot tested yet but I guess this might be applicable tonewer Linux/i386 distributions which includes new GCC whichimplements long int as 64-bit int.)
1 parenta6c688d commit5035d7b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/utils/adt/numutils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.30 1999/05/25 16:12:14 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.31 1999/07/08 00:27:01 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -76,7 +76,7 @@ pg_atoi(char *s, int size, int c)
7676
switch (size)
7777
{
7878
casesizeof(int32):
79-
#ifdefHAS_LONG_LONG
79+
#if defined(HAVE_LONG_INT_64)|| defined(HAVE_LONG_LONG_INT_64)
8080
/* won't get ERANGE on these with 64-bit longs... */
8181
if (l<INT_MIN)
8282
{
@@ -88,7 +88,7 @@ pg_atoi(char *s, int size, int c)
8888
errno=ERANGE;
8989
elog(ERROR,"pg_atoi: error reading \"%s\": %m",s);
9090
}
91-
#endif/*HAS_LONG_LONG */
91+
#endif/*HAVE_LONG_INT_64 or HAVE_LONG_LONG_INT_64 */
9292
break;
9393
casesizeof(int16):
9494
if (l<SHRT_MIN)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp