summaryrefslogtreecommitdiff
path: root/ext/pdo_pgsql/php_pdo_pgsql_int.h
diff options
context:
space:
mode:
authorMatteo Beccati <mbeccati@php.net>2013-06-04 17:20:20 +0200
committerMatteo Beccati <mbeccati@php.net>2013-06-05 01:58:37 +0200
commitbaabd1192973156ac79c35f6d1b0dced4af8e8fb (patch)
treebe918c41e4cd8e052e1cd26ecece8d308130fa78 /ext/pdo_pgsql/php_pdo_pgsql_int.h
parent1e36e45d97da9e212b00f339c90b995908efa70c (diff)
downloadphp-git-baabd1192973156ac79c35f6d1b0dced4af8e8fb.tar.gz
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.
Diffstat (limited to 'ext/pdo_pgsql/php_pdo_pgsql_int.h')
-rw-r--r--ext/pdo_pgsql/php_pdo_pgsql_int.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/pdo_pgsql/php_pdo_pgsql_int.h b/ext/pdo_pgsql/php_pdo_pgsql_int.h
index 02a6717760..5600a92541 100644
--- a/ext/pdo_pgsql/php_pdo_pgsql_int.h
+++ b/ext/pdo_pgsql/php_pdo_pgsql_int.h
@@ -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;