Lines Matching refs:dbh

42 int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line)  in _pdo_mysql_error()  argument
44 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; in _pdo_mysql_error()
56 pdo_err = &dbh->error_code; in _pdo_mysql_error()
70 pefree(einfo->errmsg, dbh->is_persistent); in _pdo_mysql_error()
81 dbh->is_persistent); in _pdo_mysql_error()
88 dbh->is_persistent); in _pdo_mysql_error()
94 dbh->is_persistent); in _pdo_mysql_error()
98 einfo->errmsg = pestrdup(mysql_stmt_error(S->stmt), dbh->is_persistent); in _pdo_mysql_error()
100 einfo->errmsg = pestrdup(mysql_error(H->server), dbh->is_persistent); in _pdo_mysql_error()
114 if (!dbh->methods) { in _pdo_mysql_error()
124 static void pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) in pdo_mysql_fetch_error_func() argument
126 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; in pdo_mysql_fetch_error_func()
130 PDO_DBG_INF_FMT("dbh=%p stmt=%p", dbh, stmt); in pdo_mysql_fetch_error_func()
148 static void mysql_handle_closer(pdo_dbh_t *dbh) in mysql_handle_closer() argument
150 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; in mysql_handle_closer()
153 PDO_DBG_INF_FMT("dbh=%p", dbh); in mysql_handle_closer()
160 pefree(H->einfo.errmsg, dbh->is_persistent); in mysql_handle_closer()
163 pefree(H, dbh->is_persistent); in mysql_handle_closer()
164 dbh->driver_data = NULL; in mysql_handle_closer()
170 static bool mysql_handle_preparer(pdo_dbh_t *dbh, zend_string *sql, pdo_stmt_t *stmt, zval *driver_… in mysql_handle_preparer() argument
172 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; in mysql_handle_preparer()
179 PDO_DBG_INF_FMT("dbh=%p", dbh); in mysql_handle_preparer()
202 strcpy(dbh->error_code, stmt->error_code); in mysql_handle_preparer()
207 pdo_mysql_error(dbh); in mysql_handle_preparer()
225 pdo_mysql_error(dbh); in mysql_handle_preparer()
243 dbh->alloc_own_columns = 1; in mysql_handle_preparer()
258 static zend_long mysql_handle_doer(pdo_dbh_t *dbh, const zend_string *sql) in mysql_handle_doer() argument
260 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; in mysql_handle_doer()
262 PDO_DBG_INF_FMT("dbh=%p", dbh); in mysql_handle_doer()
266 pdo_mysql_error(dbh); in mysql_handle_doer()
271 pdo_mysql_error(dbh); in mysql_handle_doer()
279 pdo_mysql_error(dbh); in mysql_handle_doer()
294 static zend_string *pdo_mysql_last_insert_id(pdo_dbh_t *dbh, const zend_string *name) in pdo_mysql_last_insert_id() argument
296 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; in pdo_mysql_last_insert_id()
308 static zend_string* mysql_handle_quoter(pdo_dbh_t *dbh, const zend_string *unquoted, enum pdo_param… in mysql_handle_quoter() argument
310 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; in mysql_handle_quoter()
330 PDO_DBG_INF_FMT("dbh=%p", dbh); in mysql_handle_quoter()
364 static bool mysql_handle_begin(pdo_dbh_t *dbh) in mysql_handle_begin() argument
370 PDO_DBG_INF_FMT("dbh=%p", dbh); in mysql_handle_begin()
373 return_value = mysql_handle_doer(dbh, command); in mysql_handle_begin()
380 static bool mysql_handle_commit(pdo_dbh_t *dbh) in mysql_handle_commit() argument
383 PDO_DBG_INF_FMT("dbh=%p", dbh); in mysql_handle_commit()
384 if (mysql_commit(((pdo_mysql_db_handle *)dbh->driver_data)->server)) { in mysql_handle_commit()
385 pdo_mysql_error(dbh); in mysql_handle_commit()
393 static bool mysql_handle_rollback(pdo_dbh_t *dbh) in mysql_handle_rollback() argument
396 PDO_DBG_INF_FMT("dbh=%p", dbh); in mysql_handle_rollback()
397 if (mysql_rollback(((pdo_mysql_db_handle *)dbh->driver_data)->server)) { in mysql_handle_rollback()
398 pdo_mysql_error(dbh); in mysql_handle_rollback()
406 static inline int mysql_handle_autocommit(pdo_dbh_t *dbh) in mysql_handle_autocommit() argument
409 PDO_DBG_INF_FMT("dbh=%p", dbh); in mysql_handle_autocommit()
410 PDO_DBG_INF_FMT("dbh->autocommit=%d", dbh->auto_commit); in mysql_handle_autocommit()
411 if (mysql_autocommit(((pdo_mysql_db_handle *)dbh->driver_data)->server, dbh->auto_commit)) { in mysql_handle_autocommit()
412 pdo_mysql_error(dbh); in mysql_handle_autocommit()
420 static bool pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) in pdo_mysql_set_attribute() argument
425 PDO_DBG_INF_FMT("dbh=%p", dbh); in pdo_mysql_set_attribute()
434 if (dbh->auto_commit ^ bval) { in pdo_mysql_set_attribute()
435 dbh->auto_commit = bval; in pdo_mysql_set_attribute()
436 if (!mysql_handle_autocommit(dbh)) { in pdo_mysql_set_attribute()
446 …((pdo_mysql_db_handle *)dbh->driver_data)->assume_national_character_set_strings = lval == PDO_PAR… in pdo_mysql_set_attribute()
454 ((pdo_mysql_db_handle *)dbh->driver_data)->buffered = bval; in pdo_mysql_set_attribute()
463 ((pdo_mysql_db_handle *)dbh->driver_data)->emulate_prepare = bval; in pdo_mysql_set_attribute()
470 ((pdo_mysql_db_handle *)dbh->driver_data)->fetch_table_names = bval; in pdo_mysql_set_attribute()
479 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; in pdo_mysql_set_attribute()
481 pdo_mysql_error(dbh); in pdo_mysql_set_attribute()
492 ((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size = 1024*1024; in pdo_mysql_set_attribute()
493 …PDO_DBG_INF_FMT("Adjusting invalid buffer size to =%l", ((pdo_mysql_db_handle *)dbh->driver_data)-… in pdo_mysql_set_attribute()
495 ((pdo_mysql_db_handle *)dbh->driver_data)->max_buffer_size = lval; in pdo_mysql_set_attribute()
508 static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value) argument
510 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
513 PDO_DBG_INF_FMT("dbh=%p", dbh);
539 pdo_mysql_error(dbh);
546 ZVAL_BOOL(return_value, dbh->auto_commit);
603 static zend_result pdo_mysql_check_liveness(pdo_dbh_t *dbh) argument
605 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
608 PDO_DBG_INF_FMT("dbh=%p", dbh);
618 static void pdo_mysql_request_shutdown(pdo_dbh_t *dbh) argument
621 PDO_DBG_INF_FMT("dbh=%p", dbh);
624 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
639 static bool pdo_mysql_in_transaction(pdo_dbh_t *dbh) argument
641 pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data;
676 static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) argument
712 PDO_DBG_INF_FMT("dbh=%p", dbh);
717 php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 7);
719 H = pecalloc(1, sizeof(pdo_mysql_db_handle), dbh->is_persistent);
727 if (!(H->server = pdo_mysql_init(dbh->is_persistent))) {
728 pdo_mysql_error(dbh);
732 if (dbh->is_persistent) {
737 dbh->driver_data = H;
739 dbh->skip_param_evt =
785 pdo_mysql_error(dbh);
803 pdo_mysql_error(dbh);
823 pdo_mysql_error(dbh);
833 pdo_mysql_error(dbh);
843 pdo_mysql_error(dbh);
852 pdo_mysql_error(dbh);
892 pdo_mysql_error(dbh);
917 pdo_mysql_error(dbh);
922 …unsigned int int_and_float_native = !pdo_attr_lval(driver_options, PDO_ATTR_STRINGIFY_FETCHES, dbh
924 pdo_mysql_error(dbh);
930 pdo_mysql_error(dbh);
948 if (!dbh->username && vars[5].optval) {
949 dbh->username = pestrdup(vars[5].optval, dbh->is_persistent);
952 if (!dbh->password && vars[6].optval) {
953 dbh->password = pestrdup(vars[6].optval, dbh->is_persistent);
962 if (dbh->password) {
963 password_len = strlen(dbh->password);
966 …if (mysqlnd_connect(H->server, host, dbh->username, dbh->password, password_len, dbname, dbname_le…
969 …if (mysql_real_connect(H->server, host, dbh->username, dbh->password, dbname, port, unix_socket, c…
971 pdo_mysql_error(dbh);
975 if (!dbh->auto_commit) {
976 mysql_handle_autocommit(dbh);
981 dbh->alloc_own_columns = 1;
982 dbh->max_escaped_char_length = 2;
983 dbh->methods = &mysql_methods;
994 dbh->methods = &mysql_methods;