diff options
author | Wez Furlong <wez@php.net> | 2005-02-06 17:49:48 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2005-02-06 17:49:48 +0000 |
commit | c56419ed782a4252f7067a408574325c4eb04497 (patch) | |
tree | 99785d61dd0fd6019b8430608bc68521cd1a2143 /ext/pdo_odbc/odbc_driver.c | |
parent | ca4dc0361cb7f3605790e0a69b9149a335776554 (diff) | |
download | php-git-c56419ed782a4252f7067a408574325c4eb04497.tar.gz |
support getting some more attributes
Diffstat (limited to 'ext/pdo_odbc/odbc_driver.c')
-rwxr-xr-x | ext/pdo_odbc/odbc_driver.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/ext/pdo_odbc/odbc_driver.c b/ext/pdo_odbc/odbc_driver.c index 1014ec92da..aa543360c8 100755 --- a/ext/pdo_odbc/odbc_driver.c +++ b/ext/pdo_odbc/odbc_driver.c @@ -209,7 +209,7 @@ out: return row_count; } -static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen TSRMLS_DC) +static int odbc_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type param_type TSRMLS_DC) { pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; @@ -256,7 +256,23 @@ static int odbc_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) return 1; } +static int odbc_handle_get_attr(pdo_dbh_t *dbh, long attr, zval *val TSRMLS_DC) +{ + switch (attr) { + case PDO_ATTR_CLIENT_VERSION: + ZVAL_STRING(val, "ODBC-" PDO_ODBC_TYPE, 1); + return 1; + + case PDO_ATTR_SERVER_VERSION: + case PDO_ATTR_PREFETCH: + case PDO_ATTR_TIMEOUT: + case PDO_ATTR_SERVER_INFO: + case PDO_ATTR_CONNECTION_STATUS: + break; + } + return 0; +} static struct pdo_dbh_methods odbc_methods = { odbc_handle_closer, @@ -269,7 +285,7 @@ static struct pdo_dbh_methods odbc_methods = { NULL, /* set attr */ NULL, /* last id */ pdo_odbc_fetch_error_func, - NULL, /* get attr */ + odbc_handle_get_attr, /* get attr */ NULL, /* check_liveness */ }; |