Skip to content

Commit

Permalink
Fixed meta data retrieve when OID is larger than 2^31
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasuo Ohgaki committed Jul 12, 2013
1 parent d2a83ef commit 0ddb3d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ PHP NEWS
. Allowed PDO_OCI to compile with Oracle Database 12c client libraries.
(Chris Jones)

- PDO_pgsql:
. Fixed meta data retrieve when OID is larger than 2^31. (Yasuo)

- Phar:
. Fixed Bug #65142 (Missing phar man page). (Remi)

Expand Down
2 changes: 1 addition & 1 deletion ext/pdo_pgsql/pgsql_statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return
add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type);

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

Expand Down

0 comments on commit 0ddb3d9

Please sign in to comment.