summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/mysql_driver.c
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2011-01-07 14:58:23 +0000
committerKalle Sommer Nielsen <kalle@php.net>2011-01-07 14:58:23 +0000
commit1351c2e2c6c17243c6ae7f0c22b3c67407b6e28c (patch)
treedc1795a677226c9f762ef6163b247b7f845c12d1 /ext/pdo_mysql/mysql_driver.c
parent7b330e0e96284d61a0b6077ae21deb45899bb4e5 (diff)
downloadphp-git-1351c2e2c6c17243c6ae7f0c22b3c67407b6e28c.tar.gz
Update to use mysql_options() instead of mysql_set_character_set() (As suggested by Andrey)
Diffstat (limited to 'ext/pdo_mysql/mysql_driver.c')
-rwxr-xr-xext/pdo_mysql/mysql_driver.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/pdo_mysql/mysql_driver.c b/ext/pdo_mysql/mysql_driver.c
index b04a17866d..bbf0a2ce0c 100755
--- a/ext/pdo_mysql/mysql_driver.c
+++ b/ext/pdo_mysql/mysql_driver.c
@@ -683,6 +683,13 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
#endif
}
+#ifdef PDO_MYSQL_HAS_CHARSET_X
+ if (vars[0].optval && mysql_options(H->server, MYSQL_SET_CHARSET_NAME, vars[0].optval)) {
+ pdo_mysql_error(dbh);
+ goto cleanup;
+ }
+#endif
+
dbname = vars[1].optval;
host = vars[2].optval;
if(vars[3].optval) {
@@ -711,13 +718,6 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
goto cleanup;
}
-#ifdef PDO_MYSQL_HAS_CHARSET
- if (vars[0].optval && mysql_set_character_set(H->server, vars[0].optval)) {
- pdo_mysql_error(dbh);
- goto cleanup;
- }
-#endif
-
if (!dbh->auto_commit) {
mysql_handle_autocommit(dbh TSRMLS_CC);
}