From fbdb1c61760da3b3ae40adff6065b171614d1267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Fri, 18 Aug 2023 10:18:01 +0000 Subject: [PATCH 01/34] Initial commit to support dynamic linking in TAP --- .gitignore | 2 + deps/Makefile | 3 +- test/tap/tap/Makefile | 49 +++++++++++++------ .../tap/cpp-dotenv/{ => dynamic}/cpp-dotenv | 0 test/tap/tap/cpp-dotenv/static/cpp-dotenv | 1 + test/tap/tests/Makefile | 31 ++++++------ 6 files changed, 56 insertions(+), 30 deletions(-) rename test/tap/tap/cpp-dotenv/{ => dynamic}/cpp-dotenv (100%) create mode 120000 test/tap/tap/cpp-dotenv/static/cpp-dotenv diff --git a/.gitignore b/.gitignore index 339f9ba764..3647d93615 100644 --- a/.gitignore +++ b/.gitignore @@ -112,6 +112,8 @@ heaptrack.* #tap tests test/tap/tap/cpp-dotenv/cpp-dotenv-* +test/tap/tap/cpp-dotenv/static/cpp-dotenv-* +test/tap/tap/cpp-dotenv/dynamic/cpp-dotenv-* *-t test/tap/tests/galera_1_timeout_count test/tap/tests/galera_2_timeout_no_count diff --git a/deps/Makefile b/deps/Makefile index b6bb58adaa..2259c855fc 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -151,7 +151,8 @@ curl/curl/lib/.libs/libcurl.a: libssl/openssl/libssl.a ifeq ($(UNAME_S),Darwin) cd curl/curl && patch configure < ../configure.patch endif - cd curl/curl && CFLAGS=-fPIC ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-zstd --with-ssl=$(shell pwd)/libssl/openssl/ --enable-shared=no && CC=${CC} CXX=${CXX} ${MAKE} +# cd curl/curl && CFLAGS=-fPIC ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-zstd --with-ssl=$(shell pwd)/libssl/openssl/ --enable-shared=no && CC=${CC} CXX=${CXX} ${MAKE} + cd curl/curl && CFLAGS=-fPIC ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-zstd --with-ssl=$(shell pwd)/libssl/openssl/ --enable-shared=yes && CC=${CC} CXX=${CXX} ${MAKE} curl: curl/curl/lib/.libs/libcurl.a diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 14a006581f..b1299c6cbc 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -14,7 +14,7 @@ SQLITE3_DIR=$(DEPS_PATH)/sqlite3/sqlite3 SQLITE3_IDIR=$(SQLITE3_DIR) SQLITE3_LDIR=$(SQLITE3_DIR) -DOTENV_DIR=./cpp-dotenv/cpp-dotenv +DOTENV_DIR=./cpp-dotenv/static/cpp-dotenv DOTENV_IDIR=$(DOTENV_DIR)/include DOTENV_LDIR=$(DOTENV_DIR) @@ -25,27 +25,46 @@ LIBPROXYSQLAR=$(LDIR)/libproxysql.a INCLUDEDIRS=-I$(IDIR) -I$(JSON_IDIR) -I$(MARIADB_IDIR) -I${CURL_IDIR} -I${SQLITE3_IDIR} -I$(DOTENV_IDIR) .PHONY: all -all: libtap.a +all: libtap.a libtap.so .PHONY: clean clean: - rm -f *.o libtap.a || true - find cpp-dotenv/cpp-dotenv/ -name '*.o' -or -name '*.a' -delete || true + rm -f *.o libtap.a libtap.so || true + find cpp-dotenv/dynamic -name '*.o' -or -name '*.a' -delete || true + find cpp-dotenv/static -name '*.o' -or -name '*.a' -delete || true OPT=-O2 debug: OPT = -O0 -DDEBUG -ggdb -debug: libtap.a +debug: libtap.a libtap.so -libtap.a: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h cpp-dotenv - g++ -c tap.cpp command_line.cpp utils.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) +command_line.o: command_line.cpp + g++ -fPIC -c command_line.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) + +utils.o: utils.cpp + g++ -fPIC -c utils.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) + +tap.o: tap.cpp + g++ -fPIC -c tap.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) + +libtap.a: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a ar rcs libtap.a tap.o command_line.o utils.o $(SQLITE3_LDIR)/sqlite3.o $$(find $(DOTENV_DIR)/ -name '*.o') -cpp-dotenv/cpp-dotenv/libcpp_dotenv.a: - cd cpp-dotenv && rm -rf cpp-dotenv-*/ || true - cd cpp-dotenv && tar -zxf cpp-dotenv-*.tar.gz - cd cpp-dotenv/cpp-dotenv && patch src/dotenv.cpp < ../dotenv.cpp.patch - cd cpp-dotenv/cpp-dotenv && patch include/dotenv.h < ../dotenv.h.patch - cd cpp-dotenv/cpp-dotenv && cmake . -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug - cd cpp-dotenv/cpp-dotenv && CC=${CC} CXX=${CXX} ${MAKE} -cpp-dotenv: cpp-dotenv/cpp-dotenv/libcpp_dotenv.a +libtap.so: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so + g++ -shared -o libtap.so tap.o command_line.o utils.o $(SQLITE3_LDIR)/sqlite3.o + +cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a: + cd cpp-dotenv/static && rm -rf cpp-dotenv-*/ || true + cd cpp-dotenv/static && tar -zxf ../cpp-dotenv-*.tar.gz + cd cpp-dotenv/static/cpp-dotenv && patch src/dotenv.cpp < ../../dotenv.cpp.patch + cd cpp-dotenv/static/cpp-dotenv && patch include/dotenv.h < ../../dotenv.h.patch + cd cpp-dotenv/static/cpp-dotenv && cmake . -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug + cd cpp-dotenv/static/cpp-dotenv && CC=${CC} CXX=${CXX} ${MAKE} + +cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so: + cd cpp-dotenv/dynamic && rm -rf cpp-dotenv-*/ || true + cd cpp-dotenv/dynamic && tar -zxf ../cpp-dotenv-*.tar.gz + cd cpp-dotenv/dynamic/cpp-dotenv && patch src/dotenv.cpp < ../../dotenv.cpp.patch + cd cpp-dotenv/dynamic/cpp-dotenv && patch include/dotenv.h < ../../dotenv.h.patch + cd cpp-dotenv/dynamic/cpp-dotenv && cmake . -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug + cd cpp-dotenv/dynamic/cpp-dotenv && CC=${CC} CXX=${CXX} ${MAKE} diff --git a/test/tap/tap/cpp-dotenv/cpp-dotenv b/test/tap/tap/cpp-dotenv/dynamic/cpp-dotenv similarity index 100% rename from test/tap/tap/cpp-dotenv/cpp-dotenv rename to test/tap/tap/cpp-dotenv/dynamic/cpp-dotenv diff --git a/test/tap/tap/cpp-dotenv/static/cpp-dotenv b/test/tap/tap/cpp-dotenv/static/cpp-dotenv new file mode 120000 index 0000000000..fcdbe8d2c8 --- /dev/null +++ b/test/tap/tap/cpp-dotenv/static/cpp-dotenv @@ -0,0 +1 @@ +cpp-dotenv-1.0.0-alpha \ No newline at end of file diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 4acb9d280c..4ed3c9dc50 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -65,14 +65,14 @@ COREDUMPER_DIR=$(DEPS_PATH)/coredumper/coredumper COREDUMPER_IDIR=$(COREDUMPER_DIR)/include COREDUMPER_LDIR=$(COREDUMPER_DIR)/src -DOTENV_DIR=../tap/cpp-dotenv/cpp-dotenv -DOTENV_IDIR=$(DOTENV_DIR)/include -DOTENV_LDIR=$(DOTENV_DIR) - IDIR=../../../include LDIR=../../../lib TAP_LIBDIR=../tap +DOTENV_DYN_DIR=../tap/cpp-dotenv/dynamic/cpp-dotenv +DOTENV_DYN_IDIR=$(DOTENV_DYN_DIR)/include +DOTENV_DYN_LDIR=$(DOTENV_DYN_DIR) + LIBPROXYSQLAR=$(LDIR)/libproxysql.a ODIR=../../../obj @@ -81,8 +81,8 @@ EXECUTABLE=proxysql OBJ=../../../src/obj/proxysql_global.o ../../../src/obj/main.o ../../../src/obj/proxy_tls.o -INCLUDEDIRS=-I../tap -I$(RE2_PATH) -I$(IDIR) -I$(JEMALLOC_IDIR) -I$(SQLITE3_DIR) -I$(MICROHTTPD_IDIR) -I$(LIBHTTPSERVER_IDIR) -I$(CURL_IDIR) -I$(DAEMONPATH_IDIR) -I$(MARIADB_IDIR) -I$(SSL_IDIR) -I$(JSON_IDIR) -I$(LIBCONFIG_IDIR) -I$(PROMETHEUS_IDIR) -I$(EV_IDIR) -I$(DOTENV_IDIR) -LDIRS=-L$(TAP_LIBDIR) -L$(LDIR) -L$(JEMALLOC_LDIR) $(LIBCONFIG_LDIR) -L$(RE2_PATH)/obj -L$(MARIADB_LDIR) -L$(DAEMONPATH_LDIR) -L$(PCRE_LDIR) -L$(MICROHTTPD_LDIR) -L$(LIBHTTPSERVER_LDIR) -L$(LIBINJECTION_LDIR) -L$(CURL_LDIR) -L$(EV_LDIR) -L$(SSL_LDIR) -L$(PROMETHEUS_LDIR) +INCLUDEDIRS=-I../tap -I$(RE2_PATH) -I$(IDIR) -I$(JEMALLOC_IDIR) -I$(SQLITE3_DIR) -I$(MICROHTTPD_IDIR) -I$(LIBHTTPSERVER_IDIR) -I$(CURL_IDIR) -I$(DAEMONPATH_IDIR) -I$(MARIADB_IDIR) -I$(SSL_IDIR) -I$(JSON_IDIR) -I$(LIBCONFIG_IDIR) -I$(PROMETHEUS_IDIR) -I$(EV_IDIR) -I$(DOTENV_DYN_IDIR) +LDIRS=-L$(TAP_LIBDIR) -L$(DOTENV_DYN_LDIR) -L$(LDIR) -L$(JEMALLOC_LDIR) $(LIBCONFIG_LDIR) -L$(RE2_PATH)/obj -L$(MARIADB_LDIR) -L$(DAEMONPATH_LDIR) -L$(PCRE_LDIR) -L$(MICROHTTPD_LDIR) -L$(LIBHTTPSERVER_LDIR) -L$(LIBINJECTION_LDIR) -L$(CURL_LDIR) -L$(EV_LDIR) -L$(SSL_LDIR) -L$(PROMETHEUS_LDIR) UNAME_S := $(shell uname -s) @@ -90,9 +90,10 @@ ifeq ($(UNAME_S),Linux) LDIRS+= -L$(COREDUMPER_LDIR) endif -MYLIBS=-Wl,--export-dynamic -Wl,-Bstatic -lconfig -lproxysql -ldaemon -lconfig++ -lre2 -lpcrecpp -lpcre -ltap -lmariadbclient -lhttpserver -lmicrohttpd -linjection -lcurl -lssl -lcrypto -lev -lprometheus-cpp-pull -lprometheus-cpp-core -luuid -Wl,-Bdynamic -lgnutls -lpthread -lm -lz -lrt -ldl $(EXTRALINK) +MYLIBS=-Wl,--export-dynamic -Wl,-Bdynamic -lssl -lcrypto -lgnutls -ltap -lcpp_dotenv -lcurl -Wl,-Bstatic -lconfig -lproxysql -ldaemon -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lhttpserver -lmicrohttpd -linjection -lev -lprometheus-cpp-pull -lprometheus-cpp-core -luuid -Wl,-Bdynamic -lpthread -lm -lz -lrt -ldl $(EXTRALINK) MYLIBSJEMALLOC=-Wl,-Bstatic -ljemalloc -STATIC_LIBS= $(SSL_LDIR)/libssl.a $(SSL_LDIR)/libcrypto.a $(CITYHASH_LDIR)/libcityhash.a +STATIC_LIBS= $(CITYHASH_LDIR)/libcityhash.a +#STATIC_LIBS= $(SSL_LDIR)/libssl.a $(SSL_LDIR)/libcrypto.a $(CITYHASH_LDIR)/libcityhash.a LIBCOREDUMPERAR= @@ -150,7 +151,7 @@ py-%: cp $(patsubst py-%,%,$@) $(patsubst py-%.py,%,$@) chmod +x $(patsubst py-%.py,%,$@) -%-t: %-t.cpp $(TAP_LIBDIR)/libtap.a +%-t: %-t.cpp $(TAP_LIBDIR)/libtap.so $(CXX) -std=c++11 $< $(INCLUDEDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(STATIC_LIBS) -o $@ # $(CXX) -std=c++11 $< $(INCLUDEDIRS) $(LDIRS) $(OPT) $(MYLIBS) -lpthread -ldl $(STATIC_LIBS) $(TAP_LIBDIR)/libtap.a -o $@ @@ -207,20 +208,22 @@ reg_test_3504-change_user_libmariadb_helper: reg_test_3504-change_user_helper.cp reg_test_3504-change_user_libmysql_helper: reg_test_3504-change_user_helper.cpp $(CXX) -DLIBMYSQL_HELPER -DDEBUG reg_test_3504-change_user_helper.cpp -I/usr/include/mysql -I$(CURL_IDIR) -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o reg_test_3504-change_user_libmysql_helper -DGITVERSION=\"$(GIT_VERSION)\" +CUSTOMARGS=-DGITVERSION=\"$(GIT_VERSION)\" -I$(CURL_IDIR) -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -Wl,-Bstatic -ltap -Wl,-Bdynamic -lpthread -std=c++11 -lcurl -ldl + test_clickhouse_server_libmysql-t: test_clickhouse_server-t.cpp - $(CXX) -DLIBMYSQL_HELPER -DDEBUG test_clickhouse_server-t.cpp -I/usr/include/mysql -I$(CURL_IDIR) -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o test_clickhouse_server_libmysql-t -DGITVERSION=\"$(GIT_VERSION)\" + $(CXX) -DLIBMYSQL_HELPER -DDEBUG test_clickhouse_server-t.cpp -I/usr/include/mysql $(CUSTOMARGS) -lmysqlclient -o test_clickhouse_server_libmysql-t reg_test_stmt_resultset_err_no_rows_libmysql-t: reg_test_stmt_resultset_err_no_rows-t.cpp - $(CXX) -DLIBMYSQL_HELPER reg_test_stmt_resultset_err_no_rows-t.cpp -I/usr/include/mysql -I$(CURL_IDIR) -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap $(OPT) -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o reg_test_stmt_resultset_err_no_rows_libmysql-t -DGITVERSION=\"$(GIT_VERSION)\" + $(CXX) -DLIBMYSQL_HELPER reg_test_stmt_resultset_err_no_rows-t.cpp -I/usr/include/mysql $(CUSTOMARGS) -lmysqlclient -o reg_test_stmt_resultset_err_no_rows_libmysql-t reg_test_mariadb_stmt_store_result_libmysql-t: reg_test_mariadb_stmt_store_result-t.cpp $(TAP_LIBDIR)/libtap.a - $(CXX) -DLIBMYSQL_HELPER reg_test_mariadb_stmt_store_result-t.cpp -I/usr/include/mysql -I$(CURL_IDIR) -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap $(OPT) -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o reg_test_mariadb_stmt_store_result_libmysql-t -DGITVERSION=\"$(GIT_VERSION)\" + $(CXX) -DLIBMYSQL_HELPER reg_test_mariadb_stmt_store_result-t.cpp -I/usr/include/mysql $(CUSTOMARGS) -lmysqlclient -o reg_test_mariadb_stmt_store_result_libmysql-t reg_test_mariadb_stmt_store_result_async-t: reg_test_mariadb_stmt_store_result-t.cpp $(TAP_LIBDIR)/libtap.a - $(CXX) -DASYNC_API reg_test_mariadb_stmt_store_result-t.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) $(MYLIBS) -lpthread -ldl -std=c++11 -ltap $(STATIC_LIBS) -o reg_test_mariadb_stmt_store_result_async-t -DGITVERSION=\"$(GIT_VERSION)\" + $(CXX) -DASYNC_API reg_test_mariadb_stmt_store_result-t.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) $(MYLIBS) -lpthread -ldl -std=c++11 -ltap $(STATIC_LIBS) -o reg_test_mariadb_stmt_store_result_async-t prepare_statement_err3024_libmysql-t: prepare_statement_err3024-t.cpp $(TAP_LIBDIR)/libtap.a - $(CXX) -DLIBMYSQL_HELPER prepare_statement_err3024-t.cpp -I/usr/include/mysql -I$(CURL_IDIR) -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap $(OPT) -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o prepare_statement_err3024_libmysql-t -DGITVERSION=\"$(GIT_VERSION)\" + $(CXX) -DLIBMYSQL_HELPER prepare_statement_err3024-t.cpp -I/usr/include/mysql $(CUSTOMARGS) -lmysqlclient -o prepare_statement_err3024_libmysql-t prepare_statement_err3024_async-t: prepare_statement_err3024-t.cpp $(TAP_LIBDIR)/libtap.a $(CXX) -DASYNC_API prepare_statement_err3024-t.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) $(MYLIBS) -lpthread -ldl -std=c++11 -ltap $(STATIC_LIBS) -o prepare_statement_err3024_async-t -DGITVERSION=\"$(GIT_VERSION)\" From c2d632457780a931002285f616e4024ac1e54cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Fri, 18 Aug 2023 11:15:29 +0000 Subject: [PATCH 02/34] Move proxysqlTap_find_charset_collate out of utils.cpp proxysqlTap_find_charset_collate() has been moved out of utils.cpp to allow statically linking --- test/tap/tap/utils.cpp | 11 ----------- test/tap/tap/utils.h | 2 ++ .../test_com_reset_connection_com_change_user-t.cpp | 11 +++++++++++ test/tap/tests/test_set_collation-t.cpp | 11 +++++++++++ 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/test/tap/tap/utils.cpp b/test/tap/tap/utils.cpp index 8413260610..f5fc3354c8 100644 --- a/test/tap/tap/utils.cpp +++ b/test/tap/tap/utils.cpp @@ -595,17 +595,6 @@ int wait_for_replication( return result; } -MARIADB_CHARSET_INFO * proxysqlTap_find_charset_collate(const char *collatename) { - MARIADB_CHARSET_INFO *c = (MARIADB_CHARSET_INFO *)mariadb_compiled_charsets; - do { - if (!strcasecmp(c->name, collatename)) { - return c; - } - ++c; - } while (c[0].nr != 0); - return NULL; -} - int create_proxysql_user( MYSQL* proxysql_admin, const string& user, diff --git a/test/tap/tap/utils.h b/test/tap/tap/utils.h index ce0a93fb9e..da13c69e8f 100644 --- a/test/tap/tap/utils.h +++ b/test/tap/tap/utils.h @@ -179,11 +179,13 @@ int wait_for_replication( * NOTE: This is a duplicate of 'proxysql_find_charset_collate' in 'MySQL_Variables.h'. Including * 'MySQL_Variables' is not a easy task due to its interdependeces with other ProxySQL modules. */ +/* #ifdef LIBMYSQL_HELPER MY_CHARSET_INFO * proxysqlTap_find_charset_collate(const char *collatename); #else MARIADB_CHARSET_INFO * proxysqlTap_find_charset_collate(const char *collatename); #endif +*/ /** * @brief Creates the new supplied user in ProxySQL with the provided * attributes. diff --git a/test/tap/tests/test_com_reset_connection_com_change_user-t.cpp b/test/tap/tests/test_com_reset_connection_com_change_user-t.cpp index 913510391d..e02981b2c3 100644 --- a/test/tap/tests/test_com_reset_connection_com_change_user-t.cpp +++ b/test/tap/tests/test_com_reset_connection_com_change_user-t.cpp @@ -40,6 +40,17 @@ const std::vector tracked_variables { "wsrep_sync_wait" }; +MARIADB_CHARSET_INFO * proxysqlTap_find_charset_collate(const char *collatename) { + MARIADB_CHARSET_INFO *c = (MARIADB_CHARSET_INFO *)mariadb_compiled_charsets; + do { + if (!strcasecmp(c->name, collatename)) { + return c; + } + ++c; + } while (c[0].nr != 0); + return NULL; +} + void variable_rows_to_json(MYSQL_RES *result, json& j) { if(!result) return; MYSQL_ROW row; diff --git a/test/tap/tests/test_set_collation-t.cpp b/test/tap/tests/test_set_collation-t.cpp index 090711655e..563f6af61c 100644 --- a/test/tap/tests/test_set_collation-t.cpp +++ b/test/tap/tests/test_set_collation-t.cpp @@ -18,6 +18,17 @@ #define N_ITERATION_2 2 #define N_ITERATION_3 3 +MARIADB_CHARSET_INFO * proxysqlTap_find_charset_collate(const char *collatename) { + MARIADB_CHARSET_INFO *c = (MARIADB_CHARSET_INFO *)mariadb_compiled_charsets; + do { + if (!strcasecmp(c->name, collatename)) { + return c; + } + ++c; + } while (c[0].nr != 0); + return NULL; +} + /** * @brief Creates a different MYSQL connection for each supplied collation. Logs in case of a * failure creating a connection. From 2d258a90a6fe30c5a095829f3b3ed83170d76b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sat, 19 Aug 2023 02:37:35 +0000 Subject: [PATCH 03/34] TAP tests to use installed curl --- deps/Makefile | 3 +-- test/tap/tests/Makefile | 15 ++++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deps/Makefile b/deps/Makefile index 2259c855fc..b6bb58adaa 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -151,8 +151,7 @@ curl/curl/lib/.libs/libcurl.a: libssl/openssl/libssl.a ifeq ($(UNAME_S),Darwin) cd curl/curl && patch configure < ../configure.patch endif -# cd curl/curl && CFLAGS=-fPIC ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-zstd --with-ssl=$(shell pwd)/libssl/openssl/ --enable-shared=no && CC=${CC} CXX=${CXX} ${MAKE} - cd curl/curl && CFLAGS=-fPIC ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-zstd --with-ssl=$(shell pwd)/libssl/openssl/ --enable-shared=yes && CC=${CC} CXX=${CXX} ${MAKE} + cd curl/curl && CFLAGS=-fPIC ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-zstd --with-ssl=$(shell pwd)/libssl/openssl/ --enable-shared=no && CC=${CC} CXX=${CXX} ${MAKE} curl: curl/curl/lib/.libs/libcurl.a diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 4ed3c9dc50..b2aff3b180 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -26,9 +26,10 @@ LIBCONFIG_PATH=$(DEPS_PATH)/libconfig/libconfig LIBCONFIG_IDIR=$(LIBCONFIG_PATH)/lib LIBCONFIG_LDIR=-L$(LIBCONFIG_PATH)/lib/.libs -CURL_DIR=$(DEPS_PATH)/curl/curl -CURL_IDIR=$(CURL_DIR)/include -CURL_LDIR=$(CURL_DIR)/lib/.libs +# Disabling CURL , we will use the OS one +#CURL_DIR=$(DEPS_PATH)/curl/curl +#CURL_IDIR=$(CURL_DIR)/include +#CURL_LDIR=$(CURL_DIR)/lib/.libs DAEMONPATH=$(DEPS_PATH)/libdaemon/libdaemon DAEMONPATH_IDIR=$(DAEMONPATH) @@ -81,8 +82,8 @@ EXECUTABLE=proxysql OBJ=../../../src/obj/proxysql_global.o ../../../src/obj/main.o ../../../src/obj/proxy_tls.o -INCLUDEDIRS=-I../tap -I$(RE2_PATH) -I$(IDIR) -I$(JEMALLOC_IDIR) -I$(SQLITE3_DIR) -I$(MICROHTTPD_IDIR) -I$(LIBHTTPSERVER_IDIR) -I$(CURL_IDIR) -I$(DAEMONPATH_IDIR) -I$(MARIADB_IDIR) -I$(SSL_IDIR) -I$(JSON_IDIR) -I$(LIBCONFIG_IDIR) -I$(PROMETHEUS_IDIR) -I$(EV_IDIR) -I$(DOTENV_DYN_IDIR) -LDIRS=-L$(TAP_LIBDIR) -L$(DOTENV_DYN_LDIR) -L$(LDIR) -L$(JEMALLOC_LDIR) $(LIBCONFIG_LDIR) -L$(RE2_PATH)/obj -L$(MARIADB_LDIR) -L$(DAEMONPATH_LDIR) -L$(PCRE_LDIR) -L$(MICROHTTPD_LDIR) -L$(LIBHTTPSERVER_LDIR) -L$(LIBINJECTION_LDIR) -L$(CURL_LDIR) -L$(EV_LDIR) -L$(SSL_LDIR) -L$(PROMETHEUS_LDIR) +INCLUDEDIRS=-I../tap -I$(RE2_PATH) -I$(IDIR) -I$(JEMALLOC_IDIR) -I$(SQLITE3_DIR) -I$(MICROHTTPD_IDIR) -I$(LIBHTTPSERVER_IDIR) -I$(DAEMONPATH_IDIR) -I$(MARIADB_IDIR) -I$(SSL_IDIR) -I$(JSON_IDIR) -I$(LIBCONFIG_IDIR) -I$(PROMETHEUS_IDIR) -I$(EV_IDIR) -I$(DOTENV_DYN_IDIR) +LDIRS=-L$(TAP_LIBDIR) -L$(DOTENV_DYN_LDIR) -L$(LDIR) -L$(JEMALLOC_LDIR) $(LIBCONFIG_LDIR) -L$(RE2_PATH)/obj -L$(MARIADB_LDIR) -L$(DAEMONPATH_LDIR) -L$(PCRE_LDIR) -L$(MICROHTTPD_LDIR) -L$(LIBHTTPSERVER_LDIR) -L$(LIBINJECTION_LDIR) -L$(EV_LDIR) -L$(SSL_LDIR) -L$(PROMETHEUS_LDIR) UNAME_S := $(shell uname -s) @@ -206,9 +207,9 @@ reg_test_3504-change_user_libmariadb_helper: reg_test_3504-change_user_helper.cp $(CXX) -DDEBUG reg_test_3504-change_user_helper.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) $(MYLIBS) -std=c++11 $(STATIC_LIBS) -o reg_test_3504-change_user_libmariadb_helper -DGITVERSION=\"$(GIT_VERSION)\" reg_test_3504-change_user_libmysql_helper: reg_test_3504-change_user_helper.cpp - $(CXX) -DLIBMYSQL_HELPER -DDEBUG reg_test_3504-change_user_helper.cpp -I/usr/include/mysql -I$(CURL_IDIR) -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o reg_test_3504-change_user_libmysql_helper -DGITVERSION=\"$(GIT_VERSION)\" + $(CXX) -DLIBMYSQL_HELPER -DDEBUG reg_test_3504-change_user_helper.cpp -I/usr/include/mysql -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o reg_test_3504-change_user_libmysql_helper -DGITVERSION=\"$(GIT_VERSION)\" -CUSTOMARGS=-DGITVERSION=\"$(GIT_VERSION)\" -I$(CURL_IDIR) -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -Wl,-Bstatic -ltap -Wl,-Bdynamic -lpthread -std=c++11 -lcurl -ldl +CUSTOMARGS=-DGITVERSION=\"$(GIT_VERSION)\" -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -Wl,-Bstatic -ltap -lcurl -Wl,-Bdynamic -lpthread -std=c++11 -ldl test_clickhouse_server_libmysql-t: test_clickhouse_server-t.cpp $(CXX) -DLIBMYSQL_HELPER -DDEBUG test_clickhouse_server-t.cpp -I/usr/include/mysql $(CUSTOMARGS) -lmysqlclient -o test_clickhouse_server_libmysql-t From 52b82d7a7b1cd26d9bc9a14f784d4325bea20a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sat, 19 Aug 2023 10:42:25 +0700 Subject: [PATCH 04/34] Update Makefile --- test/tap/tap/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index b1299c6cbc..b90bac2893 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -38,13 +38,13 @@ OPT=-O2 debug: OPT = -O0 -DDEBUG -ggdb debug: libtap.a libtap.so -command_line.o: command_line.cpp +command_line.o: command_line.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a g++ -fPIC -c command_line.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) -utils.o: utils.cpp +utils.o: utils.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a g++ -fPIC -c utils.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) -tap.o: tap.cpp +tap.o: tap.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a g++ -fPIC -c tap.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) libtap.a: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a From 00f94a98ba4ce70a3cabb7aa5dec8410f4f44bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 20 Aug 2023 03:55:08 +0000 Subject: [PATCH 05/34] Again statically linking libcurl --- test/tap/tap/Makefile | 12 ++++++------ test/tap/tests/Makefile | 19 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index b1299c6cbc..8091bab9dd 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -38,27 +38,27 @@ OPT=-O2 debug: OPT = -O0 -DDEBUG -ggdb debug: libtap.a libtap.so -command_line.o: command_line.cpp +command_line.o: command_line.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a g++ -fPIC -c command_line.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) -utils.o: utils.cpp +utils.o: utils.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a g++ -fPIC -c utils.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) -tap.o: tap.cpp +tap.o: tap.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a g++ -fPIC -c tap.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) libtap.a: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a - ar rcs libtap.a tap.o command_line.o utils.o $(SQLITE3_LDIR)/sqlite3.o $$(find $(DOTENV_DIR)/ -name '*.o') + ar rcs libtap.a tap.o command_line.o utils.o $(SQLITE3_LDIR)/sqlite3.o libtap.so: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so - g++ -shared -o libtap.so tap.o command_line.o utils.o $(SQLITE3_LDIR)/sqlite3.o + gcc -shared -o libtap.so -Wl,--whole-archive libtap.a ../../../deps/curl/curl/lib/.libs/libcurl.a ../../../deps/libssl/openssl/libcrypto.a ../../../deps/libssl/openssl/libssl.a -Wl,--no-whole-archive cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a: cd cpp-dotenv/static && rm -rf cpp-dotenv-*/ || true cd cpp-dotenv/static && tar -zxf ../cpp-dotenv-*.tar.gz cd cpp-dotenv/static/cpp-dotenv && patch src/dotenv.cpp < ../../dotenv.cpp.patch cd cpp-dotenv/static/cpp-dotenv && patch include/dotenv.h < ../../dotenv.h.patch - cd cpp-dotenv/static/cpp-dotenv && cmake . -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug + cd cpp-dotenv/static/cpp-dotenv && cmake . -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Debug cd cpp-dotenv/static/cpp-dotenv && CC=${CC} CXX=${CXX} ${MAKE} cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so: diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index b2aff3b180..615932b82e 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -26,10 +26,9 @@ LIBCONFIG_PATH=$(DEPS_PATH)/libconfig/libconfig LIBCONFIG_IDIR=$(LIBCONFIG_PATH)/lib LIBCONFIG_LDIR=-L$(LIBCONFIG_PATH)/lib/.libs -# Disabling CURL , we will use the OS one -#CURL_DIR=$(DEPS_PATH)/curl/curl -#CURL_IDIR=$(CURL_DIR)/include -#CURL_LDIR=$(CURL_DIR)/lib/.libs +CURL_DIR=$(DEPS_PATH)/curl/curl +CURL_IDIR=$(CURL_DIR)/include +CURL_LDIR=$(CURL_DIR)/lib/.libs DAEMONPATH=$(DEPS_PATH)/libdaemon/libdaemon DAEMONPATH_IDIR=$(DAEMONPATH) @@ -72,7 +71,8 @@ TAP_LIBDIR=../tap DOTENV_DYN_DIR=../tap/cpp-dotenv/dynamic/cpp-dotenv DOTENV_DYN_IDIR=$(DOTENV_DYN_DIR)/include -DOTENV_DYN_LDIR=$(DOTENV_DYN_DIR) +#DOTENV_DYN_LDIR=$(DOTENV_DYN_DIR) +DOTENV_DYN_LDIR=$(TAP_LIBDIR) LIBPROXYSQLAR=$(LDIR)/libproxysql.a @@ -82,8 +82,8 @@ EXECUTABLE=proxysql OBJ=../../../src/obj/proxysql_global.o ../../../src/obj/main.o ../../../src/obj/proxy_tls.o -INCLUDEDIRS=-I../tap -I$(RE2_PATH) -I$(IDIR) -I$(JEMALLOC_IDIR) -I$(SQLITE3_DIR) -I$(MICROHTTPD_IDIR) -I$(LIBHTTPSERVER_IDIR) -I$(DAEMONPATH_IDIR) -I$(MARIADB_IDIR) -I$(SSL_IDIR) -I$(JSON_IDIR) -I$(LIBCONFIG_IDIR) -I$(PROMETHEUS_IDIR) -I$(EV_IDIR) -I$(DOTENV_DYN_IDIR) -LDIRS=-L$(TAP_LIBDIR) -L$(DOTENV_DYN_LDIR) -L$(LDIR) -L$(JEMALLOC_LDIR) $(LIBCONFIG_LDIR) -L$(RE2_PATH)/obj -L$(MARIADB_LDIR) -L$(DAEMONPATH_LDIR) -L$(PCRE_LDIR) -L$(MICROHTTPD_LDIR) -L$(LIBHTTPSERVER_LDIR) -L$(LIBINJECTION_LDIR) -L$(EV_LDIR) -L$(SSL_LDIR) -L$(PROMETHEUS_LDIR) +INCLUDEDIRS=-I../tap -I$(RE2_PATH) -I$(IDIR) -I$(JEMALLOC_IDIR) -I$(SQLITE3_DIR) -I$(MICROHTTPD_IDIR) -I$(LIBHTTPSERVER_IDIR) -I$(CURL_IDIR) -I$(DAEMONPATH_IDIR) -I$(MARIADB_IDIR) -I$(SSL_IDIR) -I$(JSON_IDIR) -I$(LIBCONFIG_IDIR) -I$(PROMETHEUS_IDIR) -I$(EV_IDIR) -I$(DOTENV_DYN_IDIR) +LDIRS=-L$(TAP_LIBDIR) -L$(DOTENV_DYN_LDIR) -L$(LDIR) -L$(JEMALLOC_LDIR) $(LIBCONFIG_LDIR) -L$(RE2_PATH)/obj -L$(MARIADB_LDIR) -L$(DAEMONPATH_LDIR) -L$(PCRE_LDIR) -L$(MICROHTTPD_LDIR) -L$(LIBHTTPSERVER_LDIR) -L$(LIBINJECTION_LDIR) -L$(CURL_LDIR) -L$(EV_LDIR) -L$(PROMETHEUS_LDIR) UNAME_S := $(shell uname -s) @@ -91,7 +91,8 @@ ifeq ($(UNAME_S),Linux) LDIRS+= -L$(COREDUMPER_LDIR) endif -MYLIBS=-Wl,--export-dynamic -Wl,-Bdynamic -lssl -lcrypto -lgnutls -ltap -lcpp_dotenv -lcurl -Wl,-Bstatic -lconfig -lproxysql -ldaemon -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lhttpserver -lmicrohttpd -linjection -lev -lprometheus-cpp-pull -lprometheus-cpp-core -luuid -Wl,-Bdynamic -lpthread -lm -lz -lrt -ldl $(EXTRALINK) +MYLIBS=-Wl,--export-dynamic -Wl,-Bdynamic -lssl -lcrypto -lgnutls -ltap -lcpp_dotenv -Wl,-Bstatic -lconfig -lproxysql -ldaemon -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lhttpserver -lmicrohttpd -linjection -lcurl -lev -lprometheus-cpp-pull -lprometheus-cpp-core -luuid -Wl,-Bdynamic -lpthread -lm -lz -lrt -ldl $(EXTRALINK) +#MYLIBS=-Wl,--export-dynamic -Wl,-Bdynamic -lssl -lcrypto -lgnutls -ltap -lcpp_dotenv -Wl,-Bstatic -lconfig -lproxysql -ldaemon -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lhttpserver -lmicrohttpd -linjection -lev -lprometheus-cpp-pull -lprometheus-cpp-core -luuid -Wl,-Bdynamic -lpthread -lm -lz -lrt -ldl $(EXTRALINK) MYLIBSJEMALLOC=-Wl,-Bstatic -ljemalloc STATIC_LIBS= $(CITYHASH_LDIR)/libcityhash.a #STATIC_LIBS= $(SSL_LDIR)/libssl.a $(SSL_LDIR)/libcrypto.a $(CITYHASH_LDIR)/libcityhash.a @@ -209,7 +210,7 @@ reg_test_3504-change_user_libmariadb_helper: reg_test_3504-change_user_helper.cp reg_test_3504-change_user_libmysql_helper: reg_test_3504-change_user_helper.cpp $(CXX) -DLIBMYSQL_HELPER -DDEBUG reg_test_3504-change_user_helper.cpp -I/usr/include/mysql -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o reg_test_3504-change_user_libmysql_helper -DGITVERSION=\"$(GIT_VERSION)\" -CUSTOMARGS=-DGITVERSION=\"$(GIT_VERSION)\" -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -Wl,-Bstatic -ltap -lcurl -Wl,-Bdynamic -lpthread -std=c++11 -ldl +CUSTOMARGS=-DGITVERSION=\"$(GIT_VERSION)\" -I$(SQLITE3_DIR) -I$(IDIR) -I$(CURL_IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -L$(CURL_LDIR) -Wl,-Bstatic -lcurl -Wl,-Bdynamic -ltap -lcpp_dotenv -lpthread -std=c++11 -lz -ldl test_clickhouse_server_libmysql-t: test_clickhouse_server-t.cpp $(CXX) -DLIBMYSQL_HELPER -DDEBUG test_clickhouse_server-t.cpp -I/usr/include/mysql $(CUSTOMARGS) -lmysqlclient -o test_clickhouse_server_libmysql-t From 08203c4908a3a83482e2b6165fcffb472274ff9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 20 Aug 2023 04:32:44 +0000 Subject: [PATCH 06/34] Adding symlinks --- test/tap/tap/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 8091bab9dd..464d0a97a4 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -25,7 +25,7 @@ LIBPROXYSQLAR=$(LDIR)/libproxysql.a INCLUDEDIRS=-I$(IDIR) -I$(JSON_IDIR) -I$(MARIADB_IDIR) -I${CURL_IDIR} -I${SQLITE3_IDIR} -I$(DOTENV_IDIR) .PHONY: all -all: libtap.a libtap.so +all: libtap.a libtap.so libssl.so.3 libcrypto.so.3 libcpp_dotenv.so .PHONY: clean clean: @@ -53,6 +53,15 @@ libtap.a: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o libtap.so: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so gcc -shared -o libtap.so -Wl,--whole-archive libtap.a ../../../deps/curl/curl/lib/.libs/libcurl.a ../../../deps/libssl/openssl/libcrypto.a ../../../deps/libssl/openssl/libssl.a -Wl,--no-whole-archive +libssl.so.3: + ln -s $(DEPS_PATH)/libssl/openssl/libssl.so.3 + +libcrypto.so.3: + ln -s $(DEPS_PATH)/libssl/openssl/libcrypto.so.3 + +libcpp_dotenv.so: cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so + ln -s ./cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so . + cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a: cd cpp-dotenv/static && rm -rf cpp-dotenv-*/ || true cd cpp-dotenv/static && tar -zxf ../cpp-dotenv-*.tar.gz From 2c3452f5fe3ffa0e4161815e8d5d9abb51666a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 20 Aug 2023 05:12:31 +0000 Subject: [PATCH 07/34] Update Makefile --- test/tap/tap/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 464d0a97a4..02500aa57b 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -36,7 +36,7 @@ clean: OPT=-O2 debug: OPT = -O0 -DDEBUG -ggdb -debug: libtap.a libtap.so +debug: libtap.a libtap.so libssl.so.3 libcrypto.so.3 libcpp_dotenv.so command_line.o: command_line.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a g++ -fPIC -c command_line.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) From ac878c0248fef7850a7c112351c96040eadf3ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sun, 20 Aug 2023 05:33:07 +0000 Subject: [PATCH 08/34] Update Makefile --- test/tap/tap/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 02500aa57b..bd5bcc1583 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -50,7 +50,7 @@ tap.o: tap.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a libtap.a: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a ar rcs libtap.a tap.o command_line.o utils.o $(SQLITE3_LDIR)/sqlite3.o -libtap.so: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so +libtap.so: libtap.a cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so gcc -shared -o libtap.so -Wl,--whole-archive libtap.a ../../../deps/curl/curl/lib/.libs/libcurl.a ../../../deps/libssl/openssl/libcrypto.a ../../../deps/libssl/openssl/libssl.a -Wl,--no-whole-archive libssl.so.3: From 8c780ac6c9bb352528c35eb374ac664525825f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 22 Aug 2023 08:16:53 +0000 Subject: [PATCH 09/34] More changes to Makefile for TAP dynamic linking --- deps/Makefile | 2 +- test/tap/tap/Makefile | 21 +++++++++------- .../deprecate_eof_support/Makefile | 24 +++++++++++-------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/deps/Makefile b/deps/Makefile index b6bb58adaa..367dbdd499 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -151,7 +151,7 @@ curl/curl/lib/.libs/libcurl.a: libssl/openssl/libssl.a ifeq ($(UNAME_S),Darwin) cd curl/curl && patch configure < ../configure.patch endif - cd curl/curl && CFLAGS=-fPIC ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-zstd --with-ssl=$(shell pwd)/libssl/openssl/ --enable-shared=no && CC=${CC} CXX=${CXX} ${MAKE} + cd curl/curl && CFLAGS=-fPIC ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-zstd --with-ssl=$(shell pwd)/libssl/openssl/ --enable-shared=yes && LD_LIBRARY_PATH=$(shell pwd)/libssl/openssl CC=${CC} CXX=${CXX} ${MAKE} curl: curl/curl/lib/.libs/libcurl.a diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index bd5bcc1583..7d0c9a3503 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -36,15 +36,15 @@ clean: OPT=-O2 debug: OPT = -O0 -DDEBUG -ggdb -debug: libtap.a libtap.so libssl.so.3 libcrypto.so.3 libcpp_dotenv.so +debug: libtap.a libtap.so -command_line.o: command_line.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a +command_line.o: command_line.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a libcurl.so libssl.so.3 libcrypto.so.3 libcpp_dotenv.so g++ -fPIC -c command_line.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) -utils.o: utils.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a +utils.o: utils.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a libcurl.so libssl.so.3 libcrypto.so.3 libcpp_dotenv.so g++ -fPIC -c utils.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) -tap.o: tap.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a +tap.o: tap.cpp cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a libcurl.so libssl.so.3 libcrypto.so.3 libcpp_dotenv.so g++ -fPIC -c tap.cpp -std=c++11 $(INCLUDEDIRS) $(OPT) libtap.a: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o command_line.o utils.o cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a @@ -53,14 +53,17 @@ libtap.a: tap.cpp tap.h command_line.cpp command_line.h utils.cpp utils.h tap.o libtap.so: libtap.a cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so gcc -shared -o libtap.so -Wl,--whole-archive libtap.a ../../../deps/curl/curl/lib/.libs/libcurl.a ../../../deps/libssl/openssl/libcrypto.a ../../../deps/libssl/openssl/libssl.a -Wl,--no-whole-archive -libssl.so.3: - ln -s $(DEPS_PATH)/libssl/openssl/libssl.so.3 +libssl.so.3: $(DEPS_PATH)/libssl/openssl/libssl.so.3 + cp -a $(DEPS_PATH)/libssl/openssl/libssl.so* . -libcrypto.so.3: - ln -s $(DEPS_PATH)/libssl/openssl/libcrypto.so.3 +libcrypto.so.3: $(DEPS_PATH)/libssl/openssl/libcrypto.so.3 + cp -a $(DEPS_PATH)/libssl/openssl/libcrypto.so* . libcpp_dotenv.so: cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so - ln -s ./cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so . + cp -a $< . + +libcurl.so: $(DEPS_PATH)/curl/curl/lib/.libs/libcurl.so + cp -a $(DEPS_PATH)/curl/curl/lib/.libs/libcurl.so* . cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a: cd cpp-dotenv/static && rm -rf cpp-dotenv-*/ || true diff --git a/test/tap/tests_with_deps/deprecate_eof_support/Makefile b/test/tap/tests_with_deps/deprecate_eof_support/Makefile index 6c94014fcb..4db69b67f1 100644 --- a/test/tap/tests_with_deps/deprecate_eof_support/Makefile +++ b/test/tap/tests_with_deps/deprecate_eof_support/Makefile @@ -21,6 +21,7 @@ OPT=-O2 $(WGCOV) -Wl,--no-as-needed debug: OPT=-O0 -DDEBUG -ggdb -Wl,--no-as-needed $(WGCOV) $(WASAN) debug: build_deps tests +LLP=$(shell pwd)/../../tap $(MARIADB_TEST_DEP)/libmariadb/libmariadbclient.a: cd $(MARIADB_BASE_FOLDER) && CC=${CC} CXX=${CXX} ${MAKE} mariadb_client @@ -53,36 +54,39 @@ TESTS_DEPS=$(TAP_LIBDIR)/libtap.a $(MARIADB_TEST_DEP)/libmariadb/libmariadbclien tests: $(patsubst %.cpp,%,$(wildcard *-t.cpp)) fwd_eof_query fwd_eof_ok_query +COMMONARGS1=$(OPT) -std=c++11 -I$(TAP_LIBDIR) -L$(TAP_LIBDIR) -ltap -lcpp_dotenv -Wl,--no-as-needed -lz -ldl -lpthread -DGITVERSION=\"$(GIT_VERSION)\" -DDEBUG -I$(JSON_IDIR) +COMMONARGS=$(COMMONARGS1) $(MYLIBS) + ok_packet_mixed_queries-t: eof_packet_mixed_queries-t.cpp $(TESTS_DEPS) - $(CXX) -DDEBUG eof_packet_mixed_queries-t.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 -I$(TAP_LIBDIR) -L$(TAP_LIBDIR) -ltap $(MYLIBS) -Wl,--no-as-needed -ldl -lpthread -o ok_packet_mixed_queries-t -DGITVERSION=\"$(GIT_VERSION)\" + LD_LIBRARY_PATH=$(LLP) $(CXX) $< $(INCLUDEDIRS) $(LDIRS) $(COMMONARGS) -o $@ -eof_packet_mixed_queries-t: ok_packet_mixed_queries-t $(TESTS_DEPS) - $(CXX) -DNON_EOF_SUPPORT -DDEBUG eof_packet_mixed_queries-t.cpp -std=c++11 -I$(TAP_LIBDIR) -I $(MARIADB_TEST_DEP)/include/ -I$(INCLUDEDIRS) -L$(TAP_LIBDIR) -L$(TAP_DEPS_LIBS) -L$(MARIADB_TEST_DEP)/libmariadb -L$(SSL_LDIR) $(OPT) -ltap $(MYLIBS) -ldl -o eof_packet_mixed_queries-t -DGITVERSION=\"$(GIT_VERSION)\" +eof_packet_mixed_queries-t: eof_packet_mixed_queries-t.cpp ok_packet_mixed_queries-t $(TESTS_DEPS) + LD_LIBRARY_PATH=$(LLP) $(CXX) -DNON_EOF_SUPPORT $< $(INCLUDEDIRS) -I$(MARIADB_TEST_DEP)/include/ -L$(MARIADB_TEST_DEP)/libmariadb $(COMMONARGS) -o $@ fwd_eof_query: fwd_eof_query.cpp $(TESTS_DEPS) - $(CXX) -DNON_EOF_SUPPORT -DDEBUG fwd_eof_query.cpp $(OPT) -std=c++11 -I$(JSON_IDIR) -I$(TAP_LIBDIR) -I$(INCLUDEDIRS) -L$(TAP_LIBDIR) -L$(TAP_DEPS_LIBS) -L$(MARIADB_TEST_DEP)/libmariadb $(MYLIBS) -L$(SSL_LDIR) -ltap -ldl -o fwd_eof_query -DGITVERSION=\"$(GIT_VERSION)\" + LD_LIBRARY_PATH=$(LLP) $(CXX) -DNON_EOF_SUPPORT $< $(INCLUDEDIRS) -L$(MARIADB_TEST_DEP)/libmariadb $(COMMONARGS) -o $@ #fwd_eof_ok_query: fwd_eof_query.cpp $(TESTS_DEPS) # $(CXX) -DDEBUG fwd_eof_query.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 -I$(TAP_LIBDIR) -L$(TAP_LIBDIR) $(MYLIBS) -L$(SSL_LDIR) -ltap -Wl,--no-as-needed -ldl -lpthread -o fwd_eof_ok_query -DGITVERSION=\"$(GIT_VERSION)\" # NOTE: Compilation with 'libmysql' instead of 'libmariadb' client to confirm packet sequence id isn't check by 'libmariadb' fwd_eof_ok_query: fwd_eof_query.cpp $(TAP_LIBDIR)/libtap.a - $(CXX) -DDEBUG fwd_eof_query.cpp $(OPT) -std=c++11 -I$(JSON_IDIR) -I$(TAP_LIBDIR) -I /usr/include/mysql/ -I$(IDIR) -L$(TAP_LIBDIR) -L$(TAP_DEPS_LIBS) -L/usr/lib/x86_64-linux-gnu/ -lmysqlclient -ltap -ldl -o fwd_eof_ok_query -DGITVERSION=\"$(GIT_VERSION)\" + LD_LIBRARY_PATH=$(LLP) $(CXX) $< -I/usr/include/mysql/ -I$(IDIR) -L/usr/lib/x86_64-linux-gnu/ -lmysqlclient $(COMMONARGS1) -o $@ deprecate_eof_cache-t: deprecate_eof_cache-t.cpp $(TESTS_DEPS) - $(CXX) -DDEBUG deprecate_eof_cache-t.cpp $(OPT) -std=c++11 -I$(JSON_IDIR) -I$(TAP_LIBDIR) -I$(INCLUDEDIRS) -L$(TAP_LIBDIR) -L$(TAP_DEPS_LIBS) -L$(MARIADB_TEST_DEP)/libmariadb -L$(SSL_LDIR) -L$(PROXYLDIR) -ltap $(MYLIBS) -lproxysql -ldl -o deprecate_eof_cache-t -DGITVERSION=\"$(GIT_VERSION)\" + LD_LIBRARY_PATH=$(LLP) $(CXX) $^ $(INCLUDEDIRS) -L$(MARIADB_TEST_DEP)/libmariadb -L$(PROXYLDIR) -lproxysql $(COMMONARGS) -o $@ eof_cache_mixed_flags-t: eof_cache_mixed_flags-t.cpp $(TESTS_DEPS) - $(CXX) -DDEBUG eof_cache_mixed_flags-t.cpp $(OPT) -std=c++11 -I$(JSON_IDIR) -I$(TAP_LIBDIR) -I$(INCLUDEDIRS) -L$(TAP_LIBDIR) -L$(TAP_DEPS_LIBS) -L$(MARIADB_TEST_DEP)/libmariadb -L$(SSL_LDIR) -ltap $(MYLIBS) -ldl -o eof_cache_mixed_flags-t -DGITVERSION=\"$(GIT_VERSION)\" + LD_LIBRARY_PATH=$(LLP) $(CXX) $^ $(INCLUDEDIRS) -L$(MARIADB_TEST_DEP)/libmariadb $(COMMONARGS) -o $@ eof_mixed_flags_queries-t: eof_mixed_flags_queries-t.cpp $(TESTS_DEPS) - $(CXX) -DDEBUG eof_mixed_flags_queries-t.cpp $(OPT) -std=c++11 -I$(JSON_IDIR) -I$(TAP_LIBDIR) -I$(INCLUDEDIRS) -L$(TAP_LIBDIR) -L$(TAP_DEPS_LIBS) -L$(MARIADB_TEST_DEP)/libmariadb -L$(SSL_LDIR) -ltap $(MYLIBS) -ldl -o eof_mixed_flags_queries-t -DGITVERSION=\"$(GIT_VERSION)\" + LD_LIBRARY_PATH=$(LLP) $(CXX) $^ $(INCLUDEDIRS) -L$(MARIADB_TEST_DEP)/libmariadb $(COMMONARGS) -o $@ eof_conn_options_check-t: eof_conn_options_check-t.cpp $(TESTS_DEPS) - $(CXX) -DDEBUG eof_conn_options_check-t.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 -I$(TAP_LIBDIR) -L$(TAP_LIBDIR) -L$(TAP_DEPS_LIBS) $(MYLIBS) -ltap -Wl,--no-as-needed -ldl -lpthread -o eof_conn_options_check-t -DGITVERSION=\"$(GIT_VERSION)\" + LD_LIBRARY_PATH=$(LLP) $(CXX) $< $(INCLUDEDIRS) $(LDIRS) $(COMMONARGS) -o $@ eof_fast_forward-t: eof_fast_forward-t.cpp $(TESTS_DEPS) - $(CXX) -DDEBUG eof_fast_forward-t.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 -I$(TAP_LIBDIR) -L$(TAP_LIBDIR) -ltap $(MYLIBS) -Wl,--no-as-needed -ldl -lpthread -o eof_fast_forward-t -DGITVERSION=\"$(GIT_VERSION)\" + LD_LIBRARY_PATH=$(LLP) $(CXX) $< $(INCLUDEDIRS) $(LDIRS) $(COMMONARGS) -o $@ else .PHONY: all From 4574f6d9d0ee310fe8212940242ee674b64582dd Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 24 Aug 2023 14:39:07 +0200 Subject: [PATCH 10/34] Update kill_connection3-t.cpp --- test/tap/tests/kill_connection3-t.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tap/tests/kill_connection3-t.cpp b/test/tap/tests/kill_connection3-t.cpp index e7fd6bc42e..47abd0f649 100644 --- a/test/tap/tests/kill_connection3-t.cpp +++ b/test/tap/tests/kill_connection3-t.cpp @@ -150,7 +150,7 @@ int main(int argc, char** argv) { rc = run_q(proxysql_admin, s.c_str()); ok(rc == 0 , "%s" , s.c_str()); } - sleep(1); + sleep(3); for (int i = 0; i < NUM_CONNS ; i++) { MYSQL * mysql = conns[i]; int rc = run_q(mysql, "DO 1"); @@ -191,7 +191,7 @@ int main(int argc, char** argv) { rc = run_q(proxysql_admin, s.c_str()); ok(rc == 0 , "%s" , s.c_str()); } - + sleep(3); for (int i = 0; i < NUM_CONNS ; i++) { MYSQL * mysql = conns[i]; int rc = run_q(mysql, "DO 1"); From 4b20b74b5c93ed729c91aa2fafd2346172463004 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 24 Aug 2023 15:34:16 +0200 Subject: [PATCH 11/34] Update mysql-test_ssl_CA-t.cpp --- test/tap/tests/mysql-test_ssl_CA-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/mysql-test_ssl_CA-t.cpp b/test/tap/tests/mysql-test_ssl_CA-t.cpp index 27cb3d140f..7ded1443e9 100644 --- a/test/tap/tests/mysql-test_ssl_CA-t.cpp +++ b/test/tap/tests/mysql-test_ssl_CA-t.cpp @@ -84,7 +84,7 @@ int main(int argc, char** argv) { { // const char *q = "SELECT DISTINCT hostgroup_id FROM runtime_mysql_servers WHERE status='ONLINE' AND hostgroup_id IN (0,1,10,11,20,30,31,50,60,1710,1711)"; - const char *q = "SELECT DISTINCT hostgroup_id FROM runtime_mysql_servers WHERE status='ONLINE'"; + const char *q = "SELECT DISTINCT hostgroup_id FROM runtime_mysql_servers WHERE status='ONLINE' AND comment LIKE '%mysql%'"; diag("Running query: %s", q); MYSQL_QUERY(mysqladmin, q); res = mysql_store_result(mysqladmin); From 7a9678eb57e60478efa7bf5431345b16e2b16146 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 24 Aug 2023 17:52:19 +0200 Subject: [PATCH 12/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 4abaedf4b0..2db54143cd 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 10.0; +const double MAX_ALLOWED_CPU_USAGE = 12.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage @@ -69,8 +69,8 @@ int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms return idle_err; } - conn_opts_t proxy_conns_opts { "127.0.0.1", cl.username, cl.password, cl.port, mode }; - conn_opts_t admin_conns_opts { "127.0.0.1", cl.admin_username, cl.admin_password, cl.admin_port, mode }; + conn_opts_t proxy_conns_opts { cl.host, cl.username, cl.password, cl.port, mode }; + conn_opts_t admin_conns_opts { cl.admin_host, cl.admin_username, cl.admin_password, cl.admin_port, mode }; // Create 'N' admin and mysql connections without SSL vector v_admin_conns {}; From e2bdae6431944a4a65b715b8b8e4e51c732db252 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 24 Aug 2023 18:43:41 +0200 Subject: [PATCH 13/34] Update test_clickhouse_server-t.cpp --- test/tap/tests/test_clickhouse_server-t.cpp | 23 +++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/tap/tests/test_clickhouse_server-t.cpp b/test/tap/tests/test_clickhouse_server-t.cpp index 1da8d98b5f..1fe6a08665 100644 --- a/test/tap/tests/test_clickhouse_server-t.cpp +++ b/test/tap/tests/test_clickhouse_server-t.cpp @@ -51,9 +51,17 @@ std::vector> credentials = { {"cliuser4", "clipass4"} }; +int set_clickhouse_host(MYSQL *pa, const char *h) { + std::string query = "SET clickhouse-host=" + std::string(h); + diag("Line: %d . Setting clickhouse-host to '%s'", __LINE__ , h); + MYSQL_QUERY(pa, query.c_str()); + MYSQL_QUERY(pa, "LOAD CLICKHOUSE VARIABLES TO RUNTIME"); + return 0; +} + int set_clickhouse_port(MYSQL *pa, int p) { std::string query = "SET clickhouse-port=" + std::to_string(p); - diag("Line: %d . Setting clickhouse-port to %d", __LINE__ , p); + diag("Line: %d . Setting clickhouse-port to '%d'", __LINE__ , p); MYSQL_QUERY(pa, query.c_str()); MYSQL_QUERY(pa, "LOAD CLICKHOUSE VARIABLES TO RUNTIME"); return 0; @@ -403,10 +411,17 @@ int main(int argc, char** argv) { goto cleanup; } - set_clickhouse_port(proxysql_admin,8000); + set_clickhouse_port(proxysql_admin, 8000); test_crash(host_port.first.c_str(), host_port.second); - set_clickhouse_port(proxysql_admin,19000); -// set_clickhouse_port(proxysql_admin,9000); + + const std::string docker_mode = getenv("DOCKER_MODE"); + if (docker_mode.find("dns") == docker_mode.size() - 3) { + set_clickhouse_host(proxysql_admin, "clickhouse"); + set_clickhouse_port(proxysql_admin, 9000); + } else { + set_clickhouse_host(proxysql_admin, "127.0.0.1"); + set_clickhouse_port(proxysql_admin, 19000); + } MYSQL* proxysql_clickhouse = mysql_init(NULL); From 9d31ad629c01f6c7d950365d08b4ba3f77ff5588 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 24 Aug 2023 19:25:39 +0200 Subject: [PATCH 14/34] Update test_query_rules_fast_routing_algorithm-t.cpp --- test/tap/tests/test_query_rules_fast_routing_algorithm-t.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tap/tests/test_query_rules_fast_routing_algorithm-t.cpp b/test/tap/tests/test_query_rules_fast_routing_algorithm-t.cpp index 8d6b3893f2..b0171f9c37 100644 --- a/test/tap/tests/test_query_rules_fast_routing_algorithm-t.cpp +++ b/test/tap/tests/test_query_rules_fast_routing_algorithm-t.cpp @@ -246,7 +246,7 @@ int test_fast_routing_algorithm( if (c_err) { return EXIT_FAILURE; } MYSQL_QUERY_T(admin, "LOAD MYSQL QUERY RULES TO RUNTIME"); - usleep(100*1000); + usleep(1000*1000); // Seek end of file for error log errlog.seekg(0, std::ios::end); @@ -289,7 +289,7 @@ int test_fast_routing_algorithm( MYSQL_QUERY_T(admin, ("SET mysql-query_rules_fast_routing_algorithm=" + std::to_string(new_algo)).c_str()); MYSQL_QUERY_T(admin, "LOAD MYSQL VARIABLES TO RUNTIME"); - usleep(100*1000); + usleep(1000*1000); // Seek end of file for error log errlog.seekg(0, std::ios::end); From 0546f74aa083c5795d839ba1c9dceb6d67d7482e Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 25 Aug 2023 08:27:19 +0200 Subject: [PATCH 15/34] Update kill_connection3-t.cpp --- test/tap/tests/kill_connection3-t.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tap/tests/kill_connection3-t.cpp b/test/tap/tests/kill_connection3-t.cpp index 47abd0f649..3fd31bf98a 100644 --- a/test/tap/tests/kill_connection3-t.cpp +++ b/test/tap/tests/kill_connection3-t.cpp @@ -150,7 +150,7 @@ int main(int argc, char** argv) { rc = run_q(proxysql_admin, s.c_str()); ok(rc == 0 , "%s" , s.c_str()); } - sleep(3); + sleep(1); for (int i = 0; i < NUM_CONNS ; i++) { MYSQL * mysql = conns[i]; int rc = run_q(mysql, "DO 1"); @@ -191,7 +191,7 @@ int main(int argc, char** argv) { rc = run_q(proxysql_admin, s.c_str()); ok(rc == 0 , "%s" , s.c_str()); } - sleep(3); + sleep(1); for (int i = 0; i < NUM_CONNS ; i++) { MYSQL * mysql = conns[i]; int rc = run_q(mysql, "DO 1"); From fdaca409ac130fe17affd814d4a2dff75311c7bc Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 25 Aug 2023 09:39:19 +0200 Subject: [PATCH 16/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 2db54143cd..6677bb8b90 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 12.0; +const double MAX_ALLOWED_CPU_USAGE = 11.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From 0b3015d2e77eb149306148ea7d17d86b1e523456 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 25 Aug 2023 10:10:43 +0200 Subject: [PATCH 17/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 6677bb8b90..2db54143cd 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 11.0; +const double MAX_ALLOWED_CPU_USAGE = 12.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From 7eb2a0baf533e09f002854d315d582df660075f8 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 25 Aug 2023 10:48:03 +0200 Subject: [PATCH 18/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 2db54143cd..6677bb8b90 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 12.0; +const double MAX_ALLOWED_CPU_USAGE = 11.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From d104d672d4592ce505a23f6222550d96ec0bc064 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 25 Aug 2023 13:07:19 +0200 Subject: [PATCH 19/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 6677bb8b90..2db54143cd 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 11.0; +const double MAX_ALLOWED_CPU_USAGE = 12.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From 3e371a9c5e4444eac2f0f6f474ca07ca33d35504 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 25 Aug 2023 13:53:13 +0200 Subject: [PATCH 20/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 2db54143cd..6677bb8b90 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 12.0; +const double MAX_ALLOWED_CPU_USAGE = 11.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From 0e80aab27e4533484c418ceb2f0d1e27b9605577 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 25 Aug 2023 14:43:15 +0200 Subject: [PATCH 21/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 6677bb8b90..2db54143cd 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 11.0; +const double MAX_ALLOWED_CPU_USAGE = 12.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From 807d7b39d7231f22e4b2802910124ec463e64bf6 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Fri, 25 Aug 2023 15:28:44 +0200 Subject: [PATCH 22/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 2db54143cd..6677bb8b90 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 12.0; +const double MAX_ALLOWED_CPU_USAGE = 11.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From d4984dab1bda0fb8d56cb035f06f5e005c66045d Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Sat, 26 Aug 2023 09:07:23 +0200 Subject: [PATCH 23/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 6677bb8b90..2db54143cd 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 11.0; +const double MAX_ALLOWED_CPU_USAGE = 12.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From ed8a897ee6f93493d65256e789a5468b7fab7b78 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Sat, 26 Aug 2023 09:53:52 +0200 Subject: [PATCH 24/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 2db54143cd..6677bb8b90 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 12.0; +const double MAX_ALLOWED_CPU_USAGE = 11.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From b3e0b7177d1a0a68714cfdbf7207b1e18cc0a3b4 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Mon, 28 Aug 2023 09:49:35 +0200 Subject: [PATCH 25/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 6677bb8b90..2db54143cd 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 11.0; +const double MAX_ALLOWED_CPU_USAGE = 12.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From b1f1bc37992b777ba16b3883cd1aa59413bd54d8 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Mon, 28 Aug 2023 11:05:24 +0200 Subject: [PATCH 26/34] Update Makefile --- test/tap/tap/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 7d0c9a3503..4b9923f89f 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -60,7 +60,8 @@ libcrypto.so.3: $(DEPS_PATH)/libssl/openssl/libcrypto.so.3 cp -a $(DEPS_PATH)/libssl/openssl/libcrypto.so* . libcpp_dotenv.so: cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so - cp -a $< . +# cp -a $< . + find cpp-dotenv/dynamic/cpp-dotenv/ -name '*.so' -exec cp -a {} . \; libcurl.so: $(DEPS_PATH)/curl/curl/lib/.libs/libcurl.so cp -a $(DEPS_PATH)/curl/curl/lib/.libs/libcurl.so* . From 714b79516b7f507ab6c13f7bae928f906219c10e Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Mon, 28 Aug 2023 21:00:11 +0200 Subject: [PATCH 27/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 2db54143cd..6677bb8b90 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 12.0; +const double MAX_ALLOWED_CPU_USAGE = 11.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From a8992f64462f7dcc171da2398e6c41d3e53b6bf2 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Mon, 28 Aug 2023 21:28:38 +0200 Subject: [PATCH 28/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 6677bb8b90..2db54143cd 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 11.0; +const double MAX_ALLOWED_CPU_USAGE = 12.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From 6fa38808590c726618e2781f1fc462b1476f6376 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 29 Aug 2023 09:45:08 +0200 Subject: [PATCH 29/34] Update Makefile --- test/tap/tap/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 4b9923f89f..1858a60f66 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -60,7 +60,6 @@ libcrypto.so.3: $(DEPS_PATH)/libssl/openssl/libcrypto.so.3 cp -a $(DEPS_PATH)/libssl/openssl/libcrypto.so* . libcpp_dotenv.so: cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so -# cp -a $< . find cpp-dotenv/dynamic/cpp-dotenv/ -name '*.so' -exec cp -a {} . \; libcurl.so: $(DEPS_PATH)/curl/curl/lib/.libs/libcurl.so From dddecea387801589eb6a871acdcf0598544ebb3e Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 29 Aug 2023 16:01:15 +0200 Subject: [PATCH 30/34] Update reg_test_3765_ssl_pollout-t.cpp --- test/tap/tests/reg_test_3765_ssl_pollout-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp index 2db54143cd..7570c4642e 100644 --- a/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp +++ b/test/tap/tests/reg_test_3765_ssl_pollout-t.cpp @@ -59,7 +59,7 @@ int create_connections(const conn_opts_t& conn_opts, uint32_t cons_num, std::vec const uint32_t ADMIN_CONN_NUM = 100; const uint32_t MYSQL_CONN_NUM = 100; const uint32_t REPORT_INTV_SEC = 5; -const double MAX_ALLOWED_CPU_USAGE = 12.0; +const double MAX_ALLOWED_CPU_USAGE = 13.0; int get_idle_conns_cpu_usage(CommandLine& cl, uint64_t mode, double& idle_cpu_ms, double& final_cpu_ms) { // get ProxySQL idle cpu usage From c4d35322cb35c9f2174973d13df2c44956e3ef1e Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 29 Aug 2023 17:27:58 +0200 Subject: [PATCH 31/34] Update .env --- test/tap/tests/.env | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/tap/tests/.env b/test/tap/tests/.env index fd1d9d2e82..3e4e264904 100644 --- a/test/tap/tests/.env +++ b/test/tap/tests/.env @@ -1,5 +1,7 @@ TAP_ENV_VAR1=.env +# suppress env load messages +TAP_QUIET_ENVLOAD=1 # override the default for this PR TAP_USERNAME=testuser TAP_PASSWORD=testuser From c9c1cffc28a84dbc29d38c1fe22beebd5bdd5d80 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 29 Aug 2023 21:15:16 +0200 Subject: [PATCH 32/34] Update test_backend_conn_ping-t.cpp --- test/tap/tests/test_backend_conn_ping-t.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/test/tap/tests/test_backend_conn_ping-t.cpp b/test/tap/tests/test_backend_conn_ping-t.cpp index 2eae63d0b1..6ef3abed5f 100644 --- a/test/tap/tests/test_backend_conn_ping-t.cpp +++ b/test/tap/tests/test_backend_conn_ping-t.cpp @@ -297,7 +297,6 @@ int check_backend_conns( " AND schema='backend_conn_ping_test'" " AND srv_port IN (" + srv_ports + ")" }; - q_res = get_query_result(admin, proxy_query, act_proxy_free_conn_count); if (q_res != EXIT_SUCCESS) { fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, "get_query_result() failed"); From 049bb28a805bfd2ece6b80b2bd503d33465e6d89 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Wed, 30 Aug 2023 08:59:46 +0200 Subject: [PATCH 33/34] Update test_backend_conn_ping-t.cpp --- test/tap/tests/test_backend_conn_ping-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/test_backend_conn_ping-t.cpp b/test/tap/tests/test_backend_conn_ping-t.cpp index 6ef3abed5f..85ef21b165 100644 --- a/test/tap/tests/test_backend_conn_ping-t.cpp +++ b/test/tap/tests/test_backend_conn_ping-t.cpp @@ -254,7 +254,7 @@ int check_backend_conns( uint64_t act_proxy_used_conn_count = 0; uint32_t total_wait_time = 40; - uint32_t intv = 5; + uint32_t intv = 10; uint32_t total_checks = total_wait_time / intv; for (uint32_t check_num = 0; check_num < total_checks; check_num++) { From 41083485596e2f001ffb00858543170258861037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Wed, 30 Aug 2023 08:53:33 +0000 Subject: [PATCH 34/34] Update on TAP Makefile --- test/tap/tests/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 615932b82e..d401704d2d 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -204,13 +204,13 @@ setparser_test3-t: setparser_test3 setparser_test3: setparser_test3.cpp $(TAP_LIBDIR)/libtap.a $(LDIR)/set_parser.cpp setparser_test_common.h $(LIBCOREDUMPERAR) g++ -DDEBUG -DPARSERDEBUG setparser_test3.cpp $(LDIR)/set_parser.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) -std=c++11 $(MYLIBS) $(WASAN) $(LIBCOREDUMPERAR) -o setparser_test3 -DGITVERSION=\"$(GIT_VERSION)\" -reg_test_3504-change_user_libmariadb_helper: reg_test_3504-change_user_helper.cpp +CUSTOMARGS=-DGITVERSION=\"$(GIT_VERSION)\" -I$(SQLITE3_DIR) -I$(IDIR) -I$(CURL_IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -L$(CURL_LDIR) -Wl,-Bstatic -lcurl -Wl,-Bdynamic -ltap -lcpp_dotenv -lpthread -std=c++11 -lz -ldl + +reg_test_3504-change_user_libmariadb_helper: reg_test_3504-change_user_helper.cpp $(TAP_LIBDIR)/libtap.so $(CXX) -DDEBUG reg_test_3504-change_user_helper.cpp $(INCLUDEDIRS) $(LDIRS) $(OPT) $(MYLIBS) -std=c++11 $(STATIC_LIBS) -o reg_test_3504-change_user_libmariadb_helper -DGITVERSION=\"$(GIT_VERSION)\" reg_test_3504-change_user_libmysql_helper: reg_test_3504-change_user_helper.cpp - $(CXX) -DLIBMYSQL_HELPER -DDEBUG reg_test_3504-change_user_helper.cpp -I/usr/include/mysql -I$(SQLITE3_DIR) -I$(IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -lpthread -ldl -std=c++11 -ltap -lmysqlclient -o reg_test_3504-change_user_libmysql_helper -DGITVERSION=\"$(GIT_VERSION)\" - -CUSTOMARGS=-DGITVERSION=\"$(GIT_VERSION)\" -I$(SQLITE3_DIR) -I$(IDIR) -I$(CURL_IDIR) -I$(JSON_IDIR) -I../tap -L$(TAP_LIBDIR) -L$(CURL_LDIR) -Wl,-Bstatic -lcurl -Wl,-Bdynamic -ltap -lcpp_dotenv -lpthread -std=c++11 -lz -ldl + $(CXX) -DLIBMYSQL_HELPER reg_test_3504-change_user_helper.cpp -I/usr/include/mysql $(CUSTOMARGS) -lmysqlclient -o reg_test_3504-change_user_libmysql_helper test_clickhouse_server_libmysql-t: test_clickhouse_server-t.cpp $(CXX) -DLIBMYSQL_HELPER -DDEBUG test_clickhouse_server-t.cpp -I/usr/include/mysql $(CUSTOMARGS) -lmysqlclient -o test_clickhouse_server_libmysql-t