mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Refactored custom PDO_pgsql methods to trigger errors/exceptions
BC Break: the custom methods were previously just return false on failure. Now they throw an exception with a proper error message. An hopefully welcome improvement, but some application might be depending on the old behaviour. FWIW the PDO::pgsqlCopy* methods are not documented, even though they are available since 5.3.x.
This commit is contained in:
parent
1e36e45d97
commit
baabd11929
4 changed files with 104 additions and 50 deletions
|
@ -83,9 +83,11 @@ typedef struct {
|
|||
|
||||
extern pdo_driver_t pdo_pgsql_driver;
|
||||
|
||||
extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *file, int line TSRMLS_DC);
|
||||
#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, __FILE__, __LINE__ TSRMLS_CC)
|
||||
#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, __FILE__, __LINE__ TSRMLS_CC)
|
||||
extern int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, int errcode, const char *sqlstate, const char *msg, const char *file, int line TSRMLS_DC);
|
||||
#define pdo_pgsql_error(d,e,z) _pdo_pgsql_error(d, NULL, e, z, NULL, __FILE__, __LINE__ TSRMLS_CC)
|
||||
#define pdo_pgsql_error_msg(d,e,m) _pdo_pgsql_error(d, NULL, e, NULL, m, __FILE__, __LINE__ TSRMLS_CC)
|
||||
#define pdo_pgsql_error_stmt(s,e,z) _pdo_pgsql_error(s->dbh, s, e, z, NULL, __FILE__, __LINE__ TSRMLS_CC)
|
||||
#define pdo_pgsql_error_stmt_msg(s,e,m) _pdo_pgsql_error(s->dbh, s, e, NULL, m, __FILE__, __LINE__ TSRMLS_CC)
|
||||
|
||||
extern struct pdo_stmt_methods pgsql_stmt_methods;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue