mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fold PQresultErrorField() into a macro
This commit is contained in:
parent
5d65789877
commit
7ef1a91508
3 changed files with 11 additions and 25 deletions
|
@ -22,6 +22,7 @@
|
|||
#define PHP_PDO_PGSQL_INT_H
|
||||
|
||||
#include <libpq-fe.h>
|
||||
#include <php.h>
|
||||
|
||||
#define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006"
|
||||
|
||||
|
@ -71,6 +72,12 @@ extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const
|
|||
|
||||
extern struct pdo_stmt_methods pgsql_stmt_methods;
|
||||
|
||||
#ifdef HAVE_PQRESULTERRORFIELD
|
||||
#define pdo_pgsql_sqlstate(r) PQresultErrorField(r, PG_DIAG_SQLSTATE)
|
||||
#else
|
||||
#define pdo_pgsql_sqlstate(r) (const char *)NULL
|
||||
#endif
|
||||
|
||||
#endif /* PHP_PDO_PGSQL_INT_H */
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue