summaryrefslogtreecommitdiff
path: root/ext/pdo/php_pdo_int.h
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2005-01-07 05:23:10 +0000
committerWez Furlong <wez@php.net>2005-01-07 05:23:10 +0000
commit6e0d8dd06f4e5fe63d9c8c28ced70b79c62a7b28 (patch)
treea8007febb21790d6123929b3d57fb901f9f601b0 /ext/pdo/php_pdo_int.h
parent1c9200da92d0652cd6f05d98955b5a5668890bfc (diff)
downloadphp-git-6e0d8dd06f4e5fe63d9c8c28ced70b79c62a7b28.tar.gz
implement SQLSTATE style error codes.
Allow drivers to add methods to dbh and stmt objects (note that we can't use a class, because the use only sees the PDO class). Clarify the api slightly: PDO::exec() is used for one-shot queries that don't return rows PDO::query() is a convenience function for returning a rowset without having to go through the steps of preparing and executing.
Diffstat (limited to 'ext/pdo/php_pdo_int.h')
-rwxr-xr-xext/pdo/php_pdo_int.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h
index 51c0fef392..3db761e6c6 100755
--- a/ext/pdo/php_pdo_int.h
+++ b/ext/pdo/php_pdo_int.h
@@ -51,11 +51,16 @@ extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);
extern void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt TSRMLS_DC);
-#define PDO_DBH_CLEAR_ERR() dbh->error_code = PDO_ERR_NONE
-#define PDO_STMT_CLEAR_ERR() stmt->error_code = PDO_ERR_NONE
+#define PDO_DBH_CLEAR_ERR() strcpy(dbh->error_code, PDO_ERR_NONE)
+#define PDO_STMT_CLEAR_ERR() strcpy(stmt->error_code, PDO_ERR_NONE)
#define PDO_HANDLE_DBH_ERR() if (dbh->error_code) { pdo_handle_error(dbh, NULL TSRMLS_CC); }
#define PDO_HANDLE_STMT_ERR() if (stmt->error_code) { pdo_handle_error(stmt->dbh, stmt TSRMLS_CC); }
+int pdo_sqlstate_init_error_table(void);
+void pdo_sqlstate_fini_error_table(void);
+const char *pdo_sqlstate_state_to_description(char *state);
+int pdo_hash_methods(pdo_dbh_t *dbh, int kind TSRMLS_DC);
+
/*
* Local variables: