Lines Matching refs:dbh

32 static void pdo_odbc_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info)  in pdo_odbc_fetch_error_func()  argument
34 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in pdo_odbc_fetch_error_func()
55 void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const c… in pdo_odbc_error() argument
61 pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data; in pdo_odbc_error()
64 pdo_error_type *pdo_err = &dbh->error_code; in pdo_odbc_error()
102 if (!dbh->methods) { in pdo_odbc_error()
123 static void odbc_handle_closer(pdo_dbh_t *dbh) in odbc_handle_closer() argument
125 pdo_odbc_db_handle *H = (pdo_odbc_db_handle*)dbh->driver_data; in odbc_handle_closer()
135 pefree(H, dbh->is_persistent); in odbc_handle_closer()
136 dbh->driver_data = NULL; in odbc_handle_closer()
139 static bool odbc_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_o… in odbc_handle_preparer() argument
142 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in odbc_handle_preparer()
161 strcpy(dbh->error_code, stmt->error_code); in odbc_handle_preparer()
207 strcpy(dbh->error_code, stmt->error_code); in odbc_handle_preparer()
217 static zend_long odbc_handle_doer(pdo_dbh_t *dbh, const zend_string *sql) in odbc_handle_doer() argument
219 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in odbc_handle_doer()
267 static bool odbc_handle_begin(pdo_dbh_t *dbh) in odbc_handle_begin() argument
269 if (dbh->auto_commit) { in odbc_handle_begin()
272 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in odbc_handle_begin()
283 static bool odbc_handle_commit(pdo_dbh_t *dbh) in odbc_handle_commit() argument
285 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in odbc_handle_commit()
298 if (dbh->auto_commit) { in odbc_handle_commit()
309 static bool odbc_handle_rollback(pdo_dbh_t *dbh) in odbc_handle_rollback() argument
311 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in odbc_handle_rollback()
323 if (dbh->auto_commit && H->dbc) { in odbc_handle_rollback()
335 static bool odbc_handle_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val) in odbc_handle_set_attr() argument
337 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in odbc_handle_set_attr()
351 if (dbh->in_txn) { in odbc_handle_set_attr()
352 …pdo_raise_impl_error(dbh, NULL, "HY000", "Cannot change autocommit mode while a transaction is alr… in odbc_handle_set_attr()
355 if (dbh->auto_commit ^ bval) { in odbc_handle_set_attr()
356 dbh->auto_commit = bval; in odbc_handle_set_attr()
360 dbh->auto_commit ? (SQLPOINTER) SQL_AUTOCOMMIT_ON : (SQLPOINTER) SQL_AUTOCOMMIT_OFF, in odbc_handle_set_attr()
365 dbh->auto_commit ? "SQLSetConnectAttr AUTOCOMMIT = ON" : "SQLSetConnectAttr AUTOCOMMIT = OFF" in odbc_handle_set_attr()
379 static int pdo_odbc_get_info_string(pdo_dbh_t *dbh, SQLUSMALLINT type, zval *val) in pdo_odbc_get_info_string() argument
384 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in pdo_odbc_get_info_string()
394 static int odbc_handle_get_attr(pdo_dbh_t *dbh, zend_long attr, zval *val) in odbc_handle_get_attr() argument
396 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in odbc_handle_get_attr()
403 return pdo_odbc_get_info_string(dbh, SQL_DBMS_VER, val); in odbc_handle_get_attr()
405 return pdo_odbc_get_info_string(dbh, SQL_DBMS_NAME, val); in odbc_handle_get_attr()
414 ZVAL_BOOL(val, dbh->auto_commit); in odbc_handle_get_attr()
420 static zend_result odbc_handle_check_liveness(pdo_dbh_t *dbh) in odbc_handle_check_liveness() argument
426 pdo_odbc_db_handle *H = (pdo_odbc_db_handle *)dbh->driver_data; in odbc_handle_check_liveness()
468 static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{ */ in pdo_odbc_handle_factory() argument
475 H = pecalloc(1, sizeof(*H), dbh->is_persistent); in pdo_odbc_handle_factory()
477 dbh->driver_data = H; in pdo_odbc_handle_factory()
509 …(SQLPOINTER)(intptr_t)(dbh->auto_commit ? SQL_AUTOCOMMIT_ON : SQL_AUTOCOMMIT_OFF), SQL_IS_INTEGER); in pdo_odbc_handle_factory()
524 if (strchr(dbh->data_source, '=')) { in pdo_odbc_handle_factory()
530 size_t db_len = strlen(dbh->data_source); in pdo_odbc_handle_factory()
531 …bool use_uid_arg = dbh->username != NULL && !php_memnistr(dbh->data_source, "uid=", strlen("uid=")… in pdo_odbc_handle_factory()
532 …bool use_pwd_arg = dbh->password != NULL && !php_memnistr(dbh->data_source, "pwd=", strlen("pwd=")… in pdo_odbc_handle_factory()
536 strcpy(db, dbh->data_source); in pdo_odbc_handle_factory()
548 …should_quote_uid = !php_odbc_connstr_is_quoted(dbh->username) && php_odbc_connstr_should_quote(dbh in pdo_odbc_handle_factory()
550 size_t estimated_length = php_odbc_connstr_estimate_quote_length(dbh->username); in pdo_odbc_handle_factory()
552 php_odbc_connstr_quote(uid, dbh->username, estimated_length); in pdo_odbc_handle_factory()
554 uid = dbh->username; in pdo_odbc_handle_factory()
559 dsn = pemalloc(new_dsn_size, dbh->is_persistent); in pdo_odbc_handle_factory()
565 …should_quote_pwd = !php_odbc_connstr_is_quoted(dbh->password) && php_odbc_connstr_should_quote(dbh in pdo_odbc_handle_factory()
567 size_t estimated_length = php_odbc_connstr_estimate_quote_length(dbh->password); in pdo_odbc_handle_factory()
569 php_odbc_connstr_quote(pwd, dbh->password, estimated_length); in pdo_odbc_handle_factory()
571 pwd = dbh->password; in pdo_odbc_handle_factory()
576 dsn = pemalloc(new_dsn_size, dbh->is_persistent); in pdo_odbc_handle_factory()
585 dsn = pemalloc(new_dsn_size, dbh->is_persistent); in pdo_odbc_handle_factory()
589 pefree((char*)dbh->data_source, dbh->is_persistent); in pdo_odbc_handle_factory()
590 dbh->data_source = dsn; in pdo_odbc_handle_factory()
600 rc = SQLDriverConnect(H->dbc, NULL, (SQLCHAR *) dbh->data_source, strlen(dbh->data_source), in pdo_odbc_handle_factory()
604 …rc = SQLConnect(H->dbc, (SQLCHAR *) dbh->data_source, SQL_NTS, (SQLCHAR *) dbh->username, SQL_NTS,… in pdo_odbc_handle_factory()
614 dbh->methods = &odbc_methods; in pdo_odbc_handle_factory()
615 dbh->alloc_own_columns = 1; in pdo_odbc_handle_factory()
620 dbh->methods = &odbc_methods; in pdo_odbc_handle_factory()