xref: /OK3568_Linux_fs/buildroot/package/oracle-mysql/0010-fix-build-without-zlib.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Fix build without zlib
2
3Don't include unconditionally zlib.h, and compile out code that
4requires zlib support.
5
6Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
7
8diff -durN mysql-5.1.73.orig/mysys/checksum.c mysql-5.1.73/mysys/checksum.c
9--- mysql-5.1.73.orig/mysys/checksum.c	2020-07-14 17:34:38.212304432 +0200
10+++ mysql-5.1.73/mysys/checksum.c	2020-07-14 18:06:45.076342493 +0200
11@@ -16,7 +16,9 @@
12
13 #include <my_global.h>
14 #include <my_sys.h>
15+#ifdef HAVE_COMPRESS
16 #include <zlib.h>
17+#endif
18
19 /*
20   Calculate a long checksum for a memoryblock.
21diff -durN mysql-5.1.73.orig/sql/item_strfunc.cc mysql-5.1.73/sql/item_strfunc.cc
22--- mysql-5.1.73.orig/sql/item_strfunc.cc	2020-07-14 17:34:38.160304431 +0200
23+++ mysql-5.1.73/sql/item_strfunc.cc	2020-07-14 18:04:36.956339962 +0200
24@@ -35,7 +35,9 @@
25 #include "my_md5.h"
26 #include "sha1.h"
27 #include "my_aes.h"
28+#ifdef HAVE_COMPRESS
29 #include <zlib.h>
30+#endif
31 C_MODE_START
32 #include "../mysys/my_static.h"			// For soundex_map
33 C_MODE_END
34diff -durN mysql-5.1.73.orig/sql/sql_table.cc mysql-5.1.73/sql/sql_table.cc
35--- mysql-5.1.73.orig/sql/sql_table.cc	2020-07-14 17:34:38.156304431 +0200
36+++ mysql-5.1.73/sql/sql_table.cc	2020-07-14 18:14:48.628352044 +0200
37@@ -1681,6 +1681,7 @@
38       goto end;
39     }
40   }
41+#ifdef HAVE_COMPRESS
42   if (flags & WFRM_PACK_FRM)
43   {
44     /*
45@@ -1702,6 +1703,7 @@
46     }
47     error= my_delete(shadow_frm_name, MYF(MY_WME));
48   }
49+#endif
50   if (flags & WFRM_INSTALL_SHADOW)
51   {
52 #ifdef WITH_PARTITION_STORAGE_ENGINE
53