1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

The attached patch updates the thread test program to run stand-alone on

Windows. The test itself is bypassed in configure as discussed, and
libpq has been updated appropriately to allow it to build in thread-safe
mode.

Dave Page
This commit is contained in:
Bruce Momjian
2005-08-23 21:02:05 +00:00
parent f2cec87605
commit 43bf3a6bc6
12 changed files with 227 additions and 66 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.173 2005/08/23 20:48:47 momjian Exp $
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.174 2005/08/23 21:02:03 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -2156,25 +2156,16 @@ PQoidValue(const PGresult *res)
char *endptr = NULL;
unsigned long result;
if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
if (!res ||
!res->cmdStatus ||
strncmp(res->cmdStatus, "INSERT ", 7) != 0 ||
res->cmdStatus[7] < '0' ||
res->cmdStatus[7] > '9')
return InvalidOid;
#ifdef WIN32
SetLastError(0);
#else
errno = 0;
#endif
result = strtoul(res->cmdStatus + 7, &endptr, 10);
if (!endptr || (*endptr != ' ' && *endptr != '\0')
#ifndef WIN32
/*
* On WIN32, errno is not thread-safe and GetLastError() isn't set by
* strtoul(), so we can't check on this platform.
*/
|| errno == ERANGE
#endif
)
if (!endptr || (*endptr != ' ' && *endptr != '\0'))
return InvalidOid;
else
return (Oid) result;