diff options
Diffstat (limited to 'ext/pdo_mysql/mysql_driver.c')
-rw-r--r-- | ext/pdo_mysql/mysql_driver.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c index 4f75f02cf1..7da8c0d0df 100644 --- a/ext/pdo_mysql/mysql_driver.c +++ b/ext/pdo_mysql/mysql_driver.c @@ -46,7 +46,7 @@ int _pdo_mysql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *file, int line) { pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - pdo_error_type *pdo_err; + pdo_error_type *pdo_err; pdo_mysql_error_info *einfo; pdo_mysql_stmt *S = NULL; @@ -141,7 +141,7 @@ static int pdo_mysql_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *in static int mysql_handle_closer(pdo_dbh_t *dbh) { pdo_mysql_db_handle *H = (pdo_mysql_db_handle *)dbh->driver_data; - + PDO_DBG_ENTER("mysql_handle_closer"); PDO_DBG_INF_FMT("dbh=%p", dbh); if (H) { @@ -169,7 +169,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_ int nsql_len = 0; int ret; int server_version; - + PDO_DBG_ENTER("mysql_handle_preparer"); PDO_DBG_INF_FMT("dbh=%p", dbh); PDO_DBG_INF_FMT("sql=%.*s", sql_len, sql); @@ -206,7 +206,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_ } PDO_DBG_RETURN(0); } - + if (mysql_stmt_prepare(S->stmt, sql, sql_len)) { /* TODO: might need to pull statement specific info here? */ /* if the query isn't supported by the protocol, fallback to emulation */ @@ -247,7 +247,7 @@ static int mysql_handle_preparer(pdo_dbh_t *dbh, const char *sql, zend_long sql_ fallback: end: stmt->supports_placeholders = PDO_PLACEHOLDER_NONE; - + PDO_DBG_RETURN(1); } /* }}} */ @@ -374,9 +374,9 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) PDO_DBG_INF_FMT("dbh=%p", dbh); PDO_DBG_INF_FMT("attr=%l", attr); switch (attr) { - case PDO_ATTR_AUTOCOMMIT: + case PDO_ATTR_AUTOCOMMIT: convert_to_boolean(val); - /* ignore if the new value equals the old one */ + /* ignore if the new value equals the old one */ if (dbh->auto_commit ^ (Z_TYPE_P(val) == IS_TRUE)) { dbh->auto_commit = (Z_TYPE_P(val) == IS_TRUE); mysql_handle_autocommit(dbh); @@ -385,13 +385,13 @@ static int pdo_mysql_set_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val) case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY: convert_to_boolean(val); - /* ignore if the new value equals the old one */ + /* ignore if the new value equals the old one */ ((pdo_mysql_db_handle *)dbh->driver_data)->buffered = (Z_TYPE_P(val) == IS_TRUE); PDO_DBG_RETURN(1); case PDO_MYSQL_ATTR_DIRECT_QUERY: case PDO_ATTR_EMULATE_PREPARES: convert_to_boolean(val); - /* ignore if the new value equals the old one */ + /* ignore if the new value equals the old one */ ((pdo_mysql_db_handle *)dbh->driver_data)->emulate_prepare = (Z_TYPE_P(val) == IS_TRUE); PDO_DBG_RETURN(1); case PDO_ATTR_FETCH_TABLE_NAMES: @@ -458,7 +458,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_ case PDO_ATTR_AUTOCOMMIT: ZVAL_LONG(return_value, dbh->auto_commit); break; - + case PDO_MYSQL_ATTR_USE_BUFFERED_QUERY: ZVAL_LONG(return_value, H->buffered); break; @@ -475,7 +475,7 @@ static int pdo_mysql_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_ #endif default: - PDO_DBG_RETURN(0); + PDO_DBG_RETURN(0); } PDO_DBG_RETURN(1); @@ -512,7 +512,7 @@ static int pdo_mysql_check_liveness(pdo_dbh_t *dbh) signal(SIGPIPE, handler); #endif /* end mysql_ping() */ PDO_DBG_RETURN(SUCCESS); -} +} /* }}} */ /* {{{ mysql_methods */ @@ -591,7 +591,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) pdo_mysql_error(dbh); goto cleanup; } - + dbh->driver_data = H; #ifndef PDO_USE_MYSQLND @@ -614,7 +614,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) H->emulate_prepare = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_DIRECT_QUERY, H->emulate_prepare); - H->emulate_prepare = pdo_attr_lval(driver_options, + H->emulate_prepare = pdo_attr_lval(driver_options, PDO_ATTR_EMULATE_PREPARES, H->emulate_prepare); #ifndef PDO_USE_MYSQLND @@ -637,7 +637,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) #if PHP_API_VERSION < 20100412 if ((PG(open_basedir) && PG(open_basedir)[0] != '\0') || PG(safe_mode)) #else - if (PG(open_basedir) && PG(open_basedir)[0] != '\0') + if (PG(open_basedir) && PG(open_basedir)[0] != '\0') #endif { local_infile = 0; @@ -667,7 +667,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) } efree(init_cmd); } -#ifndef PDO_USE_MYSQLND +#ifndef PDO_USE_MYSQLND default_file = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_FILE, NULL); if (default_file) { if (mysql_options(H->server, MYSQL_READ_DEFAULT_FILE, (const char *)default_file)) { @@ -677,7 +677,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) } efree(default_file); } - + default_group= pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_READ_DEFAULT_GROUP, NULL); if (default_group) { if (mysql_options(H->server, MYSQL_READ_DEFAULT_GROUP, (const char *)default_group)) { @@ -701,7 +701,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) ssl_ca = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CA, NULL); ssl_capath = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CAPATH, NULL); ssl_cipher = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CIPHER, NULL); - + if (ssl_key || ssl_cert || ssl_ca || ssl_capath || ssl_cipher) { mysql_ssl_set(H->server, ssl_key, ssl_cert, ssl_ca, ssl_capath, ssl_cipher); if (ssl_key) { @@ -744,12 +744,12 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) #endif dbname = vars[1].optval; - host = vars[2].optval; + host = vars[2].optval; if(vars[3].optval) { port = atoi(vars[3].optval); } if (vars[2].optval && !strcmp("localhost", vars[2].optval)) { - unix_socket = vars[4].optval; + unix_socket = vars[4].optval; } /* TODO: - Check zval cache + ZTS */ @@ -782,14 +782,14 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options) dbh->methods = &mysql_methods; ret = 1; - + cleanup: for (i = 0; i < sizeof(vars)/sizeof(vars[0]); i++) { if (vars[i].freeme) { efree(vars[i].optval); } } - + dbh->methods = &mysql_methods; PDO_DBG_RETURN(ret); |