diff --git a/proxysql-gcc11.patch b/proxysql-gcc11.patch index dfeb25c..afa8707 100644 --- a/proxysql-gcc11.patch +++ b/proxysql-gcc11.patch @@ -1,16 +1,29 @@ +This patch fixes compatibility with gcc compiler by: + +* Replacing "swap" in mariadb library with my_swap to avoid conflict with C++ standard headers +* Adding necessary, missing headers for histogram.cc file + +This changes should be included in upstream. Tracking for them needs to be resolved in future. + +Update 8/2021 +* Add missing includes to histogram.cc file. + prometheus-cpp version used by proxysql is quite old and fixes + from upstream are yet not present is this version. + This part of the patch should be removed when prometheus-cpp library is updated. + diff --git a/deps/Makefile b/deps/Makefile index 6f049c8..6b0b6ea 100644 --- a/deps/Makefile +++ b/deps/Makefile -@@ -119,6 +119,8 @@ mariadb-client-library/mariadb_client/libmariadb/libmariadbclient.a: +@@ -149,6 +149,8 @@ # cd mariadb-client-library/mariadb_client && patch libmariadb/ma_pvio.c < ../ma_pvio.c.patch cd mariadb-client-library/mariadb_client && patch unittest/libmariadb/basic-t.c < ../unittest_basic-t.c.patch cd mariadb-client-library/mariadb_client && patch unittest/libmariadb/charset.c < ../unittest_charset.c.patch + cd mariadb-client-library/mariadb_client && patch include/ma_global.h < ../ma_global.h.patch + cd mariadb-client-library/mariadb_client && patch libmariadb/ma_compress.c < ../ma_compress.c.patch - cd mariadb-client-library/mariadb_client && CC=${CC} CXX=${CXX} ${MAKE} mariadbclient - # cd mariadb-client-library/mariadb_client/include && make my_config.h - + cd mariadb-client-library/mariadb_client && patch -p0 < ../client_deprecate_eof.patch + cd mariadb-client-library/mariadb_client && patch -p0 < ../cr_new_stmt_metadata_removal.patch + cd mariadb-client-library/mariadb_client && patch -p0 < ../ps_buffer_stmt_read_all_rows.patch diff --git a/deps/mariadb-client-library/ma_compress.c.patch b/deps/mariadb-client-library/ma_compress.c.patch new file mode 100644 index 0000000..a50c412 @@ -30,22 +43,31 @@ index 0000000..a50c412 + return compbuf; + } + -diff --git a/deps/mariadb-client-library/ma_global.h.patch b/deps/mariadb-client-library/ma_global.h.patch -new file mode 100644 -index 0000000..e0d14b2 ---- /dev/null -+++ b/deps/mariadb-client-library/ma_global.h.patch -@@ -0,0 +1,13 @@ -+diff --git a/include/ma_global.h b/include/ma_global.h -+index d1fec39..3d476bb 100644 -+--- a/include/ma_global.h -++++ b/include/ma_global.h -+@@ -272,7 +272,7 @@ typedef unsigned short ushort; +--- /dev/null 2021-08-09 01:14:50.972746909 +0000 ++++ b/deps/mariadb-client-library/ma_global.h.patch 2021-08-10 11:41:37.210999217 +0000 +@@ -0,0 +1,11 @@ ++--- ma_global.h 2020-06-18 15:16:18.000000000 +0000 +++++ ma_global.h 2021-08-10 11:39:55.603901813 +0000 ++@@ -272,7 +272,7 @@ + #endif + + #define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0) -+-#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; } -++#define my_swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; } ++-#define swap(t,a,b) do{register t dummy; dummy = a; a = b; b = dummy;}while(0) +++#define my_swap(t,a,b) do{register t dummy; dummy = a; a = b; b = dummy;}while(0) + #define test(a) ((a) ? 1 : 0) -+ #define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); } -+ #define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); } ++ #define set_if_bigger(a,b) do{ if ((a) < (b)) (a)=(b); }while(0) ++ #define set_if_smaller(a,b) do{ if ((a) > (b)) (a)=(b); }while(0) +--- /dev/null 2021-08-09 01:14:50.972746909 +0000 ++++ b/deps/prometheus-cpp/histogram.cc.patch 2021-08-10 14:16:20.496146369 +0000 +@@ -0,0 +1,11 @@ ++--- a/core/src/histogram.cc 2020-02-11 18:07:45.000000000 +0000 +++++ b/core/src/histogram.cc 2021-08-10 14:14:16.744004996 +0000 ++@@ -5,6 +5,8 @@ ++ #include ++ #include ++ #include +++#include +++#include ++ ++ namespace prometheus { ++