summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-04-21 23:58:54 +0400
committerAlexander Nozdrin <alik@sun.com>2010-04-21 23:58:54 +0400
commitdf9eb6efe006620be283e69d1879857a66275505 (patch)
tree2035f82f184e5e1f372cc8e6db8c7bf26cff1c99 /sql
parentdbf7c215ce4ee92becd2948960f02710f2d9ddb1 (diff)
downloadmariadb-git-df9eb6efe006620be283e69d1879857a66275505.tar.gz
Patch for Bug#53022: Compilation of "embedded" is broken.
The bug was a side effect of WL#5030 (fix header files) and WL#5161 (CMake). The problem was that CMake-generated config.h (and my_config.h as a copy of it) had a header guard. GNU autotools-generated [my_]config.h did not. During WL#5030 the order of header files was changed, so the following started to happen (using GNU autotools, in embedded server): - my_config.h included, defining HAVE_OPENSSL - my_global.h included, un-defining HAVE_OPENSSL - zlib.h included, including config.h, defining HAVE_OPENSSL again. The fix is to change the order of header file, moving zlib.h to the top of the header list. More proper fix would be to wrap unguarded auto-generated [my_]config.h by guarded non-generated header file.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_strfunc.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 32baae87c50..7025cf1af56 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -29,6 +29,13 @@
#pragma implementation // gcc: Class implementation
#endif
+/*
+ NOTE: zlib.h must be included *before* my_global.h because my_global.h
+ may undef some HAVE_ macros. Including zlib.h after my_global.h may lead
+ to re-defining undefined macros, thus to compile errors.
+*/
+#include <zlib.h> // Must be before my_global.h
+
/* May include caustic 3rd-party defs. Use early, so it can override nothing. */
#include "sha2.h"
#include "my_global.h" // HAVE_*
@@ -51,7 +58,6 @@
#include "my_md5.h"
#include "sha1.h"
#include "my_aes.h"
-#include <zlib.h>
C_MODE_START
#include "../mysys/my_static.h" // For soundex_map
C_MODE_END