summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/mysql
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-10 03:20:04 +0200
commit1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch)
tree0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-oe/recipes-support/mysql
downloadmeta-openembedded-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-support/mysql')
-rw-r--r--meta-oe/recipes-support/mysql/mariadb-native_5.1.67.bb20
-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-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_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.cnf21
-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/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.1.67.bb26
-rw-r--r--meta-oe/recipes-support/mysql/mariadb_5.1.67.inc234
-rw-r--r--meta-oe/recipes-support/mysql/mysql-python/remove-distribute.patch17
-rw-r--r--meta-oe/recipes-support/mysql/mysql-python_1.2.4.bb19
19 files changed, 1467 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/mysql/mariadb-native_5.1.67.bb b/meta-oe/recipes-support/mysql/mariadb-native_5.1.67.bb
new file mode 100644
index 0000000000..942afcc55d
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb-native_5.1.67.bb
@@ -0,0 +1,20 @@
1require mariadb_${PV}.inc
2inherit native
3
4PROVIDES += "mysql5-native"
5DEPENDS = "ncurses-native zlib-native"
6
7RDEPENDS_${PN} = ""
8PACKAGES = ""
9EXTRA_OEMAKE = ""
10EXTRA_OECONF = " --with-embedded-server "
11
12do_install() {
13 oe_runmake 'DESTDIR=${D}' install
14 mv -f ${D}${libdir}/mysql/* ${D}${libdir}
15 rmdir ${D}${libdir}/mysql
16
17 install -d ${D}${bindir}
18 install -m 0755 sql/gen_lex_hash ${D}${bindir}/
19}
20
diff --git a/meta-oe/recipes-support/mysql/mariadb/Makefile.am.patch b/meta-oe/recipes-support/mysql/mariadb/Makefile.am.patch
new file mode 100644
index 0000000000..33fd17acd4
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/Makefile.am.patch
@@ -0,0 +1,19 @@
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
new file mode 100644
index 0000000000..84ff6f023d
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/avoid-plugin-options-warnings.patch
@@ -0,0 +1,17 @@
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
new file mode 100644
index 0000000000..3b5b3fd063
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/configure-ps-cache-check.patch
@@ -0,0 +1,27 @@
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
new file mode 100644
index 0000000000..6fe2dfaa1a
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/configure.in.patch
@@ -0,0 +1,13 @@
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-cve-2013-1861-1.patch b/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-1.patch
new file mode 100644
index 0000000000..df2e7086c4
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-1.patch
@@ -0,0 +1,174 @@
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
new file mode 100644
index 0000000000..c35cdfb641
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/fix-cve-2013-1861-2.patch
@@ -0,0 +1,257 @@
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
new file mode 100644
index 0000000000..a528ea700a
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/fix-link-error-ub1310.patch
@@ -0,0 +1,37 @@
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_host_path.patch b/meta-oe/recipes-support/mysql/mariadb/fix_host_path.patch
new file mode 100644
index 0000000000..4f69cd5198
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/fix_host_path.patch
@@ -0,0 +1,37 @@
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
new file mode 100644
index 0000000000..7b0acff21c
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/misc.m4.patch
@@ -0,0 +1,13 @@
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
new file mode 100644
index 0000000000..d17438122d
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/my.cnf
@@ -0,0 +1,21 @@
1[client]
2#password = password
3port = 3306
4socket = /tmp/mysql.sock
5
6[mysqld_safe]
7err-log = /var/log/mysql.err
8
9[mysqld]
10user = mysql
11port = 3306
12socket = /tmp/mysql.sock
13pid-file = /var/lib/mysql/mysqld.pid
14log-error = /var/log/mysqld.err
15basedir = /usr
16datadir = /var/mysql
17skip-external-locking
18skip-networking
19ignore-builtin-innodb
20bind-address = localhost
21
diff --git a/meta-oe/recipes-support/mysql/mariadb/mysqld.sh b/meta-oe/recipes-support/mysql/mariadb/mysqld.sh
new file mode 100644
index 0000000000..479ebdb257
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/mysqld.sh
@@ -0,0 +1,24 @@
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
new file mode 100644
index 0000000000..156fd10823
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/plug.in.patch
@@ -0,0 +1,405 @@
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/storage-forbids-absolute-addresses-on-IA-32.patch b/meta-oe/recipes-support/mysql/mariadb/storage-forbids-absolute-addresses-on-IA-32.patch
new file mode 100644
index 0000000000..0530cd92ff
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/storage-forbids-absolute-addresses-on-IA-32.patch
@@ -0,0 +1,44 @@
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
new file mode 100644
index 0000000000..880c2a717a
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb/zlib-let-libdir-configurable.patch
@@ -0,0 +1,63 @@
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.1.67.bb
new file mode 100644
index 0000000000..6ad1fe68aa
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb_5.1.67.bb
@@ -0,0 +1,26 @@
1require ${PN}_${PV}.inc
2
3DEPENDS += "mariadb-native ncurses zlib"
4
5PROVIDES += "mysql5"
6
7RPROVIDES_${PN} += "mysql5"
8RREPLACES_${PN} += "mysql5"
9RCONFLICTS_${PN} += "mysql5"
10
11RPROVIDES_${PN}-dbg += "mysql5-dbg"
12RREPLACES_${PN}-dbg += "mysql5-dbg"
13RCONFLICTS_${PN}-dbg += "mysql5-dbg"
14
15RPROVIDES_${PN}-leftovers += "mysql5-leftovers"
16RREPLACES_${PN}-leftovers += "mysql5-leftovers"
17RCONFLICTS_${PN}-leftovers += "mysql5-leftovers"
18
19RPROVIDES_${PN}-client += "mysql5-client"
20RREPLACES_${PN}-client += "mysql5-client"
21RCONFLICTS_${PN}-client += "mysql5-client"
22
23RPROVIDES_${PN}-server += "mysql5-server"
24RREPLACES_${PN}-server += "mysql5-server"
25RCONFLICTS_${PN}-server += "mysql5-server"
26
diff --git a/meta-oe/recipes-support/mysql/mariadb_5.1.67.inc b/meta-oe/recipes-support/mysql/mariadb_5.1.67.inc
new file mode 100644
index 0000000000..0c83c71038
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mariadb_5.1.67.inc
@@ -0,0 +1,234 @@
1SUMMARY = "A robust, scalable, and reliable SQL server"
2HOMEPAGE = "http://mariadb.org"
3SECTION = "libs"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
6
7SRC_URI = "http://mirrors.coreix.net/mariadb/mariadb-${PV}/kvm-tarbake-jaunty-x86/mariadb-${PV}.tar.gz \
8 file://configure.in.patch \
9 file://plug.in.patch \
10 file://misc.m4.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 \
19 file://mysqld.sh \
20 file://avoid-plugin-options-warnings.patch \
21 file://fix-link-error-ub1310.patch \
22 "
23
24SRC_URI[md5sum] = "44c331fa91943155e4796f89e17a0612"
25SRC_URI[sha256sum] = "33471e9275c9b03919cabc38eb39f807d645adabf6a1a18f2e41ed73f47677c8"
26
27S = "${WORKDIR}/mariadb-${PV}"
28
29BINCONFIG_GLOB = "mysql_config"
30
31inherit autotools-brokensep binconfig update-rc.d useradd
32
33INITSCRIPT_PACKAGES = "${PN}-server"
34INITSCRIPT_NAME = "mysqld"
35INITSCRIPT_PARAMS = "start 45 5 . stop 45 0 6 1 ."
36
37USERADD_PACKAGES = "${PN}-server"
38USERADD_PARAM_${PN}-server = "--system --home-dir /var/mysql -g nogroup --shell /bin/false mysql"
39
40
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'"
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
61do_configure_append() {
62 sed -i /comp_err/d ${B}/sql/share/Makefile
63
64 # handle distros with different values of ${libexecdir}
65 libexecdir2=`echo ${libexecdir} | sed -e 's+/usr/++g'`
66 sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysql_install_db.sh
67 sed -i -e "s:mysqld libexec:mysqld $libexecdir2:g" ${S}/scripts/mysql_install_db.sh
68 sed -i -e "s:/libexec:/$libexecdir2:g" ${S}/scripts/mysqld_safe.sh
69}
70
71SYSROOT_PREPROCESS_FUNCS += "mariadb_sysroot_preprocess"
72
73# We need to append this so it runs *after* binconfig's preprocess function
74#
75# We really don't care exactly what the directories were set to originally.
76# plugindir is not fixed, but we don't create any plugins.
77#
78mariadb_sysroot_preprocess () {
79 sed -i -es,^pkgincludedir=.*,pkgincludedir=\'${STAGING_INCDIR}/mysql\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config
80 sed -i -es,^pkglibdir=.*,pkglibdir=\'${STAGING_LIBDIR}\', ${SYSROOT_DESTDIR}${bindir_crossscripts}/mysql_config
81}
82
83do_install() {
84 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
89 install -d ${D}/etc/init.d
90 install -m 0644 ${WORKDIR}/my.cnf ${D}/etc/
91 install -m 0755 ${WORKDIR}/mysqld.sh ${D}/etc/init.d/mysqld
92}
93
94pkg_postinst_${PN}-server () {
95 if [ "x$D" != "x" ]; then
96 exit 1
97 fi
98
99 #Install the database
100 test -d /usr/bin || mkdir -p /usr/bin
101 test -e /usr/bin/hostname || ln -s /bin/hostname /usr/bin/hostname
102 mkdir /var/lib/mysql
103 chown mysql.nogroup /var/lib/mysql
104
105 mysql_install_db
106
107}
108
109PACKAGES = "${PN}-dbg ${PN} \
110 libmysqlclient-r libmysqlclient-r-dev libmysqlclient-r-staticdev libmysqlclient-r-dbg \
111 libmysqlclient libmysqlclient-dev libmysqlclient-staticdev libmysqlclient-dbg \
112 libmysqld libmysqld-dev ${PN}-client ${PN}-server ${PN}-leftovers"
113CONFFILES_${PN}-server += "${sysconfdir}/my.cnf"
114
115FILES_${PN} = " "
116RDEPENDS_${PN} = "${PN}-client ${PN}-server"
117ALLOW_EMPTY_${PN} = "1"
118
119RDEPENDS_${PN}-client = "perl perl-module-getopt-long perl-module-file-temp \
120 perl-module-fcntl perl-module-sys-hostname perl-module-ipc-open3 \
121 perl-module-exporter"
122RDEPENDS_${PN}-server = "perl perl-module-getopt-long perl-module-data-dumper \
123 perl-module-file-basename perl-module-file-path perl-module-sys-hostname \
124 perl-module-file-copy perl-module-file-temp perl-module-posix"
125RDEPENDS_${PN}-leftovers = "perl perl-module-cwd perl-module-benchmark perl-module-getopt-long \
126 perl-module-posix perl-module-data-dumper perl-module-sigtrap perl-module-threads \
127 perl-module-threads-shared perl-module-io-socket perl-module-sys-hostname perl-module-file-copy \
128 perl-module-file-spec perl-module-file-find perl-module-file-basename perl-module-file-path \
129 perl-module-constant perl-module-lib perl-module-file-temp perl-module-file-spec-functions \
130 perl-module-io-socket-inet perl-module-io-select"
131
132FILES_libmysqlclient = "\
133 ${libdir}/libmysqlclient.so.* \
134 ${libdir}/plugin/*.so.*"
135FILES_libmysqlclient-dev = " \
136 ${includedir}/mysql/ \
137 ${libdir}/libmysqlclient.so \
138 ${libdir}/libmysqlclient.la \
139 ${libdir}/plugin/*.so \
140 ${libdir}/plugin/*.la \
141 ${sysconfdir}/aclocal \
142 ${bindir}/mysql_config"
143FILES_libmysqlclient-staticdev = "\
144 ${libdir}/*.a \
145 ${libdir}/plugin/*.a"
146FILES_libmysqlclient-dbg = "${libdir}/plugin/.debug/ \
147 /usr/mysql-test/lib/My/SafeProcess/.debug/my_safe_process"
148
149# Avoid warnings about ha_xtradb.so.0.0.0 and ha_innodb_plugin.so.0.0.0
150# which are intentionally non-PIC on 32-bit x86 (see e.g.
151# storage/xtradb/plug.in in the source)
152INSANE_SKIP_libmysqlclient_append_i586 = " textrel"
153
154FILES_libmysqlclient-r = "${libdir}/libmysqlclient_r.so.*"
155FILES_libmysqlclient-r-dev = "\
156 ${libdir}/libmysqlclient_r.so \
157 ${libdir}/libmysqlclient_r.la"
158FILES_libmysqlclient-r-staticdev = "${libdir}/libmysqlclient_r.a"
159FILES_libmysqlclient-r-dbg = "${libdir}/plugin/.debuglibmysqlclient_r.so.*"
160
161FILES_libmysqld = "\
162 ${libdir}/libmysqld.so.*"
163FILES_libmysqld-dev = "\
164 ${libdir}/libmysqld.so"
165
166FILES_${PN}-client = "\
167 ${bindir}/myisam_ftdump \
168 ${bindir}/mysql \
169 ${bindir}/mysql_client_test \
170 ${bindir}/mysql_client_test_embedded \
171 ${bindir}/mysql_find_rows \
172 ${bindir}/mysql_fix_extensions \
173 ${bindir}/mysql_waitpid \
174 ${bindir}/mysqlaccess \
175 ${bindir}/mysqladmin \
176 ${bindir}/mysqlbug \
177 ${bindir}/mysqlcheck \
178 ${bindir}/mysqldump \
179 ${bindir}/mysqldumpslow \
180 ${bindir}/mysqlimport \
181 ${bindir}/mysqlshow \
182 ${bindir}/mysqlslap \
183 ${bindir}/mysqltest_embedded \
184 ${libexecdir}/mysqlmanager"
185
186FILES_${PN}-server = "\
187 ${bindir}/comp_err \
188 ${bindir}/isamchk \
189 ${bindir}/isamlog \
190 ${bindir}/msql2mysql \
191 ${bindir}/my_print_defaults \
192 ${bindir}/myisamchk \
193 ${bindir}/myisamlog \
194 ${bindir}/myisampack \
195 ${bindir}/mysql_convert_table_format \
196 ${bindir}/mysql_fix_privilege_tables \
197 ${bindir}/mysql_install_db \
198 ${bindir}/mysql_secure_installation \
199 ${bindir}/mysql_setpermission \
200 ${bindir}/mysql_tzinfo_to_sql \
201 ${bindir}/mysql_upgrade \
202 ${bindir}/mysql_zap \
203 ${bindir}/mysqlbinlog \
204 ${bindir}/mysqld_multi \
205 ${bindir}/mysqld_safe \
206 ${bindir}/mysqlhotcopy \
207 ${bindir}/mysqltest \
208 ${bindir}/ndb_delete_all \
209 ${bindir}/ndb_desc \
210 ${bindir}/ndb_drop_index \
211 ${bindir}/ndb_drop_table \
212 ${bindir}/ndb_mgm \
213 ${bindir}/ndb_restore \
214 ${bindir}/ndb_select_all \
215 ${bindir}/ndb_select_count \
216 ${bindir}/ndb_show_tables \
217 ${bindir}/ndb_waiter \
218 ${bindir}/pack_isam \
219 ${bindir}/perror \
220 ${bindir}/replace \
221 ${bindir}/resolve_stack_dump \
222 ${bindir}/resolveip \
223 ${libexecdir}/mysqld \
224 ${sbindir}/mysqld \
225 ${sbindir}/ndb_cpcd \
226 ${sbindir}/ndbd \
227 ${sbindir}/ndb_mgmd \
228 ${datadir}/mysql/ \
229 ${localstatedir}/mysql/ \
230 ${sysconfdir}/init.d \
231 ${sysconfdir}/my.cnf"
232
233DESCRIPTION_${PN}-leftovers = "unpackaged and probably unneeded files for ${PN}"
234FILES_${PN}-leftovers = "/"
diff --git a/meta-oe/recipes-support/mysql/mysql-python/remove-distribute.patch b/meta-oe/recipes-support/mysql/mysql-python/remove-distribute.patch
new file mode 100644
index 0000000000..0ce750d63d
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mysql-python/remove-distribute.patch
@@ -0,0 +1,17 @@
1Upstream-Status: Innapropriate
2
3Index: MySQL-python-1.2.4/setup.py
4===================================================================
5--- MySQL-python-1.2.4.orig/setup.py
6+++ MySQL-python-1.2.4/setup.py
7@@ -3,8 +3,8 @@
8 import os
9 import sys
10
11-from distribute_setup import use_setuptools
12-use_setuptools()
13+#from distribute_setup import use_setuptools
14+#use_setuptools()
15 from setuptools import setup, Extension
16
17 if not hasattr(sys, "hexversion") or sys.hexversion < 0x02040000:
diff --git a/meta-oe/recipes-support/mysql/mysql-python_1.2.4.bb b/meta-oe/recipes-support/mysql/mysql-python_1.2.4.bb
new file mode 100644
index 0000000000..6fc974ecde
--- /dev/null
+++ b/meta-oe/recipes-support/mysql/mysql-python_1.2.4.bb
@@ -0,0 +1,19 @@
1SUMMARY = "Python interface to MySQL"
2HOMEPAGE = "https://github.com/farcepest/MySQLdb1"
3SECTION = "devel/python"
4LICENSE = "GPLv2"
5LIC_FILES_CHKSUM = "file://GPL-2.0;md5=b234ee4d69f5fce4486a80fdaf4a4263"
6
7DEPENDS = "mysql5"
8
9SRCNAME = "MySQL-python"
10
11SRC_URI = "https://pypi.python.org/packages/source/M/${SRCNAME}/${SRCNAME}-${PV}.zip \
12 file://remove-distribute.patch"
13
14SRC_URI[md5sum] = "ddf2386daf10a97af115ffad2ed4a9a0"
15SRC_URI[sha256sum] = "e405f9d6be33923d428acaa4db4f4470427f1d15ea0d2d82a933449ace26bbd9"
16
17S = "${WORKDIR}/${SRCNAME}-${PV}"
18
19inherit setuptools