From 4637e3641f2bfd74fe34df1e2a0a33a9da531369 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Mon, 14 Jun 2010 18:19:13 +0000 Subject: And a fix for MySQL Server which is pre 5.1.23, which doesn't support preserving of the charset when performing change_user. This is libmysql only code. --- ext/mysqli/php_mysqli_structs.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'ext/mysqli/php_mysqli_structs.h') diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h index 9c2433ec1b..4ab7adcba7 100644 --- a/ext/mysqli/php_mysqli_structs.h +++ b/ext/mysqli/php_mysqli_structs.h @@ -42,8 +42,44 @@ #include "ext/mysqlnd/mysqlnd.h" #include "mysqli_mysqlnd.h" #else + +/* + The libmysql headers (a PITA) also define it and there will be an warning. + Undef it and later we might need to define it again. +*/ +#ifdef HAVE_MBRLEN +#undef HAVE_MBRLEN +#define WE_HAD_MBRLEN +#endif +#ifdef HAVE_MBSTATE_T +#undef HAVE_MBSTATE_T +#define WE_HAD_MBSTATE_T +#endif + +#include + +#if !defined(HAVE_MBRLEN) && defined(WE_HAD_MBRLEN) +#define HAVE_MBRLEN 1 +#endif + +#if !defined(HAVE_MBSTATE_T) && defined(WE_HAD_MBSTATE_T) +#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 #include #include +#include +#include +#include +#include +#include #include "mysqli_libmysql.h" #endif -- cgit v1.2.1