summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/mysqli/mysqli_api.c8
-rw-r--r--ext/mysqli/mysqli_nonapi.c3
-rw-r--r--ext/mysqli/php_mysqli_structs.h16
3 files changed, 10 insertions, 17 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 27cf68d700..0c17e1599e 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -614,7 +614,7 @@ PHP_FUNCTION(mysqli_change_user)
size_t user_len, password_len, dbname_len;
zend_ulong rc;
#if !defined(MYSQLI_USE_MYSQLND) && defined(HAVE_MYSQLI_SET_CHARSET)
- const CHARSET_INFO * old_charset;
+ MY_CHARSET_INFO old_charset;
#endif
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss!", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
@@ -623,7 +623,7 @@ PHP_FUNCTION(mysqli_change_user)
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
#if !defined(MYSQLI_USE_MYSQLND) && defined(HAVE_MYSQLI_SET_CHARSET)
- old_charset = mysql->mysql->charset;
+ mysql_get_character_set_info(mysql->mysql, &old_charset);
#endif
#if defined(MYSQLI_USE_MYSQLND)
@@ -643,7 +643,7 @@ PHP_FUNCTION(mysqli_change_user)
5.0 doesn't support it. Support added in 5.1.23 by fixing the following bug :
Bug #30472 libmysql doesn't reset charset, insert_id after succ. mysql_change_user() call
*/
- rc = mysql_set_character_set(mysql->mysql, old_charset->csname);
+ rc = mysql_set_character_set(mysql->mysql, old_charset.csname);
}
#endif
@@ -1716,10 +1716,12 @@ static int mysqli_options_get_option_zval_type(int option)
#endif /* MySQL 4.1.0 */
case MYSQL_OPT_READ_TIMEOUT:
case MYSQL_OPT_WRITE_TIMEOUT:
+#ifdef MYSQL_OPT_GUESS_CONNECTION /* removed in MySQL-8.0 */
case MYSQL_OPT_GUESS_CONNECTION:
case MYSQL_OPT_USE_EMBEDDED_CONNECTION:
case MYSQL_OPT_USE_REMOTE_CONNECTION:
case MYSQL_SECURE_AUTH:
+#endif
#ifdef MYSQL_OPT_RECONNECT
case MYSQL_OPT_RECONNECT:
#endif /* MySQL 5.0.13 */
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c
index 4736e4fcb2..0d4a1704cd 100644
--- a/ext/mysqli/mysqli_nonapi.c
+++ b/ext/mysqli/mysqli_nonapi.c
@@ -303,7 +303,8 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
#if !defined(MYSQLI_USE_MYSQLND)
- mysql->mysql->reconnect = MyG(reconnect);
+ char reconnect = MyG(reconnect);
+ mysql_options(mysql->mysql, MYSQL_OPT_RECONNECT, (char *)&reconnect);
#endif
unsigned int allow_local_infile = MyG(allow_local_infile);
mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&allow_local_infile);
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index 1b7ffddb1a..e399ecaa36 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -58,8 +58,6 @@
#define HAVE_ULONG
#endif
-#include <my_global.h>
-
#if !defined(HAVE_MBRLEN) && defined(WE_HAD_MBRLEN)
#define HAVE_MBRLEN 1
#endif
@@ -68,20 +66,12 @@
#define HAVE_MBSTATE_T 1
#endif
-/*
- We need more than mysql.h because we need CHARSET_INFO in one place.
- This order has been borrowed from the ODBC driver. Nothing can be removed
- from the list of headers :(
-*/
-
-#include <my_sys.h>
#include <mysql.h>
+#ifndef my_bool
+typedef char my_bool;
+#endif
#include <errmsg.h>
-#include <my_list.h>
-#include <m_string.h>
#include <mysqld_error.h>
-#include <my_list.h>
-#include <m_ctype.h>
#include "mysqli_libmysql.h"
#endif /* MYSQLI_USE_MYSQLND */