diff --git a/.gitignore b/.gitignore index 59fa167ac1..a047d63ea8 100644 --- a/.gitignore +++ b/.gitignore @@ -112,7 +112,7 @@ heaptrack.* # test deps test/deps/mariadb-connector-c/mariadb-connector-c-*/ -test/deps/mysql-connector-c/mysql-connector-c-*src/ +test/deps/mysql-connector-c/mysql-5.7.*/ #tap tests test/tap/tap/cpp-dotenv/cpp-dotenv-* diff --git a/test/deps/Makefile b/test/deps/Makefile index 188f37fe58..7af9027813 100644 --- a/test/deps/Makefile +++ b/test/deps/Makefile @@ -20,13 +20,23 @@ mariadb-connector-c/mariadb-connector-c/libmariadb/libmariadbclient.a: mariadb_client: mariadb-connector-c/mariadb-connector-c/libmariadb/libmariadbclient.a +#mysql-connector-c/mysql-connector-c/libmysql/libmysqlclient.a: +# cd mysql-connector-c && rm -rf mysql-connector-c-*-src/ || true +# cd mysql-connector-c && tar -zxf mysql-connector-c-*-src.tar.gz +# cd mysql-connector-c/mysql-connector-c && patch -p0 < ../CMakeLists.txt.patch +# cd mysql-connector-c/mysql-connector-c && patch -p0 < ../install_macros.cmake.patch +# cd mysql-connector-c/mysql-connector-c && cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENSSL_ROOT_DIR=$(DEPS_PATH)/libssl/openssl +# cd mysql-connector-c/mysql-connector-c && CC=${CC} CXX=${CXX} ${MAKE} mysqlclient mysql + mysql-connector-c/mysql-connector-c/libmysql/libmysqlclient.a: - cd mysql-connector-c && rm -rf mysql-connector-c-*-src/ || true - cd mysql-connector-c && tar -zxf mysql-connector-c-*-src.tar.gz - cd mysql-connector-c/mysql-connector-c && patch -p0 < ../CMakeLists.txt.patch - cd mysql-connector-c/mysql-connector-c && patch -p0 < ../install_macros.cmake.patch - cd mysql-connector-c/mysql-connector-c && cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENSSL_ROOT_DIR=$(DEPS_PATH)/libssl/openssl - cd mysql-connector-c/mysql-connector-c && CC=${CC} CXX=${CXX} ${MAKE} mysqlclient + cd mysql-connector-c && rm -rf mysql-*/ || true + cd mysql-connector-c && tar -zxf mysql-boost-5.7.*.tar.gz + cd mysql-connector-c && ln -fsT $$(ls -1d mysql-5.7.*/) mysql-connector-c +# cd mysql-connector-c/mysql-connector-c && patch -p0 < ../CMakeLists.txt.patch +# cd mysql-connector-c/mysql-connector-c && patch -p0 < ../install_macros.cmake.patch + cd mysql-connector-c/mysql-connector-c && cmake . -DWITH_BOOST=./boost -DCMAKE_BUILD_TYPE=RelWithDebInfo -DOPENSSL_ROOT_DIR=$(DEPS_PATH)/libssl/openssl + cd mysql-connector-c/mysql-connector-c && CC=${CC} CXX=${CXX} ${MAKE} mysqlclient mysql + cd mysql-connector-c/mysql-connector-c && cp archive_output_directory/libmysqlclient.a libmysql/ mysql_client: mysql-connector-c/mysql-connector-c/libmysql/libmysqlclient.a @@ -37,7 +47,7 @@ mysql_client: mysql-connector-c/mysql-connector-c/libmysql/libmysqlclient.a .PHONY: cleanall cleanall: cd mariadb-connector-c && rm -rf mariadb-connector-c-*/ || true - cd mysql-connector-c && rm -rf mysql-connector-c-*-src/ || true + cd mysql-connector-c && rm -rf mysql-5.7.*/ || true .SILENT: clean .PHONY: clean diff --git a/test/deps/mysql-5.7.44.tar.gz b/test/deps/mysql-5.7.44.tar.gz new file mode 100644 index 0000000000..811db7eb66 Binary files /dev/null and b/test/deps/mysql-5.7.44.tar.gz differ diff --git a/test/deps/mysql-connector-c/mysql-connector-c b/test/deps/mysql-connector-c/mysql-connector-c index 22d58ed556..7b32ab211a 120000 --- a/test/deps/mysql-connector-c/mysql-connector-c +++ b/test/deps/mysql-connector-c/mysql-connector-c @@ -1 +1 @@ -mysql-connector-c-6.1.11-src \ No newline at end of file +mysql-5.7.44/ \ No newline at end of file diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 999a1822fc..155f7bb84f 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -95,6 +95,7 @@ TEST_MARIADB_LDIR := $(TEST_MARIADB_PATH)/libmariadb TEST_MYSQL_PATH := $(TEST_DEPS_PATH)/mysql-connector-c/mysql-connector-c TEST_MYSQL_IDIR := $(TEST_MYSQL_PATH)/include +TEST_MYSQL_EDIR := $(TEST_MYSQL_PATH)/libbinlogevents/export/ TEST_MYSQL_LDIR := $(TEST_MYSQL_PATH)/libmysql LIBPROXYSQLAR := $(PROXYSQL_LDIR)/libproxysql.a @@ -266,22 +267,22 @@ reg_test_3504-change_user_libmariadb_helper: reg_test_3504-change_user_helper.cp $(CXX) $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(STATIC_LIBS) -o $@ reg_test_3504-change_user_libmysql_helper: reg_test_3504-change_user_helper.cpp $(TAP_LDIR)/libtap.so - $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ + $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -I$(TEST_MYSQL_EDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ test_clickhouse_server_libmysql-t: test_clickhouse_server-t.cpp $(TAP_LDIR)/libtap.so - $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ + $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -I$(TEST_MYSQL_EDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ reg_test_stmt_resultset_err_no_rows_libmysql-t: reg_test_stmt_resultset_err_no_rows-t.cpp $(TAP_LDIR)/libtap.so - $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ + $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -I$(TEST_MYSQL_EDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ reg_test_mariadb_stmt_store_result_libmysql-t: reg_test_mariadb_stmt_store_result-t.cpp $(TAP_LDIR)/libtap.so - $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ + $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -I$(TEST_MYSQL_EDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ reg_test_mariadb_stmt_store_result_async-t: reg_test_mariadb_stmt_store_result-t.cpp $(TAP_LDIR)/libtap.so $(CXX) -DASYNC_API $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(STATIC_LIBS) -o $@ prepare_statement_err3024_libmysql-t: prepare_statement_err3024-t.cpp $(TAP_LDIR)/libtap.so - $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ + $(CXX) -DLIBMYSQL_HELPER $< -I$(TEST_MYSQL_IDIR) -I$(TEST_MYSQL_EDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(CUSTOMARGS) -o $@ prepare_statement_err3024_async-t: prepare_statement_err3024-t.cpp $(TAP_LDIR)/libtap.so $(CXX) -DASYNC_API $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(STATIC_LIBS) -o $@ diff --git a/test/tap/tests_with_deps/deprecate_eof_support/Makefile b/test/tap/tests_with_deps/deprecate_eof_support/Makefile index 13138a1360..57f15aef2c 100644 --- a/test/tap/tests_with_deps/deprecate_eof_support/Makefile +++ b/test/tap/tests_with_deps/deprecate_eof_support/Makefile @@ -28,6 +28,7 @@ TEST_MARIADB_LDIR := $(TEST_MARIADB_PATH)/libmariadb TEST_MYSQL_PATH := $(TEST_DEPS_PATH)/mysql-connector-c/mysql-connector-c TEST_MYSQL_IDIR := $(TEST_MYSQL_PATH)/include +TEST_MYSQL_EDIR := $(TEST_MYSQL_PATH)/libbinlogevents/export TEST_MYSQL_LDIR := $(TEST_MYSQL_PATH)/libmysql ### detect compiler support for c++11/17 @@ -72,16 +73,17 @@ IDIRS += -I$(DEPS_PATH)/curl/curl/include default: all .PHONY: all -all: build_test_deps tests +all: tests .PHONY: debug debug: DEBUG := -DDEBUG debug: OPT := $(STDCPP) -O0 -DDEBUG -ggdb -Wl,--no-as-needed -Wl,-rpath,$(TAP_LDIR) $(WGCOV) $(WASAN) -debug: build_test_deps tests +debug: tests ### test deps targets +#.PHONY: build_test_deps build_test_deps: $(TAP_LDIR)/libtap.so $(TEST_MARIADB_LDIR)/libmariadbclient.a $(TEST_MYSQL_LDIR)/libmysqlclient.a $(TAP_LDIR)/libtap.so: @@ -96,37 +98,38 @@ $(TEST_MYSQL_LDIR)/libmysqlclient.a: ### test and helper targets +tests: build_test_deps tests: $(patsubst %.cpp,%,$(wildcard *-t.cpp)) fwd_eof_query fwd_eof_ok_query COMMONARGS := $(OPT) -I$(TAP_IDIR) -L$(TAP_LDIR) -ltap -lcpp_dotenv -lz -ldl -lpthread -DGITVERSION=\"$(GIT_VERSION)\" -ok_packet_mixed_queries-t: eof_packet_mixed_queries-t.cpp build_test_deps +ok_packet_mixed_queries-t: eof_packet_mixed_queries-t.cpp $(CXX) $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -L$(TEST_MARIADB_LDIR) -lmariadbclient $(COMMONARGS) -o $@ -eof_packet_mixed_queries-t: eof_packet_mixed_queries-t.cpp build_test_deps +eof_packet_mixed_queries-t: eof_packet_mixed_queries-t.cpp $(CXX) -DNON_EOF_SUPPORT $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -L$(TEST_MARIADB_LDIR) -lmariadbclient $(COMMONARGS) -o $@ -fwd_eof_query: fwd_eof_query.cpp build_test_deps +fwd_eof_query: fwd_eof_query.cpp $(CXX) -DNON_EOF_SUPPORT $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -L$(TEST_MARIADB_LDIR) -lmariadbclient $(COMMONARGS) -o $@ # 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 build_test_deps - $(CXX) $< $(IDIRS) -I$(MARIADB_IDIR) -I$(TEST_MYSQL_IDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(COMMONARGS) -o $@ +fwd_eof_ok_query: fwd_eof_query.cpp + $(CXX) $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -I$(TEST_MYSQL_IDIR) -I$(TEST_MYSQL_EDIR) -L$(TEST_MYSQL_LDIR) -lmysqlclient $(COMMONARGS) -o $@ # NOTE end -deprecate_eof_cache-t: deprecate_eof_cache-t.cpp build_test_deps +deprecate_eof_cache-t: deprecate_eof_cache-t.cpp $(CXX) $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -L$(TEST_MARIADB_LDIR) -lmariadbclient -L$(PROXYSQL_LDIR) -lproxysql $(COMMONARGS) -o $@ -eof_cache_mixed_flags-t: eof_cache_mixed_flags-t.cpp build_test_deps +eof_cache_mixed_flags-t: eof_cache_mixed_flags-t.cpp $(CXX) $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -L$(TEST_MARIADB_LDIR) -lmariadbclient $(COMMONARGS) -o $@ -eof_mixed_flags_queries-t: eof_mixed_flags_queries-t.cpp build_test_deps +eof_mixed_flags_queries-t: eof_mixed_flags_queries-t.cpp $(CXX) $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -L$(TEST_MARIADB_LDIR) -lmariadbclient $(COMMONARGS) -o $@ -eof_conn_options_check-t: eof_conn_options_check-t.cpp build_test_deps +eof_conn_options_check-t: eof_conn_options_check-t.cpp $(CXX) $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -L$(TEST_MARIADB_LDIR) -lmariadbclient $(COMMONARGS) -o $@ -eof_fast_forward-t: eof_fast_forward-t.cpp build_test_deps +eof_fast_forward-t: eof_fast_forward-t.cpp $(CXX) $< $(IDIRS) -I$(TEST_MARIADB_IDIR) -L$(TEST_MARIADB_LDIR) -lmariadbclient $(COMMONARGS) -o $@