summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb.inc1
-rw-r--r--meta-oe/recipes-dbs/mysql/mariadb/libfmt_make_fmt.patch68
2 files changed, 69 insertions, 0 deletions
diff --git a/meta-oe/recipes-dbs/mysql/mariadb.inc b/meta-oe/recipes-dbs/mysql/mariadb.inc
index ee3fe0a32..d64d5b0e4 100644
--- a/meta-oe/recipes-dbs/mysql/mariadb.inc
+++ b/meta-oe/recipes-dbs/mysql/mariadb.inc
@@ -23,6 +23,7 @@ SRC_URI = "https://archive.mariadb.org/${BP}/source/${BP}.tar.gz \
23 file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \ 23 file://0001-sql-CMakeLists.txt-fix-gen_lex_hash-not-found.patch \
24 file://lfs64.patch \ 24 file://lfs64.patch \
25 file://0001-Add-missing-includes-cstdint-and-cstdio.patch \ 25 file://0001-Add-missing-includes-cstdint-and-cstdio.patch \
26 file://libfmt_make_fmt.patch \
26 " 27 "
27SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch" 28SRC_URI:append:libc-musl = " file://ppc-remove-glibc-dep.patch"
28SRC_URI[sha256sum] = "4c9484048d4d0c71dd076ab33fc2a9ce8510bdf762886de0d63fe52496f3dbbb" 29SRC_URI[sha256sum] = "4c9484048d4d0c71dd076ab33fc2a9ce8510bdf762886de0d63fe52496f3dbbb"
diff --git a/meta-oe/recipes-dbs/mysql/mariadb/libfmt_make_fmt.patch b/meta-oe/recipes-dbs/mysql/mariadb/libfmt_make_fmt.patch
new file mode 100644
index 000000000..4d5f4a611
--- /dev/null
+++ b/meta-oe/recipes-dbs/mysql/mariadb/libfmt_make_fmt.patch
@@ -0,0 +1,68 @@
1Make make_arg work with libfmt 10.1+
2
3This ensures that compiler can find the correct template to use
4Fixes
5
6mariadb-10.11.5/sql/item_strfunc.cc:1429:22: error: no matching functi
7on for call to 'make_arg'
8| 1429 | vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_int());
9| | ^~~~~~~~~~~~~~~~~~~~~~~~~~
10| /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/mariadb/10.11.5/recipe-sysroot/usr/include/fmt/core.h:1588:20: note: candidate functio
11n [with Context = fmt::basic_format_context<fmt::appender, char>, T = long long] not viable: expects an lvalue for 1st argument
12| 1588 | FMT_CONSTEXPR auto make_arg(T& val) -> basic_format_arg<Context> {
13| | ^ ~~~~~~
14| /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/mariadb/10.11.5/recipe-sysroot/usr/include/fmt/core.h:1559:31: note: candidate templat
15e ignored: invalid explicitly-specified argument for template parameter 'PACKED'
16| 1559 | FMT_CONSTEXPR FMT_INLINE auto make_arg(T& [ 46%] Building C object mysys/CMakeFiles/mysys.dir/my_likely.c.o
17| val) -> value<Context> {
18| | ^
19| /mnt/b/yoe/master/build/tmp/work/cortexa72-cortexa53-crypto-yoe-linux/mariadb/10.11.5/recipe-sysroot/usr/include/fmt/core.h:1596:27: note: candidate templat
20e ignored: invalid explicitly-specified argument for template parameter 'PACKED'
21| 1596 | FMT_CONSTEXPR inline auto make_arg(T& val) -> basic_format_arg<Context> {
22| | ^
23
24Upstream-Status: Pending
25Signed-off-by: Khem Raj <raj.khem@gmail.com>
26
27--- a/cmake/libfmt.cmake
28+++ b/cmake/libfmt.cmake
29@@ -33,8 +33,9 @@ MACRO (CHECK_LIBFMT)
30 #include <fmt/format-inl.h>
31 #include <iostream>
32 int main() {
33+ int val = 42;
34 fmt::format_args::format_arg arg=
35- fmt::detail::make_arg<fmt::format_context>(42);
36+ fmt::detail::make_arg<fmt::format_context>(val);
37 std::cout << fmt::vformat(\"The answer is {}.\",
38 fmt::format_args(&arg, 1));
39 }" HAVE_SYSTEM_LIBFMT)
40--- a/sql/item_strfunc.cc
41+++ b/sql/item_strfunc.cc
42@@ -1426,14 +1426,22 @@ String *Item_func_sformat::val_str(Strin
43 switch (args[carg]->result_type())
44 {
45 case INT_RESULT:
46- vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_int());
47+ int intval;
48+ intval = args[carg]->val_int();
49+ vargs[carg-1]= fmt::detail::make_arg<ctx>(intval);
50 break;
51 case DECIMAL_RESULT: // TODO
52 case REAL_RESULT:
53+ float fval;
54+ int val;
55 if (args[carg]->field_type() == MYSQL_TYPE_FLOAT)
56- vargs[carg-1]= fmt::detail::make_arg<ctx>((float)args[carg]->val_real());
57- else
58- vargs[carg-1]= fmt::detail::make_arg<ctx>(args[carg]->val_real());
59+ {
60+ fval = (float)args[carg]->val_real();
61+ vargs[carg-1]= fmt::detail::make_arg<ctx>(fval);
62+ } else {
63+ val = args[carg]->val_real();
64+ vargs[carg-1]= fmt::detail::make_arg<ctx>(val);
65+ }
66 break;
67 case STRING_RESULT:
68 if (!(parg= args[carg]->val_str(&val_arg[carg-1])))