mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
ext/pgsql adding PGSQL_ERRORS_SQLSTATE constant support.
Close GH-11181
This commit is contained in:
parent
3af5f47ce6
commit
f31d253849
6 changed files with 28 additions and 2 deletions
|
@ -112,6 +112,10 @@ char pgsql_libpq_version[16];
|
|||
#define PQfreemem free
|
||||
#endif
|
||||
|
||||
#if PG_VERSION_NUM < 120000
|
||||
#define PQERRORS_SQLSTATE 0
|
||||
#endif
|
||||
|
||||
ZEND_DECLARE_MODULE_GLOBALS(pgsql)
|
||||
static PHP_GINIT_FUNCTION(pgsql);
|
||||
|
||||
|
@ -2821,7 +2825,7 @@ PHP_FUNCTION(pg_set_error_verbosity)
|
|||
|
||||
pgsql = link->conn;
|
||||
|
||||
if (verbosity & (PQERRORS_TERSE|PQERRORS_DEFAULT|PQERRORS_VERBOSE)) {
|
||||
if (verbosity & (PQERRORS_TERSE|PQERRORS_DEFAULT|PQERRORS_VERBOSE|PQERRORS_SQLSTATE)) {
|
||||
RETURN_LONG(PQsetErrorVerbosity(pgsql, verbosity));
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue