]>
Commit | Line | Data |
---|---|---|
1 | --- php-5.5.0RC2/ext/mysql/php_mysql.c~ 2013-06-11 22:12:11.000000000 +0300 | |
2 | +++ php-5.5.0RC2/ext/mysql/php_mysql.c 2013-06-11 22:16:04.192270533 +0300 | |
3 | @@ -360,6 +360,7 @@ | |
4 | PHP_INI_ENTRY("mysql.default_port", NULL, PHP_INI_ALL, OnMySQLPort) | |
5 | STD_PHP_INI_ENTRY("mysql.default_socket", NULL, PHP_INI_ALL, OnUpdateStringUnempty, default_socket, zend_mysql_globals, mysql_globals) | |
6 | STD_PHP_INI_ENTRY("mysql.connect_timeout", "60", PHP_INI_ALL, OnUpdateLong, connect_timeout, zend_mysql_globals, mysql_globals) | |
7 | + STD_PHP_INI_ENTRY("mysql.connect_charset", NULL, PHP_INI_ALL, OnUpdateString, connect_charset, zend_mysql_globals, mysql_globals) | |
8 | STD_PHP_INI_BOOLEAN("mysql.trace_mode", "0", PHP_INI_ALL, OnUpdateLong, trace_mode, zend_mysql_globals, mysql_globals) | |
9 | PHP_INI_END() | |
10 | /* }}} */ | |
11 | @@ -376,6 +377,7 @@ | |
12 | mysql_globals->connect_errno = 0; | |
13 | mysql_globals->connect_error = NULL; | |
14 | mysql_globals->connect_timeout = 0; | |
15 | + mysql_globals->connect_charset = NULL; | |
16 | mysql_globals->trace_mode = 0; | |
17 | mysql_globals->result_allocated = 0; | |
18 | } | |
19 | @@ -723,6 +723,7 @@ | |
20 | { | |
21 | char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL; | |
22 | int user_len = 0, passwd_len = 0, host_len = 0; | |
23 | + char *connect_charset=NULL; | |
24 | char *hashed_details=NULL; | |
25 | int hashed_details_length, port = MYSQL_PORT; | |
26 | long client_flags = 0; | |
27 | @@ -527,6 +530,7 @@ | |
28 | ||
29 | ||
30 | connect_timeout = MySG(connect_timeout); | |
31 | + connect_charset = MySG(connect_charset); | |
32 | ||
33 | socket = MySG(default_socket); | |
34 | ||
35 | --- php-5.3.1/ext/mysql/php_mysql.c~ 2010-02-20 00:51:52.000000000 +0200 | |
36 | +++ php-5.3.1/ext/mysql/php_mysql.c 2010-02-20 00:55:43.475653264 +0200 | |
37 | @@ -777,6 +777,10 @@ | |
38 | if (connect_timeout != -1) { | |
39 | mysql_options(mysql->conn, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout); | |
40 | } | |
41 | + | |
42 | + if (connect_charset != NULL) | |
43 | + mysql_options(mysql->conn, MYSQL_SET_CHARSET_NAME, connect_charset); | |
44 | + | |
45 | #ifndef MYSQL_USE_MYSQLND | |
46 | if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL) | |
47 | #else | |
48 | @@ -826,6 +830,8 @@ | |
49 | #endif | |
50 | if (mysql_ping(mysql->conn)) { | |
51 | if (mysql_errno(mysql->conn) == 2006) { | |
52 | + if (connect_charset != NULL) | |
53 | + mysql_options(mysql->conn, MYSQL_SET_CHARSET_NAME, connect_charset); | |
54 | #ifndef MYSQL_USE_MYSQLND | |
55 | if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL) | |
56 | #else | |
57 | @@ -898,6 +904,9 @@ | |
58 | if (connect_timeout != -1) | |
59 | mysql_options(mysql->conn, MYSQL_OPT_CONNECT_TIMEOUT, (const char *)&connect_timeout); | |
60 | ||
61 | + if (connect_charset != NULL) | |
62 | + mysql_options(mysql->conn, MYSQL_SET_CHARSET_NAME, connect_charset); | |
63 | + | |
64 | #ifndef MYSQL_USE_MYSQLND | |
65 | if (mysql_real_connect(mysql->conn, host, user, passwd, NULL, port, socket, client_flags)==NULL) | |
66 | #else | |
67 | --- php-5.2.5_p20080206.orig/ext/mysql/php_mysql_structs.h 2008-02-06 14:22:57.510605687 +0100 | |
68 | +++ php-5.2.5_p20080206/ext/mysql/php_mysql_structs.h 2008-02-06 14:23:27.764590355 +0100 | |
69 | @@ -103,6 +103,7 @@ | |
70 | long default_port; | |
71 | char *default_host, *default_user, *default_password; | |
72 | char *default_socket; | |
73 | + char *connect_charset; | |
74 | char *connect_error; | |
75 | long connect_errno; | |
76 | long connect_timeout; |