Skip to content

Commit

Permalink
ext/psql: pg_meta_data, extended mode, fix typo for pseudo typtype.
Browse files Browse the repository at this point in the history
Closes GH-10865.
  • Loading branch information
devnexen committed Mar 18, 2023
1 parent 53763e1 commit 5adeed3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NEWS
Expand Up @@ -33,6 +33,10 @@ PHP NEWS
. Add missing error checks on EVP_MD_CTX_create() and EVP_VerifyInit().
(nielsdos)

- PGSQL:
. Fixed typo in the array returned from pg_meta_data (extended mode).
(David Carlier)

- SPL:
. Fixed bug GH-10519 (Array Data Address Reference Issue). (Nathan Freeman)

Expand Down
2 changes: 1 addition & 1 deletion ext/pgsql/pgsql.c
Expand Up @@ -4343,7 +4343,7 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const zend_string
/* pg_type.typtype */
add_assoc_bool_ex(&elem, "is base", sizeof("is base") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "b"));
add_assoc_bool_ex(&elem, "is composite", sizeof("is composite") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "c"));
add_assoc_bool_ex(&elem, "is pesudo", sizeof("is pesudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "p"));
add_assoc_bool_ex(&elem, "is pseudo", sizeof("is pseudo") - 1, !strcmp(PQgetvalue(pg_result, i, 7), "p"));
/* pg_description.description */
add_assoc_string_ex(&elem, "description", sizeof("description") - 1, PQgetvalue(pg_result, i, 8));
}
Expand Down
4 changes: 2 additions & 2 deletions ext/pgsql/tests/pg_meta_data_001.phpt
Expand Up @@ -122,7 +122,7 @@ array(2) {
bool(true)
["is composite"]=>
bool(false)
["is pesudo"]=>
["is pseudo"]=>
bool(false)
["description"]=>
string(0) ""
Expand All @@ -147,7 +147,7 @@ array(2) {
bool(true)
["is composite"]=>
bool(false)
["is pesudo"]=>
["is pseudo"]=>
bool(false)
["description"]=>
string(0) ""
Expand Down

0 comments on commit 5adeed3

Please sign in to comment.