]> git.pld-linux.org Git - packages/php.git/blame - php-pdo_mysql-charsetphpini.patch
- revert rev1.954 - causes segfaults in zip file processing; rel 9
[packages/php.git] / php-pdo_mysql-charsetphpini.patch
CommitLineData
c2f30c63
ER
1This is damn ugly patch if you need to update it, see PHP_5_2 branch version to
2understand what this patch is supposed to do as in 5.3 the ini section is
3enabled only if mysqlnd driver is enabled which makes the contexts really
4small.
5
6--- php-5.3.1/ext/pdo_mysql/mysql_driver.c~ 2010-02-20 01:08:04.000000000 +0200
7+++ php-5.3.1/ext/pdo_mysql/mysql_driver.c 2010-02-20 01:08:52.982186037 +0200
4e91d745
ER
8@@ -436,6 +436,7 @@
9 pdo_mysql_db_handle *H;
10 int i, ret = 0;
11 char *host = NULL, *unix_socket = NULL;
12+ char *connect_charset = NULL;
13 unsigned int port = 3306;
14 char *dbname;
15 struct pdo_data_src_parser vars[] = {
c2f30c63
ER
16@@ -731,6 +731,12 @@
17 password_len = strlen(dbh->password);
4e91d745 18 }
c2f30c63
ER
19
20+ connect_charset = PDO_MYSQL_G(connect_charset);
4e91d745
ER
21+
22+ if (connect_charset != NULL) {
23+ mysql_options(H->server, MYSQL_SET_CHARSET_NAME, connect_charset);
24+ }
25+
c2f30c63
ER
26 if (mysqlnd_connect(H->server, host, dbh->username, dbh->password, password_len, dbname, dbname_len,
27 port, unix_socket, connect_opts, PDO_MYSQL_G(mysqlnd_thd_zval_cache) TSRMLS_CC) == NULL) {
28 #else
86a42589
ER
29--- php-5.3.3/ext/pdo_mysql/pdo_mysql.c~ 2010-07-24 19:23:14.000000000 +0300
30+++ php-5.3.3/ext/pdo_mysql/pdo_mysql.c 2010-07-24 19:24:48.363581841 +0300
25e7e080
ER
31@@ -56,6 +56,7 @@
32 #if PDO_DBG_ENABLED
c2f30c63
ER
33 STD_PHP_INI_ENTRY("pdo_mysql.debug", NULL, PHP_INI_SYSTEM, OnUpdateString, debug, zend_pdo_mysql_globals, pdo_mysql_globals)
34 #endif
4e91d745 35+ STD_PHP_INI_ENTRY("pdo_mysql.connect_charset", NULL, PHP_INI_ALL, OnUpdateString, connect_charset, zend_pdo_mysql_globals, pdo_mysql_globals)
c2f30c63
ER
36 PHP_INI_END()
37 /* }}} */
4e91d745 38
25e7e080
ER
39@@ -89,9 +90,7 @@
40 static PHP_MSHUTDOWN_FUNCTION(pdo_mysql)
4e91d745 41 {
25e7e080 42 php_pdo_unregister_driver(&pdo_mysql_driver);
c2f30c63 43-#if PDO_USE_MYSQLND
25e7e080 44 UNREGISTER_INI_ENTRIES();
c2f30c63
ER
45-#endif
46
4e91d745
ER
47 return SUCCESS;
48 }
25e7e080
ER
49@@ -108,9 +107,7 @@
50
4e91d745 51 php_info_print_table_end();
c2f30c63
ER
52
53-#ifdef PDO_USE_MYSQLND
54 DISPLAY_INI_ENTRIES();
55-#endif
4e91d745
ER
56 }
57 /* }}} */
58
86a42589 59@@ -161,6 +161,7 @@
c2f30c63
ER
60 pdo_mysql_globals->debug = NULL; /* The actual string */
61 pdo_mysql_globals->dbg = NULL; /* The DBG object*/
62 #endif
c2f30c63
ER
63+ pdo_mysql_globals->connect_charset = NULL;
64 }
65 /* }}} */
c2f30c63 66
25e7e080
ER
67--- php-5.3.2RC3/ext/pdo_mysql/php_pdo_mysql_int.h~ 2010-02-04 11:37:38.000000000 +0200
68+++ php-5.3.2RC3/ext/pdo_mysql/php_pdo_mysql_int.h 2010-02-26 19:11:47.484055898 +0200
69@@ -69,6 +69,7 @@
c2f30c63
ER
70 char *debug; /* The actual string */
71 MYSQLND_DEBUG *dbg; /* The DBG object */
72 #endif
c2f30c63 73+ char *connect_charset;
25e7e080
ER
74 #if defined(PHP_WIN32) && !PDO_DBG_ENABLED
75 /* dummy member so we get at least one member in the struct
76 * and avoids build errors.
This page took 0.034919 seconds and 4 git commands to generate.