Skip to content

Commit 0ddb3d9

Browse files
author
Yasuo Ohgaki
committed
Fixed meta data retrieve when OID is larger than 2^31
1 parent d2a83ef commit 0ddb3d9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ PHP NEWS
4646
. Allowed PDO_OCI to compile with Oracle Database 12c client libraries.
4747
(Chris Jones)
4848

49+
- PDO_pgsql:
50+
. Fixed meta data retrieve when OID is larger than 2^31. (Yasuo)
51+
4952
- Phar:
5053
. Fixed Bug #65142 (Missing phar man page). (Remi)
5154

ext/pdo_pgsql/pgsql_statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return
587587
add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type);
588588

589589
/* Fetch metadata from Postgres system catalogue */
590-
spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%d", S->cols[colno].pgsql_type);
590+
spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%u", S->cols[colno].pgsql_type);
591591
res = PQexec(S->H->server, q);
592592
efree(q);
593593

0 commit comments

Comments
 (0)