summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mysql
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2014-08-08 15:16:40 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2014-08-10 16:07:19 +0200
commite751af9f900834759e59ad2b46a7118a508069e4 (patch)
tree12e227a625d2a58270788f217c3462e76fac400d /meta-oe/recipes-support/mysql
parentf38639c2214653f1a4cbcb5242c5a699b251dec8 (diff)
downloadmeta-openembedded-e751af9f900834759e59ad2b46a7118a508069e4.tar.gz
mariadb: update to 5.5.38
* Upstream switched from autotools to cmake * Separate build dir and parallel make now work * Library versioning no longer used for plugins; other libtool cruft gone * Proper upstream initscript * Plugins moved from client library package to mariadb-server package (matches how Fedora packages these) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/mysql')
-rw-r--r--meta-oe/recipes-support/mysql/mariadb-native_5.5.38.bb (renamed from meta-oe/recipes-support/mysql/mariadb-native_5.1.67.bb)5
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/Makefile.am.patch19
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/avoid-plugin-options-warnings.patch17
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/configure-ps-cache-check.patch27
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/configure.in.patch13
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/fix-cmake-module-path.patch29
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-1.patch174
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-2.patch257
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/fix-link-error-ub1310.patch37
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/fix-mysqlclient-r-version.patch161
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/fix_host_path.patch37
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/misc.m4.patch13
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/my.cnf1
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/mysqld.sh24
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/plug.in.patch405
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/remove-bad-path.patch18
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/storage-forbids-absolute-addresses-on-IA-32.patch44
-rw-r--r--meta-oe/recipes-support/mysql/mariadb/zlib-let-libdir-configurable.patch63
-rw-r--r--meta-oe/recipes-support/mysql/mariadb_5.5.38.bb (renamed from meta-oe/recipes-support/mysql/mariadb_5.1.67.bb)4
-rw-r--r--meta-oe/recipes-support/mysql/mariadb_5.5.38.inc (renamed from meta-oe/recipes-support/mysql/mariadb_5.1.67.inc)125
20 files changed, 286 insertions, 1187 deletions
diff --git a/meta-oe/recipes-support/mysql/mariadb-native_5.1.67.bb b/meta-oe/recipes-support/mysql/mariadb-native_5.5.38.bb
index 942afcc55..9148deefc 100644
--- a/meta-oe/recipes-support/mysql/mariadb-native_5.1.67.bb
+++ b/meta-oe/recipes-support/mysql/mariadb-native_5.5.38.bb
@@ -7,14 +7,13 @@ DEPENDS = "ncurses-native zlib-native"
7RDEPENDS_${PN} = "" 7RDEPENDS_${PN} = ""
8PACKAGES = "" 8PACKAGES = ""
9EXTRA_OEMAKE = "" 9EXTRA_OEMAKE = ""
10EXTRA_OECONF = " --with-embedded-server "
11 10
12do_install() { 11do_install() {
13 oe_runmake 'DESTDIR=${D}' install 12 oe_runmake 'DESTDIR=${D}' install
14 mv -f ${D}${libdir}/mysql/* ${D}${libdir}
15 rmdir ${D}${libdir}/mysql
16 13
17 install -d ${D}${bindir} 14 install -d ${D}${bindir}
18 install -m 0755 sql/gen_lex_hash ${D}${bindir}/ 15 install -m 0755 sql/gen_lex_hash ${D}${bindir}/
16 install -m 0755 extra/comp_err ${D}${bindir}/
17 install -m 0755 scripts/comp_sql ${D}${bindir}/
19} 18}
20 19
diff --git a/meta-oe/recipes-support/mysql/mariadb/Makefile.am.patch b/meta-oe/recipes-support/mysql/mariadb/Makefile.am.patch
deleted file mode 100644
index 33fd17acd..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/Makefile.am.patch
+++ /dev/null
@@ -1,19 +0,0 @@
1Index: mysql-5.1.40/sql/Makefile.am
2===================================================================
3--- mysql-5.1.40.orig/sql/Makefile.am
4+++ mysql-5.1.40/sql/Makefile.am
5@@ -174,10 +174,10 @@ link_sources:
6 # This generates lex_hash.h
7 # NOTE Built sources should depend on their sources not the tool
8 # this avoid the rebuild of the built files in a source dist
9-lex_hash.h: gen_lex_hash.cc lex.h
10- $(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
11- ./gen_lex_hash$(EXEEXT) > $@-t
12- $(MV) $@-t $@
13+GEN_LEX_HASH = ./gen_lex_hash$(EXEEXT)
14+
15+lex_hash.h: gen_lex_hash$(EXEEXT)
16+ $(GEN_LEX_HASH) > $@
17
18 # For testing of udf_example.so
19 udf_example_la_SOURCES= udf_example.c
diff --git a/meta-oe/recipes-support/mysql/mariadb/avoid-plugin-options-warnings.patch b/meta-oe/recipes-support/mysql/mariadb/avoid-plugin-options-warnings.patch
deleted file mode 100644
index 84ff6f023..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/avoid-plugin-options-warnings.patch
+++ /dev/null
@@ -1,17 +0,0 @@
1Tell autoconf about with-plugin option to avoid warnings like:
2configure: WARNING: unrecognized options: --with-plugin-maria
3
4Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
5
6Index: mariadb-5.1.67/config/ac-macros/plugins.m4
7===================================================================
8--- mariadb-5.1.67.orig/config/ac-macros/plugins.m4
9+++ mariadb-5.1.67/config/ac-macros/plugins.m4
10@@ -38,6 +38,7 @@ AC_DEFUN([_MYSQL_PLUGIN],[
11 _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1])
12 m4_define([MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), [$3])
13 m4_define([MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), [$4])
14+ m4_ifdef([_AC_ENABLE_IF], [_AC_ENABLE_IF([with],[plugin-$1])])
15 _MYSQL_PLUGAPPEND_META([$1], $5)
16 ifelse(m4_bregexp(__mysql_include__,[/plug\.in$]),-1,[],[
17 MYSQL_PLUGIN_DIRECTORY([$1],
diff --git a/meta-oe/recipes-support/mysql/mariadb/configure-ps-cache-check.patch b/meta-oe/recipes-support/mysql/mariadb/configure-ps-cache-check.patch
deleted file mode 100644
index 3b5b3fd06..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/configure-ps-cache-check.patch
+++ /dev/null
@@ -1,27 +0,0 @@
1Index: mysql-4.1.22/configure.in
2===================================================================
3--- mysql-4.1.22.orig/configure.in 2009-01-28 16:33:28.000000000 +0000
4+++ mysql-4.1.22/configure.in 2009-01-28 16:43:26.000000000 +0000
5@@ -471,8 +471,8 @@
6
7 # Lock for PS
8 AC_PATH_PROG(PS, ps, ps)
9-AC_MSG_CHECKING("how to check if pid exists")
10-PS=$ac_cv_path_PS
11+AC_CACHE_CHECK([how to check if pid exists], [ac_cv_FIND_PROC],
12+[
13 # Linux style
14 if $PS p $$ 2> /dev/null | grep $0 > /dev/null
15 then
16@@ -511,8 +511,9 @@
17 AC_MSG_ERROR([Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual.])
18 esac
19 fi
20-AC_SUBST(FIND_PROC)
21-AC_MSG_RESULT("$FIND_PROC")
22+ac_cv_FIND_PROC="$FIND_PROC"
23+])
24+AC_SUBST([FIND_PROC], [$ac_cv_FIND_PROC])
25
26 # Check if a pid is valid
27 AC_PATH_PROG(KILL, kill, kill)
diff --git a/meta-oe/recipes-support/mysql/mariadb/configure.in.patch b/meta-oe/recipes-support/mysql/mariadb/configure.in.patch
deleted file mode 100644
index 6fe2dfaa1..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/configure.in.patch
+++ /dev/null
@@ -1,13 +0,0 @@
1Index: mysql-5.1.40/configure.in
2===================================================================
3--- mysql-5.1.40.orig/configure.in
4+++ mysql-5.1.40/configure.in
5@@ -226,8 +226,6 @@ else
6 AC_PATH_PROG(AS, as, as)
7 fi
8
9-# Still need ranlib for readline; local static use only so no libtool.
10-AC_PROG_RANLIB
11 # We use libtool
12 #AC_LIBTOOL_WIN32_DLL
13 AC_PROG_LIBTOOL
diff --git a/meta-oe/recipes-support/mysql/mariadb/fix-cmake-module-path.patch b/meta-oe/recipes-support/mysql/mariadb/fix-cmake-module-path.patch
new file mode 100644
index 000000000..8d9f558d0
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/fix-cmake-module-path.patch
@@ -0,0 +1,29 @@
1Avoid CMAKE_MODULE_PATH being overwritten
2
3OE-Core's setting of CMAKE_MODULE_PATH stomps on MariaDB's value unless
4we set it after setting the project name.
5
6Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
7
8Upstream-Status: Inappropriate [working around OE-Core bug]
9
10--- mariadb/CMakeLists.txt 2014-07-17 11:01:07.676353047 +0100
11+++ mariadb/CMakeLists.txt 2014-07-17 11:01:31.299353107 +0100
12@@ -28,8 +28,6 @@
13
14 MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
15
16-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
17-
18 # Distinguish between community and non-community builds, with the
19 # default being a community build. This does not impact the feature
20 # set that will be compiled in; it's merely provided as a hint to
21@@ -77,6 +75,8 @@
22 ENDIF()
23 PROJECT(${MYSQL_PROJECT_NAME})
24
25+SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
26+
27 IF(BUILD_CONFIG)
28 INCLUDE(
29 ${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake)
diff --git a/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-1.patch b/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-1.patch
deleted file mode 100644
index df2e7086c..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-1.patch
+++ /dev/null
@@ -1,174 +0,0 @@
1From 24404044ad4c28026e400e1fcd85358f2060aa96 Mon Sep 17 00:00:00 2001
2From: Alexey Botchkov <holyfoot@askmonty.org>
3Date: Sun, 10 Mar 2013 23:08:05 +0400
4Subject: [PATCH] MDEV-4252 geometry query crashes server. The bug was
5 found by Alyssa Milburn. If the number of points of a geometry feature
6 read from binary representation is greater than 0x10000000, then
7 the (uint32) (num_points * 16) will cut the higher byte, which leads to
8 various errors. Fixed by additional check if (num_points >
9 max_n_points).
10
11Upstream-Status: Backport
12Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
13
14---
15 mysql-test/r/gis.result | 3 +++
16 mysql-test/t/gis.test | 1 +
17 sql/spatial.cc | 27 ++++++++++++++++++---------
18 sql/spatial.h | 9 +++++----
19 4 files changed, 27 insertions(+), 13 deletions(-)
20
21diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
22index 8dad72f..69e73d0 100644
23--- a/mysql-test/r/gis.result
24+++ b/mysql-test/r/gis.result
25@@ -1087,4 +1087,7 @@ NULL
26 #
27 SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
28 ERROR 22007: Illegal non geometric '' value found during parsing
29+select astext(0x0100000000030000000100000000000010);
30+astext(0x0100000000030000000100000000000010)
31+NULL
32 End of 5.1 tests
33diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
34index abda3e9..cc5d158 100644
35--- a/mysql-test/t/gis.test
36+++ b/mysql-test/t/gis.test
37@@ -826,5 +826,6 @@ SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)));
38 --error ER_ILLEGAL_VALUE_FOR_TYPE
39 SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
40
41+select astext(0x0100000000030000000100000000000010);
42
43 --echo End of 5.1 tests
44diff --git a/sql/spatial.cc b/sql/spatial.cc
45index eec028e..94d0238 100644
46--- a/sql/spatial.cc
47+++ b/sql/spatial.cc
48@@ -556,7 +556,7 @@ bool Gis_line_string::get_data_as_wkt(String *txt, const char **end) const
49 n_points= uint4korr(data);
50 data += 4;
51
52- if (n_points < 1 ||
53+ if (n_points < 1 || n_points > max_n_points ||
54 no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points) ||
55 txt->reserve(((MAX_DIGITS_IN_DOUBLE + 1)*2 + 1) * n_points))
56 return 1;
57@@ -594,7 +594,8 @@ int Gis_line_string::geom_length(double *len) const
58 return 1;
59 n_points= uint4korr(data);
60 data+= 4;
61- if (n_points < 1 || no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points))
62+ if (n_points < 1 || n_points > max_n_points ||
63+ no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points))
64 return 1;
65
66 get_point(&prev_x, &prev_y, data);
67@@ -628,7 +629,7 @@ int Gis_line_string::is_closed(int *closed) const
68 return 0;
69 }
70 data+= 4;
71- if (n_points == 0 ||
72+ if (n_points == 0 || n_points > max_n_points ||
73 no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points))
74 return 1;
75
76@@ -798,7 +799,8 @@ bool Gis_polygon::get_data_as_wkt(String *txt, const char **end) const
77 return 1;
78 n_points= uint4korr(data);
79 data+= 4;
80- if (no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points) ||
81+ if (n_points > max_n_points ||
82+ no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points) ||
83 txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
84 return 1;
85 txt->qs_append('(');
86@@ -852,7 +854,8 @@ int Gis_polygon::area(double *ar, const char **end_of_data) const
87 if (no_data(data, 4))
88 return 1;
89 n_points= uint4korr(data);
90- if (no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points))
91+ if (n_points > max_n_points ||
92+ no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points))
93 return 1;
94 get_point(&prev_x, &prev_y, data+4);
95 data+= (4+SIZEOF_STORED_DOUBLE*2);
96@@ -888,7 +891,8 @@ int Gis_polygon::exterior_ring(String *result) const
97 n_points= uint4korr(data);
98 data+= 4;
99 length= n_points * POINT_DATA_SIZE;
100- if (no_data(data, length) || result->reserve(1+4+4+ length))
101+ if (n_points > max_n_points ||
102+ no_data(data, length) || result->reserve(1+4+4+ length))
103 return 1;
104
105 result->q_append((char) wkb_ndr);
106@@ -973,7 +977,8 @@ int Gis_polygon::centroid_xy(double *x, double *y) const
107 return 1;
108 org_n_points= n_points= uint4korr(data);
109 data+= 4;
110- if (no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points))
111+ if (n_points > max_n_points ||
112+ no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points))
113 return 1;
114 get_point(&prev_x, &prev_y, data);
115 data+= (SIZEOF_STORED_DOUBLE*2);
116@@ -1260,7 +1265,8 @@ bool Gis_multi_line_string::get_data_as_wkt(String *txt,
117 return 1;
118 n_points= uint4korr(data + WKB_HEADER_SIZE);
119 data+= WKB_HEADER_SIZE + 4;
120- if (no_data(data, n_points * (SIZEOF_STORED_DOUBLE*2)) ||
121+ if (n_points > max_n_points ||
122+ no_data(data, n_points * (SIZEOF_STORED_DOUBLE*2)) ||
123 txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
124 return 1;
125 txt->qs_append('(');
126@@ -1521,7 +1527,8 @@ bool Gis_multi_polygon::get_data_as_wkt(String *txt, const char **end) const
127 return 1;
128 uint32 n_points= uint4korr(data);
129 data+= 4;
130- if (no_data(data, (SIZEOF_STORED_DOUBLE * 2) * n_points) ||
131+ if (n_points > max_n_points ||
132+ no_data(data, (SIZEOF_STORED_DOUBLE * 2) * n_points) ||
133 txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points,
134 512))
135 return 1;
136@@ -1604,6 +1611,8 @@ int Gis_multi_polygon::geometry_n(uint32 num, String *result) const
137 if (no_data(data, 4))
138 return 1;
139 n_points= uint4korr(data);
140+ if (n_points > max_n_points)
141+ return 1;
142 data+= 4 + POINT_DATA_SIZE * n_points;
143 }
144 } while (--num);
145diff --git a/sql/spatial.h b/sql/spatial.h
146index 20b3856..7d25425 100644
147--- a/sql/spatial.h
148+++ b/sql/spatial.h
149@@ -197,6 +197,11 @@ struct MBR
150 class Geometry
151 {
152 public:
153+ // Maximum number of points in feature that can fit into String
154+ static const uint32 max_n_points=
155+ (uint32) (UINT_MAX32 - WKB_HEADER_SIZE - 4 /* n_points */) /
156+ POINT_DATA_SIZE;
157+public:
158 Geometry() {} /* Remove gcc warning */
159 virtual ~Geometry() {} /* Remove gcc warning */
160 static void *operator new(size_t size, void *buffer)
161@@ -379,10 +384,6 @@ class Gis_point: public Geometry
162
163 class Gis_line_string: public Geometry
164 {
165- // Maximum number of points in LineString that can fit into String
166- static const uint32 max_n_points=
167- (uint32) (UINT_MAX32 - WKB_HEADER_SIZE - 4 /* n_points */) /
168- POINT_DATA_SIZE;
169 public:
170 Gis_line_string() {} /* Remove gcc warning */
171 virtual ~Gis_line_string() {} /* Remove gcc warning */
172--
1731.8.1.6
174
diff --git a/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-2.patch b/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-2.patch
deleted file mode 100644
index c35cdfb64..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-2.patch
+++ /dev/null
@@ -1,257 +0,0 @@
1From 9f714cdd3bf4bd8ee06cd38dcd2c6e8990a4ec48 Mon Sep 17 00:00:00 2001
2From: Alexey Botchkov <holyfoot@askmonty.org>
3Date: Mon, 18 Mar 2013 17:58:00 +0400
4Subject: [PATCH] MDEV-4252 geometry query crashes server. Additional fixes
5 for possible overflows in length-related calculations in 'spatial'
6 implementations. Checks added to the ::get_data_size() methods.
7 max_n_points decreased to occupy less 2G size. An object of that size is
8 practically inoperable anyway.
9
10Upstream-Status: Backport
11Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
12
13---
14 mysql-test/r/gis.result | 12 +++++++++
15 mysql-test/t/gis.test | 6 +++++
16 sql/spatial.cc | 67 ++++++++++++++++++++++++++++++++++---------------
17 sql/spatial.h | 2 +-
18 4 files changed, 66 insertions(+), 21 deletions(-)
19
20diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
21index 69e73d0..7566f0b 100644
22--- a/mysql-test/r/gis.result
23+++ b/mysql-test/r/gis.result
24@@ -1087,7 +1087,19 @@ NULL
25 #
26 SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
27 ERROR 22007: Illegal non geometric '' value found during parsing
28+#
29+# MDEV-4252 geometry query crashes server
30+#
31 select astext(0x0100000000030000000100000000000010);
32 astext(0x0100000000030000000100000000000010)
33 NULL
34+select envelope(0x0100000000030000000100000000000010);
35+envelope(0x0100000000030000000100000000000010)
36+NULL
37+select geometryn(0x0100000000070000000100000001030000000200000000000000ffff0000, 1);
38+geometryn(0x0100000000070000000100000001030000000200000000000000ffff0000, 1)
39+NULL
40+select geometryn(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1);
41+geometryn(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1)
42+NULL
43 End of 5.1 tests
44diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
45index cc5d158..c42541e 100644
46--- a/mysql-test/t/gis.test
47+++ b/mysql-test/t/gis.test
48@@ -826,6 +826,12 @@ SELECT ISCLOSED(CONVERT(CONCAT(' ', 0x2), BINARY(20)));
49 --error ER_ILLEGAL_VALUE_FOR_TYPE
50 SELECT GEOMETRYCOLLECTION((SELECT @@OLD));
51
52+--echo #
53+--echo # MDEV-4252 geometry query crashes server
54+--echo #
55 select astext(0x0100000000030000000100000000000010);
56+select envelope(0x0100000000030000000100000000000010);
57+select geometryn(0x0100000000070000000100000001030000000200000000000000ffff0000, 1);
58+select geometryn(0x0100000000070000000100000001030000000200000000000000ffffff0f, 1);
59
60 --echo End of 5.1 tests
61diff --git a/sql/spatial.cc b/sql/spatial.cc
62index 94d0238..5a4b768 100644
63--- a/sql/spatial.cc
64+++ b/sql/spatial.cc
65@@ -394,18 +394,19 @@ const char *Geometry::append_points(String *txt, uint32 n_points,
66 const char *Geometry::get_mbr_for_points(MBR *mbr, const char *data,
67 uint offset) const
68 {
69- uint32 points;
70+ uint32 n_points;
71 /* read number of points */
72 if (no_data(data, 4))
73 return 0;
74- points= uint4korr(data);
75+ n_points= uint4korr(data);
76 data+= 4;
77
78- if (no_data(data, (SIZEOF_STORED_DOUBLE * 2 + offset) * points))
79+ if (n_points > max_n_points ||
80+ no_data(data, (POINT_DATA_SIZE + offset) * n_points))
81 return 0;
82
83 /* Calculate MBR for points */
84- while (points--)
85+ while (n_points--)
86 {
87 data+= offset;
88 mbr->add_xy(data, data + SIZEOF_STORED_DOUBLE);
89@@ -484,9 +485,12 @@ const Geometry::Class_info *Gis_point::get_class_info() const
90
91 uint32 Gis_line_string::get_data_size() const
92 {
93- if (no_data(m_data, 4))
94+ uint32 n_points, size;
95+ if (no_data(m_data, 4) ||
96+ (n_points= uint4korr(m_data)) > max_n_points ||
97+ no_data(m_data, (size= 4 + n_points * POINT_DATA_SIZE)))
98 return GET_SIZE_ERROR;
99- return 4 + uint4korr(m_data) * POINT_DATA_SIZE;
100+ return size;
101 }
102
103
104@@ -665,6 +669,9 @@ int Gis_line_string::end_point(String *result) const
105 if (no_data(m_data, 4))
106 return 1;
107 n_points= uint4korr(m_data);
108+ if (n_points == 0 || n_points > max_n_points ||
109+ no_data(m_data, POINT_DATA_SIZE * n_points))
110+ return 1;
111 return create_point(result, m_data + 4 + (n_points - 1) * POINT_DATA_SIZE);
112 }
113
114@@ -674,11 +681,14 @@ int Gis_line_string::point_n(uint32 num, String *result) const
115 uint32 n_points;
116 if (no_data(m_data, 4))
117 return 1;
118+ num--;
119 n_points= uint4korr(m_data);
120- if ((uint32) (num - 1) >= n_points) // means (num > n_points || num < 1)
121+ if (num >= n_points ||
122+ num > max_n_points || // means (num > n_points || num < 1)
123+ no_data(m_data, num * POINT_DATA_SIZE))
124 return 1;
125
126- return create_point(result, m_data + 4 + (num - 1) * POINT_DATA_SIZE);
127+ return create_point(result, m_data + 4 + num*POINT_DATA_SIZE);
128 }
129
130 const Geometry::Class_info *Gis_line_string::get_class_info() const
131@@ -692,6 +702,7 @@ const Geometry::Class_info *Gis_line_string::get_class_info() const
132 uint32 Gis_polygon::get_data_size() const
133 {
134 uint32 n_linear_rings;
135+ uint32 n_points;
136 const char *data= m_data;
137
138 if (no_data(data, 4))
139@@ -701,10 +712,13 @@ uint32 Gis_polygon::get_data_size() const
140
141 while (n_linear_rings--)
142 {
143- if (no_data(data, 4))
144+ if (no_data(data, 4) ||
145+ (n_points= uint4korr(data)) > max_n_points)
146 return GET_SIZE_ERROR;
147- data+= 4 + uint4korr(data)*POINT_DATA_SIZE;
148+ data+= 4 + n_points*POINT_DATA_SIZE;
149 }
150+ if (no_data(data, 0))
151+ return GET_SIZE_ERROR;
152 return (uint32) (data - m_data);
153 }
154
155@@ -1037,9 +1051,14 @@ const Geometry::Class_info *Gis_polygon::get_class_info() const
156
157 uint32 Gis_multi_point::get_data_size() const
158 {
159- if (no_data(m_data, 4))
160- return GET_SIZE_ERROR;
161- return 4 + uint4korr(m_data)*(POINT_DATA_SIZE + WKB_HEADER_SIZE);
162+ uint32 n_points;
163+ uint32 size;
164+
165+ if (no_data(m_data, 4) ||
166+ (n_points= uint4korr(m_data)) > max_n_points ||
167+ no_data(m_data, (size= 4 + n_points*(POINT_DATA_SIZE + WKB_HEADER_SIZE))))
168+ return GET_SIZE_ERROR;
169+ return size;
170 }
171
172
173@@ -1107,7 +1126,8 @@ bool Gis_multi_point::get_data_as_wkt(String *txt, const char **end) const
174 return 1;
175
176 n_points= uint4korr(m_data);
177- if (no_data(m_data+4,
178+ if (n_points > max_n_points ||
179+ no_data(m_data+4,
180 n_points * (SIZEOF_STORED_DOUBLE * 2 + WKB_HEADER_SIZE)) ||
181 txt->reserve(((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
182 return 1;
183@@ -1160,6 +1180,7 @@ const Geometry::Class_info *Gis_multi_point::get_class_info() const
184 uint32 Gis_multi_line_string::get_data_size() const
185 {
186 uint32 n_line_strings;
187+ uint32 n_points;
188 const char *data= m_data;
189
190 if (no_data(data, 4))
191@@ -1169,11 +1190,13 @@ uint32 Gis_multi_line_string::get_data_size() const
192
193 while (n_line_strings--)
194 {
195- if (no_data(data, WKB_HEADER_SIZE + 4))
196+ if (no_data(data, WKB_HEADER_SIZE + 4) ||
197+ (n_points= uint4korr(data + WKB_HEADER_SIZE)) > max_n_points)
198 return GET_SIZE_ERROR;
199- data+= (WKB_HEADER_SIZE + 4 + uint4korr(data + WKB_HEADER_SIZE) *
200- POINT_DATA_SIZE);
201+ data+= (WKB_HEADER_SIZE + 4 + n_points*POINT_DATA_SIZE);
202 }
203+ if (no_data(data, 0))
204+ return GET_SIZE_ERROR;
205 return (uint32) (data - m_data);
206 }
207
208@@ -1327,7 +1350,7 @@ int Gis_multi_line_string::geometry_n(uint32 num, String *result) const
209 return 1;
210 n_points= uint4korr(data + WKB_HEADER_SIZE);
211 length= WKB_HEADER_SIZE + 4+ POINT_DATA_SIZE * n_points;
212- if (no_data(data, length))
213+ if (n_points > max_n_points || no_data(data, length))
214 return 1;
215 if (!--num)
216 break;
217@@ -1407,6 +1430,7 @@ const Geometry::Class_info *Gis_multi_line_string::get_class_info() const
218 uint32 Gis_multi_polygon::get_data_size() const
219 {
220 uint32 n_polygons;
221+ uint32 n_points;
222 const char *data= m_data;
223
224 if (no_data(data, 4))
225@@ -1425,11 +1449,14 @@ uint32 Gis_multi_polygon::get_data_size() const
226
227 while (n_linear_rings--)
228 {
229- if (no_data(data, 4))
230+ if (no_data(data, 4) ||
231+ (n_points= uint4korr(data)) > max_n_points)
232 return GET_SIZE_ERROR;
233- data+= 4 + uint4korr(data) * POINT_DATA_SIZE;
234+ data+= 4 + n_points * POINT_DATA_SIZE;
235 }
236 }
237+ if (no_data(data, 0))
238+ return GET_SIZE_ERROR;
239 return (uint32) (data - m_data);
240 }
241
242diff --git a/sql/spatial.h b/sql/spatial.h
243index 7d25425..d7632c1 100644
244--- a/sql/spatial.h
245+++ b/sql/spatial.h
246@@ -199,7 +199,7 @@ class Geometry
247 public:
248 // Maximum number of points in feature that can fit into String
249 static const uint32 max_n_points=
250- (uint32) (UINT_MAX32 - WKB_HEADER_SIZE - 4 /* n_points */) /
251+ (uint32) (INT_MAX32 - WKB_HEADER_SIZE - 4 /* n_points */) /
252 POINT_DATA_SIZE;
253 public:
254 Geometry() {} /* Remove gcc warning */
255--
2561.8.1.6
257
diff --git a/meta-oe/recipes-support/mysql/mariadb/fix-link-error-ub1310.patch b/meta-oe/recipes-support/mysql/mariadb/fix-link-error-ub1310.patch
deleted file mode 100644
index a528ea700..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/fix-link-error-ub1310.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1mariadb-native: fix link error on Ubuntu 13.10
2
3Below errors only occurs on Ubuntu 13.10:
4
5$arch-linux-libtool: link: g++ ... -o .libs/mysqltest_embedded \
6 ../../libmysqld/.libs/libmysqld.so -ldl
7
8 ../../libmysqld/.libs/libmysqld.so: undefined reference to `dlopen'
9 ../../libmysqld/.libs/libmysqld.so: undefined reference to `dlclose'
10 ../../libmysqld/.libs/libmysqld.so: undefined reference to `dlerror'
11 ../../libmysqld/.libs/libmysqld.so: undefined reference to `dlsym'
12
13GCC/ld verion on the host:
14 gcc (Ubuntu/Linaro 4.8.1-10ubuntu8) 4.8.1
15 GNU ld (GNU Binutils for Ubuntu) 2.23.52.20130913
16
17This is a strange behavior on Ub13.10, it fails even '-ldl' in the
18link command line. Below fix will append '-ldl' to dependency_libs
19in libmysqld.la.
20
21Upstream-Status: Submitted [https://mariadb.atlassian.net/browse/MDEV-5362]
22
23Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
24================================================
25diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
26index 7a2c92e..eee501e 100644
27--- a/libmysqld/Makefile.am
28+++ b/libmysqld/Makefile.am
29@@ -92,7 +92,7 @@ INC_LIB= $(top_builddir)/regex/libregex.la \
30 @ndbcluster_libs@ @NDB_SCI_LIBS@ \
31 @mysql_embedded_plugin_libs@ \
32 $(libevent_inc_libs) \
33- $(yassl_inc_libs)
34+ $(yassl_inc_libs) @LIBDL@
35
36 if HAVE_YASSL
37 yassl_inc_libs= $(top_builddir)/extra/yassl/src/libyassl.la \
diff --git a/meta-oe/recipes-support/mysql/mariadb/fix-mysqlclient-r-version.patch b/meta-oe/recipes-support/mysql/mariadb/fix-mysqlclient-r-version.patch
new file mode 100644
index 000000000..7516619eb
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/fix-mysqlclient-r-version.patch
@@ -0,0 +1,161 @@
1From 6db2a606196fb38a6d106dc409eee1cb9a40a440 Mon Sep 17 00:00:00 2001
2From: Tor Didriksen <tor.didriksen@oracle.com>
3Date: Mon, 24 Jun 2013 17:15:35 +0200
4Subject: [PATCH] Bug#16809055 MYSQL 5.6 AND 5.7 STILL USE LIBMYSQLCLIENT.SO.18
5
6With this patch, the libmysql/ directory contains:
7libmysqlclient.a
8libmysqlclient_r.a -> libmysqlclient.a
9libmysqlclient_r.so -> libmysqlclient.so*
10libmysqlclient_r.so.18 -> libmysqlclient.so.18*
11libmysqlclient_r.so.18.1.0 -> libmysqlclient.so.18.1.0*
12libmysqlclient.so -> libmysqlclient.so.18*
13libmysqlclient.so.18 -> libmysqlclient.so.18.1.0*
14libmysqlclient.so.18.1.0*
15
16This fixes libmysqlclient_r symlinks pointing to the unversioned
17libmysqlclient.so symlink (leading to package QA errors since the
18libmysqlclient-r package ends up depending on libmysqlclient-dev).
19
20Borrowed from MySQL 5.6 tree at https://github.com/percona/mysql/
21
22Upstream-Status: Pending
23
24Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
25
26---
27 cmake/install_macros.cmake | 25 +++++++++++++++----------
28 cmake/mysql_version.cmake | 3 ++-
29 libmysql/CMakeLists.txt | 36 ++++++++++++++++++++++++++++--------
30 3 files changed, 45 insertions(+), 19 deletions(-)
31
32diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
33index b8efdf8..a0d0e68 100644
34--- a/cmake/install_macros.cmake
35+++ b/cmake/install_macros.cmake
36@@ -1,4 +1,4 @@
37-# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
38+# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
39 #
40 # This program is free software; you can redistribute it and/or modify
41 # it under the terms of the GNU General Public License as published by
42@@ -111,28 +111,33 @@ FUNCTION(INSTALL_SCRIPT)
43 ENDFUNCTION()
44
45 # Install symbolic link to CMake target.
46-# the link is created in the same directory as target
47-# and extension will be the same as for target file.
48-MACRO(INSTALL_SYMLINK linkname target destination component)
49+# We do 'cd path; ln -s target_name link_name'
50+# We also add an INSTALL target for "${path}/${link_name}"
51+MACRO(INSTALL_SYMLINK target target_name link_name destination component)
52 IF(UNIX)
53 GET_TARGET_PROPERTY(location ${target} LOCATION)
54 GET_FILENAME_COMPONENT(path ${location} PATH)
55- GET_FILENAME_COMPONENT(name ${location} NAME)
56- SET(output ${path}/${linkname})
57+ MESSAGE(STATUS "target ${target}")
58+ MESSAGE(STATUS "link_name ${link_name}")
59+ MESSAGE(STATUS "target_name ${target_name}")
60+ MESSAGE(STATUS "path ${path}")
61+ MESSAGE(STATUS "")
62+
63+ SET(output ${path}/${link_name})
64 ADD_CUSTOM_COMMAND(
65 OUTPUT ${output}
66 COMMAND ${CMAKE_COMMAND} ARGS -E remove -f ${output}
67 COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink
68- ${name}
69- ${linkname}
70+ ${target_name}
71+ ${link_name}
72 WORKING_DIRECTORY ${path}
73 DEPENDS ${target}
74 )
75
76- ADD_CUSTOM_TARGET(symlink_${linkname}
77+ ADD_CUSTOM_TARGET(symlink_${link_name}
78 ALL
79 DEPENDS ${output})
80- SET_TARGET_PROPERTIES(symlink_${linkname} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
81+ SET_TARGET_PROPERTIES(symlink_${link_name} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
82 IF(CMAKE_GENERATOR MATCHES "Xcode")
83 # For Xcode, replace project config with install config
84 STRING(REPLACE "${CMAKE_CFG_INTDIR}"
85diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
86index be5760f..96286ff 100644
87--- a/libmysql/CMakeLists.txt
88+++ b/libmysql/CMakeLists.txt
89@@ -180,6 +180,12 @@ IF(MSVC)
90 INSTALL_DEBUG_TARGET(mysqlclient DESTINATION ${INSTALL_LIBDIR}/debug)
91 ENDIF()
92
93+MACRO(GET_TARGET_NAME target out_name)
94+ GET_TARGET_PROPERTY(location ${target} LOCATION)
95+ GET_FILENAME_COMPONENT(name ${location} NAME)
96+ SET(${out_name} ${name})
97+ENDMACRO()
98+
99 IF(UNIX)
100 MACRO(GET_VERSIONED_LIBNAME LIBNAME EXTENSION VERSION OUTNAME)
101 SET(DOT_VERSION ".${VERSION}")
102@@ -192,7 +198,13 @@ IF(UNIX)
103 SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION})
104 ENDIF()
105 ENDMACRO()
106- INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} Development)
107+ENDIF()
108+
109+IF(UNIX)
110+ GET_TARGET_NAME(mysqlclient lib_name)
111+ INSTALL_SYMLINK(mysqlclient
112+ ${lib_name} ${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a
113+ ${INSTALL_LIBDIR} Development)
114 ENDIF()
115
116 IF(NOT DISABLE_SHARED)
117@@ -205,10 +217,9 @@ IF(NOT DISABLE_SHARED)
118 # libtool compatability
119 IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR APPLE)
120 SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}")
121- ELSEIF(CMAKE_SYSTEM_NAME MATCHES "HP-UX")
122- SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0")
123 ELSE()
124- SET(OS_SHARED_LIB_VERSION "${SHARED_LIB_MAJOR_VERSION}.0.0")
125+ SET(OS_SHARED_LIB_VERSION
126+ "${SHARED_LIB_MAJOR_VERSION}.${SHARED_LIB_MINOR_VERSION}.0")
127 ENDIF()
128 # Name of shared library is mysqlclient on Unix
129 SET_TARGET_PROPERTIES(libmysql PROPERTIES
130@@ -239,8 +250,13 @@ IF(NOT DISABLE_SHARED)
131 "${CMAKE_SHARED_LIBRARY_SUFFIX}"
132 ""
133 linkname)
134- INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries)
135- SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}")
136+ GET_TARGET_NAME(libmysql lib_name)
137+ GET_FILENAME_COMPONENT(lib_name_we ${lib_name} NAME_WE)
138+ INSTALL_SYMLINK(libmysql
139+ ${lib_name} ${linkname}
140+ ${INSTALL_LIBDIR} SharedLibraries)
141+ SET(OS_SHARED_LIB_SYMLINKS
142+ "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}")
143 LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS)
144 FOREACH(ver ${OS_SHARED_LIB_SYMLINKS})
145 GET_VERSIONED_LIBNAME(
146@@ -248,7 +264,11 @@ IF(NOT DISABLE_SHARED)
147 "${CMAKE_SHARED_LIBRARY_SUFFIX}"
148 "${ver}"
149 linkname)
150- INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries)
151+ GET_VERSIONED_LIBNAME(
152+ ${lib_name_we} "${CMAKE_SHARED_LIBRARY_SUFFIX}" "${ver}" lib_name_ver)
153+ INSTALL_SYMLINK(libmysql
154+ ${lib_name_ver} ${linkname}
155+ ${INSTALL_LIBDIR} SharedLibraries)
156 ENDFOREACH()
157 ENDIF()
158 ENDIF()
159--
1602.0.3
161
diff --git a/meta-oe/recipes-support/mysql/mariadb/fix_host_path.patch b/meta-oe/recipes-support/mysql/mariadb/fix_host_path.patch
deleted file mode 100644
index 4f69cd519..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/fix_host_path.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1--- mysql-4.1.22/configure.in.old 2008-09-18 20:11:15.000000000 -0500
2+++ mysql-4.1.22/configure.in 2008-09-18 20:12:28.000000000 -0500
3@@ -456,9 +456,9 @@ else
4 fi
5 fi
6
7-AC_SUBST(HOSTNAME)
8-AC_SUBST(PERL)
9-AC_SUBST(PERL5)
10+AC_SUBST(HOSTNAME,/bin/hostname)
11+AC_SUBST(PERL,$(bindir)/perl)
12+AC_SUBST(PERL5,$(bindir)/perl)
13
14 # for build ndb docs
15
16@@ -516,16 +516,17 @@ AC_MSG_RESULT("$FIND_PROC")
17
18 # Check if a pid is valid
19 AC_PATH_PROG(KILL, kill, kill)
20+AC_SUBST(KILL,/bin/kill)
21 AC_MSG_CHECKING("for kill switches")
22-if $ac_cv_path_KILL -0 $$
23+if $KILL -0 $$
24 then
25- CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null"
26+ CHECK_PID="$KILL -0 \$\$PID > /dev/null 2> /dev/null"
27 elif kill -s 0 $$
28 then
29- CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
30+ CHECK_PID="$KILL -s 0 \$\$PID > /dev/null 2> /dev/null"
31 else
32 AC_MSG_WARN([kill -0 to check for pid seems to fail])
33- CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
34+ CHECK_PID="$KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null"
35 fi
36 AC_SUBST(CHECK_PID)
37 AC_MSG_RESULT("$CHECK_PID")
diff --git a/meta-oe/recipes-support/mysql/mariadb/misc.m4.patch b/meta-oe/recipes-support/mysql/mariadb/misc.m4.patch
deleted file mode 100644
index 7b0acff21..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/misc.m4.patch
+++ /dev/null
@@ -1,13 +0,0 @@
1Index: mysql-5.1.40/config/ac-macros/misc.m4
2===================================================================
3--- mysql-5.1.40.orig/config/ac-macros/misc.m4
4+++ mysql-5.1.40/config/ac-macros/misc.m4
5@@ -476,7 +476,7 @@ AC_DEFUN([MYSQL_STACK_DIRECTION],
6 {
7 exit (find_stack_direction() < 0);
8 }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1,
9- ac_cv_c_stack_direction=)])
10+ ac_cv_c_stack_direction=0)])
11 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
12 ])dnl
13
diff --git a/meta-oe/recipes-support/mysql/mariadb/my.cnf b/meta-oe/recipes-support/mysql/mariadb/my.cnf
index d17438122..f2c9b9036 100644
--- a/meta-oe/recipes-support/mysql/mariadb/my.cnf
+++ b/meta-oe/recipes-support/mysql/mariadb/my.cnf
@@ -17,5 +17,6 @@ datadir = /var/mysql
17skip-external-locking 17skip-external-locking
18skip-networking 18skip-networking
19ignore-builtin-innodb 19ignore-builtin-innodb
20default-storage-engine = myisam
20bind-address = localhost 21bind-address = localhost
21 22
diff --git a/meta-oe/recipes-support/mysql/mariadb/mysqld.sh b/meta-oe/recipes-support/mysql/mariadb/mysqld.sh
deleted file mode 100644
index 479ebdb25..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/mysqld.sh
+++ /dev/null
@@ -1,24 +0,0 @@
1# MySQL init script
2
3. /etc/default/rcS
4
5case "$1" in
6 start)
7 /usr/bin/mysqld_safe &
8 ;;
9 stop)
10 if test -f /var/lib/mysql/mysqld.pid ; then
11 PID=`cat /var/lib/mysql/mysqld.pid`
12 kill $PID
13 fi
14 ;;
15 restart)
16 $0 stop
17 $0 start
18 ;;
19 *)
20 echo "Usage: /etc/init.d/mysqld {start|stop|restart}"
21 ;;
22esac
23
24exit 0
diff --git a/meta-oe/recipes-support/mysql/mariadb/plug.in.patch b/meta-oe/recipes-support/mysql/mariadb/plug.in.patch
deleted file mode 100644
index 156fd1082..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/plug.in.patch
+++ /dev/null
@@ -1,405 +0,0 @@
1diff --git a/storage/innodb_plugin/plug.in b/storage/innodb_plugin/plug.in
2index 7650251..3cc22c5 100644
3--- a/storage/innodb_plugin/plug.in
4+++ b/storage/innodb_plugin/plug.in
5@@ -56,180 +56,10 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
6 esac
7 AC_SUBST(INNODB_DYNAMIC_CFLAGS)
8
9- AC_MSG_CHECKING(whether GCC atomic builtins are available)
10- # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
11- AC_TRY_RUN(
12- [
13- int main()
14- {
15- long x;
16- long y;
17- long res;
18- char c;
19-
20- x = 10;
21- y = 123;
22- res = __sync_bool_compare_and_swap(&x, x, y);
23- if (!res || x != y) {
24- return(1);
25- }
26-
27- x = 10;
28- y = 123;
29- res = __sync_bool_compare_and_swap(&x, x + 1, y);
30- if (res || x != 10) {
31- return(1);
32- }
33-
34- x = 10;
35- y = 123;
36- res = __sync_add_and_fetch(&x, y);
37- if (res != 123 + 10 || x != 123 + 10) {
38- return(1);
39- }
40-
41- c = 10;
42- res = __sync_lock_test_and_set(&c, 123);
43- if (res != 10 || c != 123) {
44- return(1);
45- }
46-
47- return(0);
48- }
49- ],
50- [
51- AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS], [1],
52- [GCC atomic builtins are available])
53- AC_MSG_RESULT(yes)
54- ],
55- [
56- AC_MSG_RESULT(no)
57- ]
58- )
59-
60- AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
61- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
62- AC_TRY_RUN(
63- [
64- #include <pthread.h>
65- #include <string.h>
66-
67- int main(int argc, char** argv) {
68- pthread_t x1;
69- pthread_t x2;
70- pthread_t x3;
71-
72- memset(&x1, 0x0, sizeof(x1));
73- memset(&x2, 0x0, sizeof(x2));
74- memset(&x3, 0x0, sizeof(x3));
75-
76- __sync_bool_compare_and_swap(&x1, x2, x3);
77-
78- return(0);
79- }
80- ],
81- [
82- AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_GCC], [1],
83- [pthread_t can be used by GCC atomic builtins])
84- AC_MSG_RESULT(yes)
85- ],
86- [
87- AC_MSG_RESULT(no)
88- ]
89- )
90-
91- AC_MSG_CHECKING(whether Solaris libc atomic functions are available)
92- # Define HAVE_IB_SOLARIS_ATOMICS if _all_ of the following
93- # functions are present.
94- AC_CHECK_FUNCS(atomic_add_long_nv \
95- atomic_cas_32 \
96- atomic_cas_64 \
97- atomic_cas_ulong \
98- atomic_swap_uchar)
99-
100- if test "${ac_cv_func_atomic_add_long_nv}" = "yes" -a \
101- "${ac_cv_func_atomic_cas_32}" = "yes" -a \
102- "${ac_cv_func_atomic_cas_64}" = "yes" -a \
103- "${ac_cv_func_atomic_cas_ulong}" = "yes" -a \
104- "${ac_cv_func_atomic_swap_uchar}" = "yes" ; then
105-
106- AC_DEFINE([HAVE_IB_SOLARIS_ATOMICS], [1],
107- [Define to 1 if Solaris libc atomic functions are available]
108- )
109- fi
110-
111- AC_MSG_CHECKING(whether pthread_t can be used by Solaris libc atomic functions)
112- # either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not
113- AC_TRY_RUN(
114- [
115- #include <pthread.h>
116- #include <string.h>
117-
118- int main(int argc, char** argv) {
119- pthread_t x1;
120- pthread_t x2;
121- pthread_t x3;
122-
123- memset(&x1, 0x0, sizeof(x1));
124- memset(&x2, 0x0, sizeof(x2));
125- memset(&x3, 0x0, sizeof(x3));
126-
127- if (sizeof(pthread_t) == 4) {
128-
129- atomic_cas_32(&x1, x2, x3);
130-
131- } else if (sizeof(pthread_t) == 8) {
132-
133- atomic_cas_64(&x1, x2, x3);
134-
135- } else {
136-
137- return(1);
138- }
139-
140- return(0);
141- }
142- ],
143- [
144- AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS], [1],
145- [pthread_t can be used by solaris atomics])
146- AC_MSG_RESULT(yes)
147- ],
148- [
149- AC_MSG_RESULT(no)
150- ]
151- )
152-
153 # this is needed to know which one of atomic_cas_32() or atomic_cas_64()
154 # to use in the source
155 AC_CHECK_SIZEOF([pthread_t], [], [#include <pthread.h>])
156
157- # Check for x86 PAUSE instruction
158- AC_MSG_CHECKING(for x86 PAUSE instruction)
159- # We have to actually try running the test program, because of a bug
160- # in Solaris on x86_64, where it wrongly reports that PAUSE is not
161- # supported when trying to run an application. See
162- # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684
163- # We use ib_ prefix to avoid collisoins if this code is added to
164- # mysql's configure.in.
165- AC_TRY_RUN(
166- [
167- int main() {
168- __asm__ __volatile__ ("pause");
169- return(0);
170- }
171- ],
172- [
173- AC_DEFINE([HAVE_IB_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist])
174- AC_MSG_RESULT(yes)
175- ],
176- [
177- AC_MSG_RESULT(no)
178- ],
179- [
180- AC_MSG_RESULT(no)
181- ]
182- )
183 ])
184
185 # vim: set ft=config:
186diff --git a/storage/xtradb/plug.in b/storage/xtradb/plug.in
187index 3fadacc..a33f4dc 100644
188--- a/storage/xtradb/plug.in
189+++ b/storage/xtradb/plug.in
190@@ -56,215 +56,10 @@ MYSQL_PLUGIN_ACTIONS(xtradb, [
191 esac
192 AC_SUBST(INNODB_DYNAMIC_CFLAGS)
193
194- AC_MSG_CHECKING(whether GCC atomic builtins are available)
195- # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
196- AC_TRY_RUN(
197- [
198- int main()
199- {
200- long x;
201- long y;
202- long res;
203- char c;
204-
205- x = 10;
206- y = 123;
207- res = __sync_bool_compare_and_swap(&x, x, y);
208- if (!res || x != y) {
209- return(1);
210- }
211-
212- x = 10;
213- y = 123;
214- res = __sync_bool_compare_and_swap(&x, x + 1, y);
215- if (res || x != 10) {
216- return(1);
217- }
218-
219- x = 10;
220- y = 123;
221- res = __sync_add_and_fetch(&x, y);
222- if (res != 123 + 10 || x != 123 + 10) {
223- return(1);
224- }
225-
226- c = 10;
227- res = __sync_lock_test_and_set(&c, 123);
228- if (res != 10 || c != 123) {
229- return(1);
230- }
231- return(0);
232- }
233- ],
234- [
235- AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS], [1],
236- [GCC atomic builtins are available])
237- AC_MSG_RESULT(yes)
238- ],
239- [
240- AC_MSG_RESULT(no)
241- ]
242- )
243-
244- AC_MSG_CHECKING(whether GCC 64-bit atomic builtins are available)
245- # either define HAVE_IB_GCC_ATOMIC_BUILTINS_64 or not
246- AC_TRY_RUN(
247- [
248- #include <stdint.h>
249- int main()
250- {
251- int64_t x, y, res;
252-
253- x = 10;
254- y = 123;
255- res = __sync_bool_compare_and_swap(&x, x, y);
256- if (!res || x != y) {
257- return(1);
258- }
259-
260- x = 10;
261- y = 123;
262- res = __sync_add_and_fetch(&x, y);
263- if (res != 123 + 10 || x != 123 + 10) {
264- return(1);
265- }
266-
267- return(0);
268- }
269- ],
270- [
271- AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS_64], [1],
272- [GCC 64-bit atomic builtins are available])
273- AC_MSG_RESULT(yes)
274- ],
275- [
276- AC_MSG_RESULT(no)
277- ]
278- )
279-
280- AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
281- # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
282- AC_TRY_RUN(
283- [
284- #include <pthread.h>
285- #include <string.h>
286-
287- int main(int argc, char** argv) {
288- pthread_t x1;
289- pthread_t x2;
290- pthread_t x3;
291-
292- memset(&x1, 0x0, sizeof(x1));
293- memset(&x2, 0x0, sizeof(x2));
294- memset(&x3, 0x0, sizeof(x3));
295-
296- __sync_bool_compare_and_swap(&x1, x2, x3);
297-
298- return(0);
299- }
300- ],
301- [
302- AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_GCC], [1],
303- [pthread_t can be used by GCC atomic builtins])
304- AC_MSG_RESULT(yes)
305- ],
306- [
307- AC_MSG_RESULT(no)
308- ]
309- )
310-
311- AC_MSG_CHECKING(whether Solaris libc atomic functions are available)
312- # Define HAVE_IB_SOLARIS_ATOMICS if _all_ of the following
313- # functions are present.
314- AC_CHECK_FUNCS(atomic_add_long_nv \
315- atomic_cas_32 \
316- atomic_cas_64 \
317- atomic_cas_ulong \
318- atomic_swap_uchar)
319-
320- if test "${ac_cv_func_atomic_add_long_nv}" = "yes" -a \
321- "${ac_cv_func_atomic_cas_32}" = "yes" -a \
322- "${ac_cv_func_atomic_cas_64}" = "yes" -a \
323- "${ac_cv_func_atomic_cas_ulong}" = "yes" -a \
324- "${ac_cv_func_atomic_swap_uchar}" = "yes" ; then
325-
326- AC_DEFINE([HAVE_IB_SOLARIS_ATOMICS], [1],
327- [Define to 1 if Solaris libc atomic functions are available]
328- )
329- fi
330-
331- AC_MSG_CHECKING(whether pthread_t can be used by Solaris libc atomic functions)
332- # either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not
333- AC_TRY_RUN(
334- [
335- #include <pthread.h>
336- #include <string.h>
337-
338- int main(int argc, char** argv) {
339- pthread_t x1;
340- pthread_t x2;
341- pthread_t x3;
342-
343- memset(&x1, 0x0, sizeof(x1));
344- memset(&x2, 0x0, sizeof(x2));
345- memset(&x3, 0x0, sizeof(x3));
346-
347- if (sizeof(pthread_t) == 4) {
348-
349- atomic_cas_32(&x1, x2, x3);
350-
351- } else if (sizeof(pthread_t) == 8) {
352-
353- atomic_cas_64(&x1, x2, x3);
354-
355- } else {
356-
357- return(1);
358- }
359-
360- return(0);
361- }
362- ],
363- [
364- AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS], [1],
365- [pthread_t can be used by solaris atomics])
366- AC_MSG_RESULT(yes)
367- ],
368- [
369- AC_MSG_RESULT(no)
370- ]
371- )
372-
373 # this is needed to know which one of atomic_cas_32() or atomic_cas_64()
374 # to use in the source
375 AC_CHECK_SIZEOF([pthread_t], [], [#include <pthread.h>])
376
377- # Check for x86 PAUSE instruction
378- AC_MSG_CHECKING(for x86 PAUSE instruction)
379- # We have to actually try running the test program, because of a bug
380- # in Solaris on x86_64, where it wrongly reports that PAUSE is not
381- # supported when trying to run an application. See
382- # http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684
383- # We use ib_ prefix to avoid collisoins if this code is added to
384- # mysql's configure.in.
385- AC_TRY_RUN(
386- [
387- int main() {
388- __asm__ __volatile__ ("pause");
389- return(0);
390- }
391- ],
392- [
393- AC_DEFINE([HAVE_IB_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist])
394- AC_MSG_RESULT(yes)
395- ],
396- [
397- AC_MSG_RESULT(no)
398- ],
399- [
400- AC_MSG_RESULT(no)
401- ]
402- )
403 ])
404
405 # vim: set ft=config:
diff --git a/meta-oe/recipes-support/mysql/mariadb/remove-bad-path.patch b/meta-oe/recipes-support/mysql/mariadb/remove-bad-path.patch
new file mode 100644
index 000000000..ff26b0b86
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/remove-bad-path.patch
@@ -0,0 +1,18 @@
1Remove host path from include directories
2
3Naturally this breaks cross-compilation if present.
4
5Upstream-Status: Pending
6
7Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
8
9--- mariadb-5.5.38/storage/tokudb/ft-index/CMakeLists.txt 2014-07-17 14:37:04.529327998 +0100
10+++ mariadb-5.5.38/storage/tokudb/ft-index/CMakeLists.txt 2014-07-17 14:43:56.991337895 +0100
11@@ -39,7 +39,6 @@
12
13 ## default includes and libraries
14 include_directories(SYSTEM
15- /usr/local/include
16 ${ZLIB_INCLUDE_DIRS}
17 )
18
diff --git a/meta-oe/recipes-support/mysql/mariadb/storage-forbids-absolute-addresses-on-IA-32.patch b/meta-oe/recipes-support/mysql/mariadb/storage-forbids-absolute-addresses-on-IA-32.patch
deleted file mode 100644
index 0530cd92f..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/storage-forbids-absolute-addresses-on-IA-32.patch
+++ /dev/null
@@ -1,44 +0,0 @@
1storage: forbids absolute addresses on IA-32
2
3The shared lib has relocations in .text
4...
5WARNING: QA Issue: ELF binary '/usr/lib/plugin/ha_xtradb.so.0.0.0' has relocations in .text
6WARNING: QA Issue: ELF binary '/usr/lib/plugin/ha_innodb_plugin.so.0.0.0' has relocations in .text
7...
8
9Upstream-Status: Pending
10
11Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
12---
13 storage/innodb_plugin/plug.in | 2 +-
14 storage/xtradb/plug.in | 2 +-
15 2 files changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/storage/innodb_plugin/plug.in b/storage/innodb_plugin/plug.in
18--- a/storage/innodb_plugin/plug.in
19+++ b/storage/innodb_plugin/plug.in
20@@ -50,7 +50,7 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin, [
21 ;;
22 *86)
23 # Use absolute addresses on IA-32
24- INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
25+ # INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
26 ;;
27 esac
28 AC_SUBST(INNODB_DYNAMIC_CFLAGS)
29diff --git a/storage/xtradb/plug.in b/storage/xtradb/plug.in
30index a33f4dc..4c186fd 100644
31--- a/storage/xtradb/plug.in
32+++ b/storage/xtradb/plug.in
33@@ -51,7 +51,7 @@ MYSQL_PLUGIN_ACTIONS(xtradb, [
34 ;;
35 *86)
36 # Use absolute addresses on IA-32
37- INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
38+ # INNODB_DYNAMIC_CFLAGS="$INNODB_DYNAMIC_CFLAGS -prefer-non-pic"
39 ;;
40 esac
41 AC_SUBST(INNODB_DYNAMIC_CFLAGS)
42--
431.7.9.5
44
diff --git a/meta-oe/recipes-support/mysql/mariadb/zlib-let-libdir-configurable.patch b/meta-oe/recipes-support/mysql/mariadb/zlib-let-libdir-configurable.patch
deleted file mode 100644
index 880c2a717..000000000
--- a/meta-oe/recipes-support/mysql/mariadb/zlib-let-libdir-configurable.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1zlib: let lib dir configurable
2
3The zlib were found in $mysql_zlib_dir/lib, and the
4search will fail if zlib in $mysql_zlib_dir/lib64.
5
6Let lib dir configurable rather than hardcode.
7
8Upstream-Status: Pending
9Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
10---
11 config/ac-macros/zlib.m4 | 12 ++++++------
12 configure.in | 8 ++++++++
13 2 files changed, 14 insertions(+), 6 deletions(-)
14
15diff --git a/config/ac-macros/zlib.m4 b/config/ac-macros/zlib.m4
16--- a/config/ac-macros/zlib.m4
17+++ b/config/ac-macros/zlib.m4
18@@ -106,17 +106,17 @@ case $SYSTEM_TYPE in
19 ;;
20 *)
21 # Test for libz using all known library file endings
22- if test \( -f "$mysql_zlib_dir/lib/libz.a" -o \
23- -f "$mysql_zlib_dir/lib/libz.so" -o \
24- -f "$mysql_zlib_dir/lib/libz.sl" -o \
25- -f "$mysql_zlib_dir/lib/libz.dylib" \) \
26+ if test \( -f "$mysql_zlib_dir/$base_libdir/libz.a" -o \
27+ -f "$mysql_zlib_dir/$base_libdir/libz.so" -o \
28+ -f "$mysql_zlib_dir/$base_libdir/libz.sl" -o \
29+ -f "$mysql_zlib_dir/$base_libdir/libz.dylib" \) \
30 -a -f "$mysql_zlib_dir/include/zlib.h"; then
31 ZLIB_INCLUDES="-I$mysql_zlib_dir/include"
32- ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz"
33+ ZLIB_LIBS="-L$mysql_zlib_dir/$base_libdir -lz"
34 MYSQL_CHECK_ZLIB_DIR
35 fi
36 if test "x$mysql_cv_compress" != "xyes"; then
37- AC_MSG_ERROR([headers or binaries were not found in $mysql_zlib_dir/{include,lib}])
38+ AC_MSG_ERROR([headers or binaries were not found in $mysql_zlib_dir/{include,$base_libdir}])
39 fi
40 ;;
41 esac
42diff --git a/configure.in b/configure.in
43index 2c6c08e..193b59a 100644
44--- a/configure.in
45+++ b/configure.in
46@@ -104,6 +104,14 @@ AC_SUBST(SHARED_LIB_MAJOR_VERSION)
47 AC_SUBST(SHARED_LIB_VERSION)
48 AC_SUBST(AVAILABLE_LANGUAGES)
49
50+AC_ARG_WITH([baselib-dir],
51+ AC_HELP_STRING([--baselib-dir=DIR],
52+ [Provide MySQL with a custom location of
53+ baselib dir. Given DIR, such as zlib binary is
54+ assumed to be in $zlib-dir/$DIR.]),
55+ [base_libdir=${withval}],
56+ [base_libdir="lib"])
57+
58 # Check whether a debug mode should be enabled.
59 AC_ARG_WITH([debug],
60 AS_HELP_STRING([--with-debug@<:@=full@:>@],
61--
621.8.1.2
63
diff --git a/meta-oe/recipes-support/mysql/mariadb_5.1.67.bb b/meta-oe/recipes-support/mysql/mariadb_5.5.38.bb
index 6ad1fe68a..fee5b6297 100644
--- a/meta-oe/recipes-support/mysql/mariadb_5.1.67.bb
+++ b/meta-oe/recipes-support/mysql/mariadb_5.5.38.bb
@@ -1,6 +1,8 @@
1require ${PN}_${PV}.inc 1require ${PN}_${PV}.inc
2 2
3DEPENDS += "mariadb-native ncurses zlib" 3EXTRA_OECMAKE += "-DSTACK_DIRECTION=-1"
4
5DEPENDS += "mariadb-native ncurses zlib readline libaio"
4 6
5PROVIDES += "mysql5" 7PROVIDES += "mysql5"
6 8
diff --git a/meta-oe/recipes-support/mysql/mariadb_5.1.67.inc b/meta-oe/recipes-support/mysql/mariadb_5.5.38.inc
index 0c83c7103..e6eae7873 100644
--- a/meta-oe/recipes-support/mysql/mariadb_5.1.67.inc
+++ b/meta-oe/recipes-support/mysql/mariadb_5.5.38.inc
@@ -4,31 +4,21 @@ SECTION = "libs"
4LICENSE = "GPLv2" 4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" 5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6 6
7SRC_URI = "http://mirrors.coreix.net/mariadb/mariadb-${PV}/kvm-tarbake-jaunty-x86/mariadb-${PV}.tar.gz \ 7SRC_URI = "http://mirror.stshosting.co.uk/mariadb/mariadb-${PV}/source/mariadb-${PV}.tar.gz \
8 file://configure.in.patch \ 8 file://fix-cmake-module-path.patch \
9 file://plug.in.patch \ 9 file://remove-bad-path.patch \
10 file://misc.m4.patch \ 10 file://fix-mysqlclient-r-version.patch \
11 file://Makefile.am.patch \
12 file://fix_host_path.patch \
13 file://configure-ps-cache-check.patch \
14 file://fix-cve-2013-1861-1.patch \
15 file://fix-cve-2013-1861-2.patch \
16 file://zlib-let-libdir-configurable.patch \
17 file://storage-forbids-absolute-addresses-on-IA-32.patch \
18 file://my.cnf \ 11 file://my.cnf \
19 file://mysqld.sh \
20 file://avoid-plugin-options-warnings.patch \
21 file://fix-link-error-ub1310.patch \
22 " 12 "
23 13
24SRC_URI[md5sum] = "44c331fa91943155e4796f89e17a0612" 14SRC_URI[md5sum] = "fa9ba00b084b95a45fab70860c412f10"
25SRC_URI[sha256sum] = "33471e9275c9b03919cabc38eb39f807d645adabf6a1a18f2e41ed73f47677c8" 15SRC_URI[sha256sum] = "efc839e6627064b3b5c6c39854198f0d34907f48937804758d4c09c7717be8d3"
26 16
27S = "${WORKDIR}/mariadb-${PV}" 17S = "${WORKDIR}/mariadb-${PV}"
28 18
29BINCONFIG_GLOB = "mysql_config" 19BINCONFIG_GLOB = "mysql_config"
30 20
31inherit autotools-brokensep binconfig update-rc.d useradd 21inherit cmake gettext binconfig update-rc.d useradd
32 22
33INITSCRIPT_PACKAGES = "${PN}-server" 23INITSCRIPT_PACKAGES = "${PN}-server"
34INITSCRIPT_NAME = "mysqld" 24INITSCRIPT_NAME = "mysqld"
@@ -38,29 +28,51 @@ USERADD_PACKAGES = "${PN}-server"
38USERADD_PARAM_${PN}-server = "--system --home-dir /var/mysql -g nogroup --shell /bin/false mysql" 28USERADD_PARAM_${PN}-server = "--system --home-dir /var/mysql -g nogroup --shell /bin/false mysql"
39 29
40 30
41export ac_cv_path_PS="/bin/ps"
42export ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null"
43PARALLEL_MAKE = " "
44EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'" 31EXTRA_OEMAKE = "'GEN_LEX_HASH=${STAGING_BINDIR_NATIVE}/gen_lex_hash'"
45EXTRA_OECONF = "--with-atomic-ops=up \
46 --with-embedded-server \
47 --sysconfdir=/etc/mysql \
48 --localstatedir=/var/mysql \
49 --disable-dependency-tracking \
50 --without-debug \
51 --with-low-memory \
52 --without-query-cache \
53 --without-plugin-maria \
54 --without-man \
55 --without-docs \
56 --with-zlib-dir=${STAGING_EXECPREFIXDIR} \
57 --with-baselib-dir=${base_libdir} \
58 --with-pic \
59 "
60 32
61do_configure_append() { 33python __anonymous() {
62 sed -i /comp_err/d ${B}/sql/share/Makefile 34 # This is a pain but it's the only way to pass these in since
35 # MariaDB's cmake scripts insist on prepending the prefix to the
36 # specified values for INSTALL_*
37 localdata = d.createCopy()
38 localdata.setVar('prefix', '')
39 localdata.setVar('exec_prefix', '')
40 d.setVar('bindir_noprefix', localdata.getVar('bindir', True).lstrip('/'))
41 d.setVar('sbindir_noprefix', localdata.getVar('sbindir', True).lstrip('/'))
42 d.setVar('datadir_noprefix', localdata.getVar('datadir', True).lstrip('/'))
43 d.setVar('libdir_noprefix', localdata.getVar('libdir', True).lstrip('/'))
44}
45
46PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
47PACKAGECONFIG_class-native = ""
48PACKAGECONFIG[pam] = ",-DWITHOUT_AUTH_PAM=TRUE,libpam"
49
50# MariaDB doesn't link properly with gold
51# https://mariadb.atlassian.net/browse/MDEV-5982
52TARGET_CFLAGS += "-fuse-ld=bfd"
53
54EXTRA_OECMAKE = "-DWITH_EMBEDDED_SERVER=ON \
55 -DWITH_JEMALLOC=no \
56 -DWITHOUT_TOKUDB=TRUE \
57 -DCMAKE_DISABLE_FIND_PACKAGE_Boost=TRUE \
58 -DGROFF=FALSE \
59 -DNROFF=FALSE \
60 -DENABLE_DTRACE=FALSE \
61 -DWITH_PIC=ON \
62 -DINSTALL_DOCDIR:PATH=${datadir_noprefix}/doc/${BPN} \
63 -DINSTALL_BINDIR:PATH=${bindir_noprefix} \
64 -DINSTALL_SBINDIR:PATH=${sbindir_noprefix} \
65 -DINSTALL_SCRIPTDIR:PATH=${bindir_noprefix} \
66 -DINSTALL_LIBDIR:PATH=${libdir_noprefix} \
67 -DINSTALL_PLUGINDIR:PATH=${libdir_noprefix}/plugin \
68 -DINSTALL_SYSCONFDIR:PATH=${sysconfdir} \
69 -DINSTALL_MYSQLSHAREDIR:PATH=${datadir_noprefix}/mysql \
70 -DINSTALL_SUPPORTFILESDIR:PATH=${datadir_noprefix}/mysql-support-files \
71 -DMYSQL_DATADIR:PATH=/var/mysql \
72 -DCAT_EXECUTABLE=`which cat` \
73 -DCMAKE_AR:FILEPATH=${AR}"
63 74
75do_configure_append() {
64 # handle distros with different values of ${libexecdir} 76 # handle distros with different values of ${libexecdir}
65 libexecdir2=`echo ${libexecdir} | sed -e 's+/usr/++g'` 77 libexecdir2=`echo ${libexecdir} | sed -e 's+/usr/++g'`
66 sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysql_install_db.sh 78 sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysql_install_db.sh
@@ -68,6 +80,20 @@ do_configure_append() {
68 sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysqld_safe.sh 80 sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysqld_safe.sh
69} 81}
70 82
83do_generate_toolchain_file_append_class-native () {
84 # If these are set cmake will assume we're cross-compiling, which will
85 # result in certain things we want being disabled
86 sed -i "/set( CMAKE_SYSTEM_NAME/d" ${WORKDIR}/toolchain.cmake
87 sed -i "/set( CMAKE_SYSTEM_PROCESSOR/d" ${WORKDIR}/toolchain.cmake
88}
89
90do_compile_prepend_class-target () {
91 # These need to be in-tree or make will think they need to be built,
92 # and since we're cross-compiling that is disabled
93 cp ${STAGING_BINDIR_NATIVE}/comp_err ${S}/extra
94 cp ${STAGING_BINDIR_NATIVE}/comp_sql ${S}/scripts
95}
96
71SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess" 97SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess"
72 98
73# We need to append this so it runs *after* binconfig's preprocess function 99# We need to append this so it runs *after* binconfig's preprocess function
@@ -82,13 +108,10 @@ mariadb_sysroot_preprocess () {
82 108
83do_install() { 109do_install() {
84 oe_runmake 'DESTDIR=${D}' install 110 oe_runmake 'DESTDIR=${D}' install
85 mv -f ${D}${libdir}/mysql/* ${D}${libdir}
86 rmdir ${D}${libdir}/mysql
87 find ${D}${libdir} -name '*.la'|xargs sed -i 's#${libdir}/mysql#${libdir}#'
88 111
89 install -d ${D}/etc/init.d 112 install -d ${D}/${sysconfdir}/init.d
90 install -m 0644 ${WORKDIR}/my.cnf ${D}/etc/ 113 install -m 0644 ${WORKDIR}/my.cnf ${D}/${sysconfdir}/
91 install -m 0755 ${WORKDIR}/mysqld.sh ${D}/etc/init.d/mysqld 114 mv ${D}/${sysconfdir}/init.d/mysql ${D}/${sysconfdir}/init.d/mysqld
92} 115}
93 116
94pkg_postinst_${PN}-server () { 117pkg_postinst_${PN}-server () {
@@ -102,7 +125,7 @@ pkg_postinst_${PN}-server () {
102 mkdir /var/lib/mysql 125 mkdir /var/lib/mysql
103 chown mysql.nogroup /var/lib/mysql 126 chown mysql.nogroup /var/lib/mysql
104 127
105 mysql_install_db 128 mysql_install_db --basedir=${prefix} --user=mysql
106 129
107} 130}
108 131
@@ -130,19 +153,14 @@ RDEPENDS_${PN}-leftovers = "perl perl-module-cwd perl-module-benchmark perl-modu
130 perl-module-io-socket-inet perl-module-io-select" 153 perl-module-io-socket-inet perl-module-io-select"
131 154
132FILES_libmysqlclient = "\ 155FILES_libmysqlclient = "\
133 ${libdir}/libmysqlclient.so.* \ 156 ${libdir}/libmysqlclient.so.*"
134 ${libdir}/plugin/*.so.*"
135FILES_libmysqlclient-dev = " \ 157FILES_libmysqlclient-dev = " \
136 ${includedir}/mysql/ \ 158 ${includedir}/mysql/ \
137 ${libdir}/libmysqlclient.so \ 159 ${libdir}/libmysqlclient.so \
138 ${libdir}/libmysqlclient.la \
139 ${libdir}/plugin/*.so \
140 ${libdir}/plugin/*.la \
141 ${sysconfdir}/aclocal \ 160 ${sysconfdir}/aclocal \
142 ${bindir}/mysql_config" 161 ${bindir}/mysql_config"
143FILES_libmysqlclient-staticdev = "\ 162FILES_libmysqlclient-staticdev = "\
144 ${libdir}/*.a \ 163 ${libdir}/*.a"
145 ${libdir}/plugin/*.a"
146FILES_libmysqlclient-dbg = "${libdir}/plugin/.debug/ \ 164FILES_libmysqlclient-dbg = "${libdir}/plugin/.debug/ \
147 /usr/mysql-test/lib/My/SafeProcess/.debug/my_safe_process" 165 /usr/mysql-test/lib/My/SafeProcess/.debug/my_safe_process"
148 166
@@ -153,8 +171,7 @@ INSANE_SKIP_libmysqlclient_append_i586 = " textrel"
153 171
154FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*" 172FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*"
155FILES_libmysqlclient-r-dev = "\ 173FILES_libmysqlclient-r-dev = "\
156 ${libdir}/libmysqlclient_r.so \ 174 ${libdir}/libmysqlclient_r.so"
157 ${libdir}/libmysqlclient_r.la"
158FILES_libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a" 175FILES_libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a"
159FILES_libmysqlclient-r-dbg = "${libdir}/plugin/.debuglibmysqlclient_r.so.*" 176FILES_libmysqlclient-r-dbg = "${libdir}/plugin/.debuglibmysqlclient_r.so.*"
160 177
@@ -199,6 +216,7 @@ FILES_${PN}-server = "\
199 ${bindir}/mysql_setpermission \ 216 ${bindir}/mysql_setpermission \
200 ${bindir}/mysql_tzinfo_to_sql \ 217 ${bindir}/mysql_tzinfo_to_sql \
201 ${bindir}/mysql_upgrade \ 218 ${bindir}/mysql_upgrade \
219 ${bindir}/mysql_plugin \
202 ${bindir}/mysql_zap \ 220 ${bindir}/mysql_zap \
203 ${bindir}/mysqlbinlog \ 221 ${bindir}/mysqlbinlog \
204 ${bindir}/mysqld_multi \ 222 ${bindir}/mysqld_multi \
@@ -225,6 +243,7 @@ FILES_${PN}-server = "\
225 ${sbindir}/ndb_cpcd \ 243 ${sbindir}/ndb_cpcd \
226 ${sbindir}/ndbd \ 244 ${sbindir}/ndbd \
227 ${sbindir}/ndb_mgmd \ 245 ${sbindir}/ndb_mgmd \
246 ${libdir}/plugin/*.so \
228 ${datadir}/mysql/ \ 247 ${datadir}/mysql/ \
229 ${localstatedir}/mysql/ \ 248 ${localstatedir}/mysql/ \
230 ${sysconfdir}/init.d \ 249 ${sysconfdir}/init.d \