From 8a367054d0b951eaa1512ec0c60afdb265c7d65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Mon, 11 Mar 2024 15:16:05 +0100 Subject: [PATCH 01/19] Fix clang compilation for tests dep 'cppdotenv' --- test/tap/tap/Makefile | 2 ++ test/tap/tap/cpp-dotenv/nm_clang_fix.patch | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/tap/tap/cpp-dotenv/nm_clang_fix.patch diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 45097bbe83..8706b1fe4a 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -104,6 +104,7 @@ cpp-dotenv/static/cpp-dotenv/libcpp_dotenv.a: 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 && patch -p0 < ../../nm_clang_fix.patch 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} @@ -112,6 +113,7 @@ cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so: 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 && patch -p0 < ../../nm_clang_fix.patch cd cpp-dotenv/dynamic/cpp-dotenv && cmake . -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_RPATH="../tap:../../tap" -DCMAKE_BUILD_TYPE=Debug cd cpp-dotenv/dynamic/cpp-dotenv && CC=${CC} CXX=${CXX} ${MAKE} diff --git a/test/tap/tap/cpp-dotenv/nm_clang_fix.patch b/test/tap/tap/cpp-dotenv/nm_clang_fix.patch new file mode 100644 index 0000000000..2cf3067820 --- /dev/null +++ b/test/tap/tap/cpp-dotenv/nm_clang_fix.patch @@ -0,0 +1,12 @@ +diff --git src/dotenv.cpp src/dotenv.cpp +index 89bd3c1..1dcaf5a 100644 +--- src/dotenv.cpp ++++ src/dotenv.cpp +@@ -8,7 +8,6 @@ + + + using namespace std; +-using namespace dotenv; + + + dotenv::dotenv& dotenv::dotenv::load_dotenv(const string& dotenv_path, const bool overwrite, const bool interpolate) From c2b1d49cdfc0562a8d55e8593eccc5bc827ce4b4 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 17:56:19 +0000 Subject: [PATCH 02/19] use $(CXX) as compiler --- test/tap/tap/Makefile | 8 ++++---- test/tap/tests/Makefile | 28 +++++++++++++--------------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 8706b1fe4a..a79508ece9 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -70,19 +70,19 @@ debug: libtap.a libtap.so ### helper targets 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 $(IDIRS) $(OPT) + $(CXX) -fPIC -c command_line.cpp $(IDIRS) $(OPT) 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 $(IDIRS) $(OPT) + $(CXX) -fPIC -c utils.cpp $(IDIRS) $(OPT) 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 $(IDIRS) $(OPT) + $(CXX) -fPIC -c tap.cpp $(IDIRS) $(OPT) libtap.a: 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: libtap.a cpp-dotenv/dynamic/cpp-dotenv/libcpp_dotenv.so - gcc -shared -o libtap.so -Wl,--whole-archive libtap.a -Wl,--no-whole-archive + $(CXX) -shared -o libtap.so -Wl,--whole-archive libtap.a -Wl,--no-whole-archive ### tap deps targets diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 422ead51cc..ed0de23b3d 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -221,51 +221,49 @@ py-%: # $(CXX) $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -lpthread -ldl $(STATIC_LIBS) $(TAP_LDIR)/libtap.so -o $@ galera_1_timeout_count: galera_1_timeout_count.cpp $(TAP_LDIR)/libtap.so - g++ -DTEST_GALERA $< ../tap/SQLite3_Server.cpp $(IDIRS) $(LDIRS) $(OPT) $(OBJ) $(MYLIBSJEMALLOC) $(MYLIBS) $(STATIC_LIBS) -o $@ + $(CXX) -DTEST_GALERA $< ../tap/SQLite3_Server.cpp $(IDIRS) $(LDIRS) $(OPT) $(OBJ) $(MYLIBSJEMALLOC) $(MYLIBS) $(STATIC_LIBS) -o $@ galera_2_timeout_no_count: galera_2_timeout_no_count.cpp $(TAP_LDIR)/libtap.so - g++ -DTEST_GALERA $< ../tap/SQLite3_Server.cpp $(IDIRS) $(LDIRS) $(OPT) $(OBJ) $(MYLIBSJEMALLOC) $(MYLIBS) $(STATIC_LIBS) -o $@ + $(CXX) -DTEST_GALERA $< ../tap/SQLite3_Server.cpp $(IDIRS) $(LDIRS) $(OPT) $(OBJ) $(MYLIBSJEMALLOC) $(MYLIBS) $(STATIC_LIBS) -o $@ generate_set_session_csv: generate_set_session_csv.cpp - g++ $< $(OPT) -o $@ + $(CXX) $< $(OPT) -o $@ aurora: aurora.cpp $(TAP_LDIR)/libtap.so - g++ -DTEST_AURORA $< ../tap/SQLite3_Server.cpp $(IDIRS) $(LDIRS) $(OPT) $(OBJ) $(MYLIBSJEMALLOC) $(MYLIBS) $(STATIC_LIBS) -o $@ + $(CXX) -DTEST_AURORA $< ../tap/SQLite3_Server.cpp $(IDIRS) $(LDIRS) $(OPT) $(OBJ) $(MYLIBSJEMALLOC) $(MYLIBS) $(STATIC_LIBS) -o $@ test_tokenizer-t: test_tokenizer-t.cpp $(TAP_LDIR)/libtap.so - g++ $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@ + $(CXX) $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@ test_mysql_query_digests_stages-t: test_mysql_query_digests_stages-t.cpp $(TAP_LDIR)/libtap.so - g++ $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@ + $(CXX) $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@ sqlite3-t: sqlite3-t.cpp $(TAP_LDIR)/libtap.so - g++ $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(LIBCOREDUMPERAR) -o $@ + $(CXX) $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(LIBCOREDUMPERAR) -o $@ test_gtid_forwarding-t: test_gtid_forwarding-t.cpp $(TAP_LDIR)/libtap.so - g++ $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@ + $(CXX) $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@ test_admin_prometheus_metrics_dump-t: test_admin_prometheus_metrics_dump-t.cpp $(TAP_LDIR)/libtap.so - g++ $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@ + $(CXX) $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@ create_connection_annotation: test_connection_annotation-t.cpp $(TAP_LDIR)/libtap.so - g++ -DTEST_AURORA $< $(IDIRS) $(LDIRS) $(OPT) $(OBJ) $(MYLIBS) $(STATIC_LIBS) -o $@ + $(CXX) -DTEST_AURORA $< $(IDIRS) $(LDIRS) $(OPT) $(OBJ) $(MYLIBS) $(STATIC_LIBS) -o $@ setparser_test: setparser_test.cpp $(TAP_LDIR)/libtap.so $(RE2_PATH)/util/test.cc $(PROXYSQL_LDIR)/set_parser.cpp $(LIBPROXYSQLAR) $(LIBCOREDUMPERAR) - g++ $< $(RE2_PATH)/util/test.cc $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(LIBCOREDUMPERAR) -o $@ + $(CXX) $< $(RE2_PATH)/util/test.cc $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(LIBCOREDUMPERAR) -o $@ setparser_test2-t: setparser_test2 - rm setparser_test2-t || true ln -fs setparser_test2 setparser_test2-t setparser_test2: setparser_test2.cpp $(TAP_LDIR)/libtap.so $(PROXYSQL_LDIR)/set_parser.cpp setparser_test_common.h $(LIBCOREDUMPERAR) - g++ $< $(PROXYSQL_LDIR)/set_parser.cpp $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(LIBCOREDUMPERAR) -o $@ + $(CXX) $< $(PROXYSQL_LDIR)/set_parser.cpp $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(LIBCOREDUMPERAR) -o $@ setparser_test3-t: setparser_test3 - rm setparser_test3-t || true ln -fs setparser_test3 setparser_test3-t setparser_test3: setparser_test3.cpp $(TAP_LDIR)/libtap.so $(PROXYSQL_LDIR)/set_parser.cpp setparser_test_common.h $(LIBCOREDUMPERAR) - g++ -DPARSERDEBUG $< $(PROXYSQL_LDIR)/set_parser.cpp $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(LIBCOREDUMPERAR) -o $@ + $(CXX) -DPARSERDEBUG $< $(PROXYSQL_LDIR)/set_parser.cpp $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) $(LIBCOREDUMPERAR) -o $@ CUSTOMARGS := -I$(TAP_IDIR) -I$(CURL_IDIR) -I$(SQLITE3_IDIR) -I$(PROXYSQL_IDIR) -I$(JSON_IDIR) -I$(SSL_IDIR) From ffcae7802a725373e6e4d7c3f591137f2877a71b Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:00:18 +0000 Subject: [PATCH 03/19] remove generated files --- test/tap/tests/set_testing-t.csv | 98 --------------------- test/tap/tests/set_testing-t.csv.obsolete | 102 ---------------------- 2 files changed, 200 deletions(-) delete mode 100644 test/tap/tests/set_testing-t.csv delete mode 100644 test/tap/tests/set_testing-t.csv.obsolete diff --git a/test/tap/tests/set_testing-t.csv b/test/tap/tests/set_testing-t.csv deleted file mode 100644 index aa0f8d348d..0000000000 --- a/test/tap/tests/set_testing-t.csv +++ /dev/null @@ -1,98 +0,0 @@ -"set character_set_results=null; set names latin7; set character_set_client='utf8mb4';", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'utf8mb4'}" -"set names latin2", "{'character_set_results':'latin2', 'collation_connection':'latin2_general_ci', 'character_set_connection':'latin2', 'character_set_client':'latin2'}" -"set names utf8mb4", "{'character_set_results':'utf8mb4', 'collation_connection':'utf8mb4_general_ci', 'character_set_connection':'utf8mb4', 'character_set_client':'utf8mb4'}" -"set character_set_client='utf8mb4'; set names utf8; set character_set_connection='latin1';", "{'character_set_results':'utf8', 'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1', 'character_set_client':'utf8'}" -"set character_set_database='latin1'; set character_set_connection='utf8mb4'; set names utf8; set character_set_client='latin1';", "{'character_set_database':'latin1', 'character_set_results':'utf8', 'collation_connection':'utf8_general_ci', 'character_set_connection':'utf8', 'character_set_client':'latin1'}" -"set character_set_connection='utf8mb4'; set names utf8; set character_set_client='latin1'; set collation_connection='latin1_swedish_ci';", "{'character_set_results':'utf8', 'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1', 'character_set_client':'latin1'}""set names latin7", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'latin7'}" -"set collation_connection='utf8mb4_general_ci'; ", "{'collation_connection':'utf8mb4_general_ci', 'character_set_connection':'utf8mb4'}" -"set collation_connection='latin1_danish_ci'; ", "{'collation_connection':'latin1_danish_ci', 'character_set_connection':'latin1'}" -"set collation_connection='latin1_swedish_ci'", "{'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1'}" -"set collation_connection='utf8_general_ci'", "{'collation_connection':'utf8_general_ci', 'character_set_connection':'utf8'}" -"SET collation_connection='latin1_swedish_ci'", "{'character_set_connection':'latin1', 'collation_connection':'latin1_swedish_ci'}" -"SET collation_connection='utf8_general_ci'", "{'character_set_connection':'utf8', 'collation_connection':'utf8_general_ci'}" -"SET collation_connection='utf8mb4_general_ci'", "{'character_set_connection':'utf8mb4', 'collation_connection':'utf8mb4_general_ci'}" -"SET character_set_connection='latin1'", "{'character_set_connection':'latin1', 'collation_connection':'latin1_swedish_ci'}" -"SET character_set_connection='utf8'", "{'character_set_connection':'utf8', 'collation_connection':'utf8_general_ci'}" -"SET character_set_connection='utf8mb4'", "{'character_set_connection':'utf8mb4', 'collation_connection':'utf8mb4_general_ci'}" -"SET character_set_results='latin1'", "{'character_set_results':'latin1'}" -"SET character_set_results='binary'", "{'character_set_results':'binary'}" -"SET character_set_results=NULL", "{'character_set_results':''}" -"SET character_set_results='utf8'", "{'character_set_results':'utf8'}" -"SET character_set_results='utf8mb4'", "{'character_set_results':'utf8mb4'}" -"SET character_set_client='latin1'", "{'character_set_client':'latin1'}" -"SET character_set_client='utf8'", "{'character_set_client':'utf8'}" -"SET character_set_client='utf8mb4'", "{'character_set_client':'utf8mb4'}" -"SET character_set_database='latin1'; ", "{'character_set_database':'latin1'}" -"SET character_set_database='utf8'", "{'character_set_database':'utf8'}" -"SET character_set_database='utf8mb4'", "{'character_set_database':'utf8mb4'}" -"SET sql_log_bin=1", "{'sql_log_bin':'ON'}" -"SET sql_log_bin=0", "{'sql_log_bin':'OFF'}" -"set sql_mode=''","{'sql_mode':''}" -"SET sql_mode='PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'", "{'sql_mode':'PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'}" -"SET time_zone='+01:00'","{'time_zone':'+01:00'}" -"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}" -"SET sql_safe_updates='OFF'", "{'sql_safe_updates':'OFF'}" -"SET sql_safe_updates='ON'", "{'sql_safe_updates':'ON'}" -"SET sql_safe_updates=0", "{'sql_safe_updates':'OFF'}" -"SET sql_safe_updates=1", "{'sql_safe_updates':'ON'}" -"SET sql_select_limit=1010", "{'sql_select_limit':'1010'}" -"SET sql_select_limit=2020", "{'sql_select_limit':'2020'}" -"SET sql_select_limit=3030", "{'sql_select_limit':'3030'}" -"SET time_zone='+01:00'; ","{'time_zone':'+01:00'}" -"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'; ","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'; ", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}" -"SET sql_safe_updates='OFF'; ", "{'sql_safe_updates':'OFF'}" -"SET sql_safe_updates='ON'; ", "{'sql_safe_updates':'ON'}" -"SET sql_safe_updates=0; ", "{'sql_safe_updates':'OFF'}" -"SET sql_safe_updates=1; ", "{'sql_safe_updates':'ON'}" -"SET sql_select_limit=1010; ", "{'sql_select_limit':'1010'}" -"SET sql_select_limit=2020; ", "{'sql_select_limit':'2020'}" -"SET sql_select_limit=3030; ", "{'sql_select_limit':'3030'}" -"SET session transaction read only", "{'transaction_read_only':'ON'}" -"SET session transaction read write", "{'transaction_read_only':'OFF'}" -"SET session transaction isolation level READ COMMITTED", "{'transaction_isolation':'READ-COMMITTED'}" -"SET session transaction isolation level READ UNCOMMITTED", "{'transaction_isolation':'READ-UNCOMMITTED'}" -"SET session transaction isolation level REPEATABLE READ", "{'transaction_isolation':'REPEATABLE-READ'}" -"SET session transaction isolation level SERIALIZABLE", "{'transaction_isolation':'SERIALIZABLE'}" -"SET tx_isolation='READ-COMMITTED'", "{'transaction_isolation':'READ-COMMITTED'}" -"SET tx_isolation='READ-UNCOMMITTED'", "{'transaction_isolation':'READ-UNCOMMITTED'}" -"SET tx_isolation='REPEATABLE-READ'", "{'transaction_isolation':'REPEATABLE-READ'}" -"SET tx_isolation='SERIALIZABLE'", "{'transaction_isolation':'SERIALIZABLE'}" -"SET session_track_gtids=OFF", "{'session_track_gtids':'OFF'}" -"SET session_track_gtids=OWN_GTID", "{'session_track_gtids':'OWN_GTID'}" -"SET sql_auto_is_null=OFF", "{'sql_auto_is_null':'OFF'}" -"SET sql_auto_is_null=ON", "{'sql_auto_is_null':'ON'}" -"set max_join_size=20000", "{'max_join_size':'20000'}" -"set max_join_size=10000", "{'max_join_size':'10000'}" -"set max_join_size=18446744073709551615", "{'max_join_size':'18446744073709551615'}" -"set wsrep_sync_wait=1", "{'wsrep_sync_wait':'1'}" -"set wsrep_sync_wait=0", "{'wsrep_sync_wait':'0'}" -"set group_concat_max_len=2048", "{'group_concat_max_len':'2048'}" -"set group_concat_max_len=4096", "{'group_concat_max_len':'4096'}" -"set tx_isolation='READ-COMMITTED', group_concat_max_len=4096", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'4096'}" -"set tx_isolation='READ-COMMITTED', group_concat_max_len=2048", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'2048'}" -"set group_concat_max_len=4096; ", "{'group_concat_max_len':'4096'}" -"SET character_set_database='utf8mb4', max_join_size=10000; ", "{'character_set_database':'utf8mb4', 'max_join_size':'10000'}" -"SET character_set_database='utf8mb4', max_join_size=10000, session_track_gtids=OWN_GTID; ", "{'character_set_database':'utf8mb4', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" -"SET sql_select_limit=3030, session_track_gtids=OWN_GTID; SET max_join_size=10000; ", "{'sql_select_limit':'3030', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" -"SET sql_mode='NO_ENGINE_SUBSTITUTION', sql_select_limit=3030, session_track_gtids=OWN_GTID; SET max_join_size=10000; ", "{'sql_mode':'NO_ENGINE_SUBSTITUTION','sql_select_limit':'3030', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" -"SET character_set_client='utf8', sql_select_limit=3030, max_join_size=18446744073709551615", "{'character_set_client':'utf8', 'sql_select_limit':'3030', 'max_join_size':'18446744073709551615'}" -"SET sql_select_limit=3030, character_set_client='latin1', max_join_size=10000", "{'sql_select_limit':'3030', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"SET session_track_gtids=OFF", "{'session_track_gtids':'OFF'}" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1', max_join_size=10000", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"SET character_set_results='binary', sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1', max_join_size=10000", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"SET character_set_results='binary', max_join_size=10000, sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1'; ", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"SET CHARACTER SET utf8", "{'character_set_results':'utf8', 'character_set_client':'utf8'}", "['character_set_connection', 'collation_connection']" -"SET CHARACTER SET 'utf8'", "{'character_set_results':'utf8', 'character_set_client':'utf8'}", "['character_set_connection', 'collation_connection']" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', max_join_size=10000; SET CHARACTER SET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', max_join_size=10000; SET CHARSET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" -"SET session_track_gtids=ALL_GTIDS", "{'session_track_gtids':'ALL_GTIDS'}" -"SET sql_safe_updates=1, session_track_schema=1, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES')", "{'sql_safe_updates':'ON', 'sql_mode':'concat(@@sql_mode,\',STRICT_TRANS_TABLES\')'}" -"set `group_concat_max_len`=4096", "{'group_concat_max_len':'4096'}" -"SET `sql_select_limit`=3030; ", "{'sql_select_limit':'3030'}" -"SET `time_zone`='+04:00', `sql_mode`='NO_ENGINE_SUBSTITUTION', `max_join_size`=10000; SET CHARACTER SET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" -"SET `character_set_results`='binary', `sql_mode`='NO_ENGINE_SUBSTITUTION', `character_set_client`='latin1', `max_join_size`=10000", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"set `tx_isolation`='READ-COMMITTED', `group_concat_max_len`=4096", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'4096'}" -"SET `sql_auto_is_null`=ON", "{'sql_auto_is_null':'ON'}" -"set `character_set_results`=null; set names latin7; set `character_set_client`='utf8mb4';", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'utf8mb4'}" diff --git a/test/tap/tests/set_testing-t.csv.obsolete b/test/tap/tests/set_testing-t.csv.obsolete deleted file mode 100644 index d7403e1399..0000000000 --- a/test/tap/tests/set_testing-t.csv.obsolete +++ /dev/null @@ -1,102 +0,0 @@ -"set character_set_results=null; set names latin7; set character_set_client='utf8mb4';", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'utf8mb4'}" -"set names latin2", "{'character_set_results':'latin2', 'collation_connection':'latin2_general_ci', 'character_set_connection':'latin2', 'character_set_client':'latin2'}" -"set names utf8mb4", "{'character_set_results':'utf8mb4', 'collation_connection':'utf8mb4_general_ci', 'character_set_connection':'utf8mb4', 'character_set_client':'utf8mb4'}" -"set character_set_client='utf8mb4'; set names utf8; set character_set_connection='latin1';", "{'character_set_results':'utf8', 'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1', 'character_set_client':'utf8'}" -"set character_set_database='latin1'; set character_set_connection='utf8mb4'; set names utf8; set character_set_client='latin1';", "{'character_set_database':'latin1', 'character_set_results':'utf8', 'collation_connection':'utf8_general_ci', 'character_set_connection':'utf8', 'character_set_client':'latin1'}" -"set character_set_connection='utf8mb4'; set names utf8; set character_set_client='latin1'; set collation_connection='latin1_swedish_ci';", "{'character_set_results':'utf8', 'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1', 'character_set_client':'latin1'}""set names latin7", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'latin7'}" -"set collation_connection='utf8mb4_general_ci'; ", "{'collation_connection':'utf8mb4_general_ci', 'character_set_connection':'utf8mb4'}" -"set collation_connection='latin1_danish_ci'; ", "{'collation_connection':'latin1_danish_ci', 'character_set_connection':'latin1'}" -"set collation_connection='latin1_swedish_ci'", "{'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1'}" -"set collation_connection='utf8_general_ci'", "{'collation_connection':'utf8_general_ci', 'character_set_connection':'utf8'}" -"SET collation_connection='latin1_swedish_ci'", "{'character_set_connection':'latin1', 'collation_connection':'latin1_swedish_ci'}" -"SET collation_connection='utf8_general_ci'", "{'character_set_connection':'utf8', 'collation_connection':'utf8_general_ci'}" -"SET collation_connection='utf8mb4_general_ci'", "{'character_set_connection':'utf8mb4', 'collation_connection':'utf8mb4_general_ci'}" -"SET character_set_connection='latin1'", "{'character_set_connection':'latin1', 'collation_connection':'latin1_swedish_ci'}" -"SET character_set_connection='utf8'", "{'character_set_connection':'utf8', 'collation_connection':'utf8_general_ci'}" -"SET character_set_connection='utf8mb4'", "{'character_set_connection':'utf8mb4', 'collation_connection':'utf8mb4_general_ci'}" -"SET character_set_results='latin1'", "{'character_set_results':'latin1'}" -"SET character_set_results='binary'", "{'character_set_results':'binary'}" -"SET character_set_results=NULL", "{'character_set_results':''}" -"SET character_set_results='utf8'", "{'character_set_results':'utf8'}" -"SET character_set_results='utf8mb4'", "{'character_set_results':'utf8mb4'}" -"SET character_set_client='latin1'", "{'character_set_client':'latin1'}" -"SET character_set_client='utf8'", "{'character_set_client':'utf8'}" -"SET character_set_client='utf8mb4'", "{'character_set_client':'utf8mb4'}" -"SET character_set_database='latin1'; ", "{'character_set_database':'latin1'}" -"SET character_set_database='utf8'", "{'character_set_database':'utf8'}" -"SET character_set_database='utf8mb4'", "{'character_set_database':'utf8mb4'}" -"SET sql_log_bin=1", "{'sql_log_bin':'ON'}" -"SET sql_log_bin=0", "{'sql_log_bin':'OFF'}" -"set sql_mode=''","{'sql_mode':''}" -"SET sql_mode='PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'", "{'sql_mode':'PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'}" -"SET time_zone='+01:00'","{'time_zone':'+01:00'}" -"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}" -"SET sql_safe_updates='OFF'", "{'sql_safe_updates':'OFF'}" -"SET sql_safe_updates='ON'", "{'sql_safe_updates':'ON'}" -"SET sql_safe_updates=0", "{'sql_safe_updates':'OFF'}" -"SET sql_safe_updates=1", "{'sql_safe_updates':'ON'}" -"SET sql_select_limit=1010", "{'sql_select_limit':'1010'}" -"SET sql_select_limit=2020", "{'sql_select_limit':'2020'}" -"SET sql_select_limit=3030", "{'sql_select_limit':'3030'}" -"SET time_zone='+01:00'; ","{'time_zone':'+01:00'}" -"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'; ","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'; ", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}" -"SET sql_safe_updates='OFF'; ", "{'sql_safe_updates':'OFF'}" -"SET sql_safe_updates='ON'; ", "{'sql_safe_updates':'ON'}" -"SET sql_safe_updates=0; ", "{'sql_safe_updates':'OFF'}" -"SET sql_safe_updates=1; ", "{'sql_safe_updates':'ON'}" -"SET sql_select_limit=1010; ", "{'sql_select_limit':'1010'}" -"SET sql_select_limit=2020; ", "{'sql_select_limit':'2020'}" -"SET sql_select_limit=3030; ", "{'sql_select_limit':'3030'}" -"SET session transaction read only", "{'transaction_read_only':'ON'}" -"SET session transaction read write", "{'transaction_read_only':'OFF'}" -"SET session transaction isolation level READ COMMITTED", "{'transaction_isolation':'READ-COMMITTED'}" -"SET session transaction isolation level READ UNCOMMITTED", "{'transaction_isolation':'READ-UNCOMMITTED'}" -"SET session transaction isolation level REPEATABLE READ", "{'transaction_isolation':'REPEATABLE-READ'}" -"SET session transaction isolation level SERIALIZABLE", "{'transaction_isolation':'SERIALIZABLE'}" -"SET tx_isolation='READ-COMMITTED'", "{'transaction_isolation':'READ-COMMITTED'}" -"SET tx_isolation='READ-UNCOMMITTED'", "{'transaction_isolation':'READ-UNCOMMITTED'}" -"SET tx_isolation='REPEATABLE-READ'", "{'transaction_isolation':'REPEATABLE-READ'}" -"SET tx_isolation='SERIALIZABLE'", "{'transaction_isolation':'SERIALIZABLE'}" -"SET session_track_gtids=OFF", "{'session_track_gtids':'OFF'}" -"SET session_track_gtids=OWN_GTID", "{'session_track_gtids':'OWN_GTID'}" -"SET sql_auto_is_null=OFF", "{'sql_auto_is_null':'OFF'}" -"SET sql_auto_is_null=ON", "{'sql_auto_is_null':'ON'}" -"set net_write_timeout=30", "{'net_write_timeout':'30'}" -"set net_write_timeout=60", "{'net_write_timeout':'60'}" -"set net_write_timeout=90", "{'net_write_timeout':'90'}" -"set max_join_size=20000", "{'max_join_size':'20000'}" -"set max_join_size=10000", "{'max_join_size':'10000'}" -"set max_join_size=18446744073709551615", "{'max_join_size':'18446744073709551615'}" -"set wsrep_sync_wait=1", "{'wsrep_sync_wait':'1'}" -"set wsrep_sync_wait=0", "{'wsrep_sync_wait':'0'}" -"set group_concat_max_len=2048", "{'group_concat_max_len':'2048'}" -"set group_concat_max_len=4096", "{'group_concat_max_len':'4096'}" -"set tx_isolation='READ-COMMITTED', group_concat_max_len=4096", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'4096'}" -"set tx_isolation='READ-COMMITTED', group_concat_max_len=2048, net_write_timeout=30", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'2048', 'net_write_timeout':'30'}" -"set group_concat_max_len=4096; ", "{'group_concat_max_len':'4096'}" -"SET character_set_database='utf8mb4', max_join_size=10000; ", "{'character_set_database':'utf8mb4', 'max_join_size':'10000'}" -"SET character_set_database='utf8mb4', max_join_size=10000, session_track_gtids=OWN_GTID; ", "{'character_set_database':'utf8mb4', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" -"SET sql_select_limit=3030, session_track_gtids=OWN_GTID; SET max_join_size=10000; ", "{'sql_select_limit':'3030', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" -"SET sql_mode='NO_ENGINE_SUBSTITUTION', sql_select_limit=3030, session_track_gtids=OWN_GTID; SET max_join_size=10000; ", "{'sql_mode':'NO_ENGINE_SUBSTITUTION','sql_select_limit':'3030', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" -"SET character_set_client='utf8', sql_select_limit=3030, max_join_size=18446744073709551615", "{'character_set_client':'utf8', 'sql_select_limit':'3030', 'max_join_size':'18446744073709551615'}" -"SET sql_select_limit=3030, character_set_client='latin1', max_join_size=10000", "{'sql_select_limit':'3030', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"SET session_track_gtids=OFF", "{'session_track_gtids':'OFF'}" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1', max_join_size=10000", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"SET character_set_results='binary', sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1', max_join_size=10000", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"SET character_set_results='binary', max_join_size=10000, sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1'; ", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"SET CHARACTER SET utf8", "{'character_set_results':'utf8', 'character_set_client':'utf8'}", "['character_set_connection', 'collation_connection']" -"SET CHARACTER SET 'utf8'", "{'character_set_results':'utf8', 'character_set_client':'utf8'}", "['character_set_connection', 'collation_connection']" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', max_join_size=10000; SET CHARACTER SET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" -"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', max_join_size=10000; SET CHARSET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" -"SET session_track_gtids=ALL_GTIDS", "{'session_track_gtids':'ALL_GTIDS'}" -"SET sql_safe_updates=1, session_track_schema=1, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES')", "{'sql_safe_updates':'ON', 'sql_mode':'concat(@@sql_mode,\',STRICT_TRANS_TABLES\')'}" -"set `group_concat_max_len`=4096", "{'group_concat_max_len':'4096'}" -"SET `sql_select_limit`=3030; ", "{'sql_select_limit':'3030'}" -"SET `time_zone`='+04:00', `sql_mode`='NO_ENGINE_SUBSTITUTION', `max_join_size`=10000; SET CHARACTER SET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" -"SET `character_set_results`='binary', `sql_mode`='NO_ENGINE_SUBSTITUTION', `character_set_client`='latin1', `max_join_size`=10000", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" -"set `tx_isolation`='READ-COMMITTED', `group_concat_max_len`=4096", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'4096'}" -"set `net_write_timeout`=30", "{'net_write_timeout':'30'}" -"SET `sql_auto_is_null`=ON", "{'sql_auto_is_null':'ON'}" -"set `character_set_results`=null; set names latin7; set `character_set_client`='utf8mb4';", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'utf8mb4'}" From 351e6bb236ede5ce0f7f776297a2beadbefdfc70 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:02:07 +0000 Subject: [PATCH 04/19] fix comparison --- test/tap/tests/admin_show_table_status-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/admin_show_table_status-t.cpp b/test/tap/tests/admin_show_table_status-t.cpp index 1e48e78471..0727e023c2 100644 --- a/test/tap/tests/admin_show_table_status-t.cpp +++ b/test/tap/tests/admin_show_table_status-t.cpp @@ -81,7 +81,7 @@ int main() { MYSQL_QUERY(proxysql_admin, query); MYSQL_RES* proxy_res = mysql_store_result(proxysql_admin); unsigned long rows = proxy_res->row_count; - ok(rows = 1 , "SHOW TABLE STATUS %s generated %lu row(s)", it->c_str(), rows); + ok(rows == 1 , "SHOW TABLE STATUS %s generated %lu row(s)", it->c_str(), rows); mysql_free_result(proxy_res); } free(query); From 75b0fb586b3b37fe5ae27f588e30d3b93a02d2d6 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:02:36 +0000 Subject: [PATCH 05/19] fix comparison --- test/tap/tests/reg_test_4158_change_user-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/reg_test_4158_change_user-t.cpp b/test/tap/tests/reg_test_4158_change_user-t.cpp index 8b01a319c4..e7d7a86957 100644 --- a/test/tap/tests/reg_test_4158_change_user-t.cpp +++ b/test/tap/tests/reg_test_4158_change_user-t.cpp @@ -83,7 +83,7 @@ int run_funct_timeout(void *(*start_routine)(void *), int timeout) { diag("Waiting up to %d seconds", timeout); } } - if (tr =! 0) { + if (tr != 0) { return EXIT_FAILURE; } } else { From 33dea05b5065a0f8cdc6c64987e7ea9b00720e9c Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:03:15 +0000 Subject: [PATCH 06/19] fix function call --- test/tap/tests/test_change_user-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/test_change_user-t.cpp b/test/tap/tests/test_change_user-t.cpp index 5b1a842026..0f876234bc 100644 --- a/test/tap/tests/test_change_user-t.cpp +++ b/test/tap/tests/test_change_user-t.cpp @@ -187,7 +187,7 @@ int TestSet1(const CommandLine& cl, const char *plugin, bool test_ssl , bool tes } } } - close_connections; + close_connections(); } return 0; } From abfe33f0b0f1799e410c49d3283c246957bcc545 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:04:27 +0000 Subject: [PATCH 07/19] fix pass c_str() --- test/tap/tests/test_cacert_load_and_verify_duration-t.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tap/tests/test_cacert_load_and_verify_duration-t.cpp b/test/tap/tests/test_cacert_load_and_verify_duration-t.cpp index 46fbde802e..82a477af36 100644 --- a/test/tap/tests/test_cacert_load_and_verify_duration-t.cpp +++ b/test/tap/tests/test_cacert_load_and_verify_duration-t.cpp @@ -48,7 +48,7 @@ int main() { if (error_msg.find("Invalid test") != std::string::npos) { ok(true, "ProxySQL is not compiled in Debug mode. Skipping test"); } else { - fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, error_msg); + fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, error_msg.c_str()); } } else { const std::string& msg = mysql_info(proxysql_admin); From b0091ecb2feebc2d0632697b9ed5360f334b9c8c Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:05:39 +0000 Subject: [PATCH 08/19] fix assigment result comparison --- test/tap/tests/reg_test_4072-show-warnings-t.cpp | 2 +- test/tap/tests/test_query_cache_soft_ttl_pct-t.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tap/tests/reg_test_4072-show-warnings-t.cpp b/test/tap/tests/reg_test_4072-show-warnings-t.cpp index 3e22e70e19..b4f60e2e03 100644 --- a/test/tap/tests/reg_test_4072-show-warnings-t.cpp +++ b/test/tap/tests/reg_test_4072-show-warnings-t.cpp @@ -99,7 +99,7 @@ int main(int argc, char** argv) { unsigned long fetched_row_count = 0; - while (row = mysql_fetch_row(mysql_result)) { + while ((row = mysql_fetch_row(mysql_result))) { fetched_row_count++; usleep(10); } diff --git a/test/tap/tests/test_query_cache_soft_ttl_pct-t.cpp b/test/tap/tests/test_query_cache_soft_ttl_pct-t.cpp index 68bce7954f..2eff27d901 100644 --- a/test/tap/tests/test_query_cache_soft_ttl_pct-t.cpp +++ b/test/tap/tests/test_query_cache_soft_ttl_pct-t.cpp @@ -95,7 +95,7 @@ std::map get_digest_stats_dummy_query(MYSQL* proxy_admin) { MYSQL_RES* res = mysql_store_result(proxy_admin); MYSQL_ROW row; - while (row = mysql_fetch_row(res)) { + while ((row = mysql_fetch_row(res))) { if (atoi(row[0]) == -1) stats["cache"] += atoi(row[1]); else From ee739edd8b8f3923fed6b878e0ba118c7373fbac Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:09:36 +0000 Subject: [PATCH 09/19] fix format strings --- lib/MySQL_HostGroups_Manager.cpp | 2 +- lib/ProxySQL_Admin.cpp | 6 +++--- test/tap/tests/test_cacert_load_and_verify_duration-t.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index ec7c5dc9c9..4ecd467ea5 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -2026,7 +2026,7 @@ bool MySQL_HostGroups_Manager::commit( if (atoi(r->fields[4])!=atoi(r->fields[14])) { if (GloMTH->variables.hostgroup_manager_verbose) - proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 5, "Changing weight for server %d:%s:%d (%s:%d) from %d (%d) to %d\n" , mysrvc->myhgc->hid , mysrvc->address, mysrvc->port, r->fields[1], atoi(r->fields[2]), atoi(r->fields[4]) , mysrvc->weight , atoi(r->fields[14])); + proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 5, "Changing weight for server %d:%s:%d (%s:%d) from %d (%ld) to %d\n" , mysrvc->myhgc->hid , mysrvc->address, mysrvc->port, r->fields[1], atoi(r->fields[2]), atoi(r->fields[4]) , mysrvc->weight , atoi(r->fields[14])); mysrvc->weight=atoi(r->fields[14]); } if (atoi(r->fields[5])!=atoi(r->fields[15])) { diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 864d37b5c4..f826157880 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -9745,13 +9745,13 @@ void ProxySQL_Admin::stats___memory_metrics() { uint64_t prep_stmt_backend_mem_usage; GloMyStmt->get_memory_usage(prep_stmt_metadata_mem_usage, prep_stmt_backend_mem_usage); vn = (char*)"prepare_statement_metadata_memory"; - sprintf(bu, "%llu", prep_stmt_metadata_mem_usage); + sprintf(bu, "%lu", prep_stmt_metadata_mem_usage); query=(char*)malloc(strlen(a)+strlen(vn)+strlen(bu)+16); sprintf(query, a, vn, bu); statsdb->execute(query); free(query); vn = (char*)"prepare_statement_backend_memory"; - sprintf(bu, "%llu", prep_stmt_backend_mem_usage); + sprintf(bu, "%lu", prep_stmt_backend_mem_usage); query=(char*)malloc(strlen(a)+strlen(vn)+strlen(bu)+16); sprintf(query, a, vn, bu); statsdb->execute(query); @@ -15049,7 +15049,7 @@ bool ProxySQL_Admin::ProxySQL_Test___CA_Certificate_Load_And_Verify(uint64_t* du uint64_t t2 = monotonic_time(); SSL_CTX_free(ctx); *duration = ((t2/1000) - (t1/1000)); - proxy_info("Duration: %llums\n", *duration); + proxy_info("Duration: %lums\n", *duration); return true; } #endif //DEBUG diff --git a/test/tap/tests/test_cacert_load_and_verify_duration-t.cpp b/test/tap/tests/test_cacert_load_and_verify_duration-t.cpp index 82a477af36..19da85d3d0 100644 --- a/test/tap/tests/test_cacert_load_and_verify_duration-t.cpp +++ b/test/tap/tests/test_cacert_load_and_verify_duration-t.cpp @@ -57,7 +57,7 @@ int main() { if (start_pos != std::string::npos && end_pos != std::string::npos) { uint64_t time = std::stoull(msg.substr(start_pos + 5, end_pos - (start_pos + 5))); - ok(time < 20000, "Total duration is '%llu ms' should be less than 20 Seconds", time); + ok(time < 20000, "Total duration is '%lu ms' should be less than 20 Seconds", time); } } mysql_close(proxysql_admin); From 3e7e15bb50baf75c473ea5d0bd40c43a8d2e9c5f Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:11:49 +0000 Subject: [PATCH 10/19] fix brackets in comparison --- lib/ClickHouse_Server.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ClickHouse_Server.cpp b/lib/ClickHouse_Server.cpp index ca428c4934..db35d65635 100644 --- a/lib/ClickHouse_Server.cpp +++ b/lib/ClickHouse_Server.cpp @@ -840,9 +840,8 @@ void ClickHouse_Server_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t } if ( - ( - (query_no_space_length > 40) && - strncasecmp("SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SC",query_no_space,strlen("SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SC") == 0)) + (query_no_space_length > 40) && + (strncasecmp("SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SC", query_no_space, strlen("SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SC")) == 0) ) { l_free(query_length,query); query=l_strdup("SELECT 'utf8_general_ci' AS DEFAULT_COLLATION_NAME"); From 0a9c1b6db82f7537d885f2946d7fb12e7e4c6a4f Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:13:51 +0000 Subject: [PATCH 11/19] fix pointer aritmetic --- lib/ProxySQL_GloVars.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ProxySQL_GloVars.cpp b/lib/ProxySQL_GloVars.cpp index 27db42425c..b01c62f893 100644 --- a/lib/ProxySQL_GloVars.cpp +++ b/lib/ProxySQL_GloVars.cpp @@ -228,13 +228,13 @@ ProxySQL_GlobalVariables::ProxySQL_GlobalVariables() : global.gr_bootstrap_ssl_key = nullptr; global.gr_bootstrap_ssl_mode = nullptr; global.ssl_keylog_enabled = false; - opt=new ez::ezOptionParser(); - opt->overview="High Performance Advanced Proxy for MySQL"; - opt->syntax="proxysql [OPTIONS]"; + opt = new ez::ezOptionParser(); + opt->overview = "High Performance Advanced Proxy for MySQL"; + opt->syntax = "proxysql [OPTIONS]"; std::string s = "\n\nProxySQL " ; - const char *build_year = __DATE__ + 7; + const char *build_year = &__DATE__[7]; s = s + "rev. " + PROXYSQL_VERSION + " -- " + __TIMESTAMP__ + "\nCopyright (C) 2013-" + string(build_year) + " ProxySQL LLC\nThis program is free and without warranty\n"; - opt->footer =s.c_str(); + opt->footer = s.c_str(); opt->add((const char *)"",0,0,0,(const char *)"Display usage instructions.",(const char *)"-h",(const char *)"-help",(const char *)"--help",(const char *)"--usage"); opt->add((const char *)"",0,0,0,(const char *)"Print version",(const char *)"-V",(const char *)"--version"); From 8aee52740f7594bd4a53b5f9ab42f69cf6f904d4 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:14:51 +0000 Subject: [PATCH 12/19] fix type casts --- lib/ProxySQL_Admin.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index f826157880..3a1239b340 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -4370,18 +4370,18 @@ void admin_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t *pkt) { } if (GloMTH->variables.ssl_p2s_ca == NULL && GloMTH->variables.ssl_p2s_capath == NULL) { - SPA->send_MySQL_ERR(&sess->client_myds->myprot, "'mysql-ssl_p2s_ca' and 'mysql-ssl_p2s_capath' have not been configured"); + SPA->send_MySQL_ERR(&sess->client_myds->myprot, (char *)"'mysql-ssl_p2s_ca' and 'mysql-ssl_p2s_capath' have not been configured"); break; } char msg[256]; uint64_t duration = 0ULL; if (SPA->ProxySQL_Test___CA_Certificate_Load_And_Verify(&duration, test_arg1, GloMTH->variables.ssl_p2s_ca, GloMTH->variables.ssl_p2s_capath)) { - sprintf(msg, "Took %llums in loading and verifying CA Certificate for %d times\n", duration, test_arg1); + sprintf(msg, "Took %lums in loading and verifying CA Certificate for %d times\n", duration, test_arg1); SPA->send_MySQL_OK(&sess->client_myds->myprot, msg); } else { - SPA->send_MySQL_ERR(&sess->client_myds->myprot, "Unable to verify CA Certificate"); + SPA->send_MySQL_ERR(&sess->client_myds->myprot, (char *)"Unable to verify CA Certificate"); } } break; From 9498508f2195dd06a22864ea161730ec2b4e891d Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:15:39 +0000 Subject: [PATCH 13/19] remove typedef --- include/gen_utils.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/gen_utils.h b/include/gen_utils.h index 95c1ec0107..4eb6e1c9c0 100644 --- a/include/gen_utils.h +++ b/include/gen_utils.h @@ -190,11 +190,11 @@ class PtrSizeArray { } }; -typedef struct { - void* data = nullptr; - size_t len = 0; +struct buffer_t { + void * data = nullptr; + size_t len = 0; size_t capacity = 0; -} buffer_t; +}; class FixedSizeQueue : public std::queue { private: From 321be9d414728d5bf4e9559d4c31a2c2741f0698 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:16:57 +0000 Subject: [PATCH 14/19] fix types --- include/btree.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/btree.h b/include/btree.h index 49310a2e44..bb22e0cf33 100644 --- a/include/btree.h +++ b/include/btree.h @@ -860,8 +860,8 @@ class btree : public Params::key_compare { typedef typename node_type::root_fields root_fields; typedef typename Params::is_key_compare_to is_key_compare_to; - friend class btree_internal_locate_plain_compare; - friend class btree_internal_locate_compare_to; + friend struct btree_internal_locate_plain_compare; + friend struct btree_internal_locate_compare_to; typedef typename if_< is_key_compare_to::value, btree_internal_locate_compare_to, From 434166e4277a8b0631b6cb34e88d2084c699f1bb Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 18:22:58 +0000 Subject: [PATCH 15/19] make containers privileged to be able to use sysctl vm.mmap_rnd_bits=28 for ASAN --- docker-compose.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 659595eb27..dc1935562e 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "2.0" +version: "3.0" services: #################################################################################################### @@ -6,6 +6,7 @@ services: _build: image: none network_mode: bridge + privileged: true environment: - MAKE - MAKEOPT From b0ef600a5af812b00a924637b5e4808d38da0161 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Tue, 12 Mar 2024 19:12:42 +0000 Subject: [PATCH 16/19] sudo sysctl vm.mmap_rnd_bits=28 for ASAN testing --- test/tap/tap/Makefile | 3 +++ test/tap/tests/Makefile | 3 +++ test/tap/tests_with_deps/deprecate_eof_support/Makefile | 3 +++ 3 files changed, 9 insertions(+) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index a79508ece9..39d6986f55 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -50,6 +50,9 @@ STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPL WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed $(WASAN) diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index ed0de23b3d..235c9a8540 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -148,6 +148,9 @@ endif WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address -DTEST_WITHASAN + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed -Wl,-rpath,$(TAP_LDIR) $(WGCOV) $(WASAN) -DGITVERSION=\"$(GIT_VERSION)\" diff --git a/test/tap/tests_with_deps/deprecate_eof_support/Makefile b/test/tap/tests_with_deps/deprecate_eof_support/Makefile index e800475998..a1d7192942 100644 --- a/test/tap/tests_with_deps/deprecate_eof_support/Makefile +++ b/test/tap/tests_with_deps/deprecate_eof_support/Makefile @@ -103,6 +103,9 @@ endif WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed -Wl,-rpath,"../../tap" $(WGCOV) $(WASAN) From 2f6e5b27a851f6cf78572d7a0bf868225ad35a4b Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Wed, 13 Mar 2024 13:33:23 +0000 Subject: [PATCH 17/19] Revert "remove generated files" This reverts commit ffcae7802a725373e6e4d7c3f591137f2877a71b. --- test/tap/tests/set_testing-t.csv | 98 +++++++++++++++++++++ test/tap/tests/set_testing-t.csv.obsolete | 102 ++++++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 test/tap/tests/set_testing-t.csv create mode 100644 test/tap/tests/set_testing-t.csv.obsolete diff --git a/test/tap/tests/set_testing-t.csv b/test/tap/tests/set_testing-t.csv new file mode 100644 index 0000000000..aa0f8d348d --- /dev/null +++ b/test/tap/tests/set_testing-t.csv @@ -0,0 +1,98 @@ +"set character_set_results=null; set names latin7; set character_set_client='utf8mb4';", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'utf8mb4'}" +"set names latin2", "{'character_set_results':'latin2', 'collation_connection':'latin2_general_ci', 'character_set_connection':'latin2', 'character_set_client':'latin2'}" +"set names utf8mb4", "{'character_set_results':'utf8mb4', 'collation_connection':'utf8mb4_general_ci', 'character_set_connection':'utf8mb4', 'character_set_client':'utf8mb4'}" +"set character_set_client='utf8mb4'; set names utf8; set character_set_connection='latin1';", "{'character_set_results':'utf8', 'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1', 'character_set_client':'utf8'}" +"set character_set_database='latin1'; set character_set_connection='utf8mb4'; set names utf8; set character_set_client='latin1';", "{'character_set_database':'latin1', 'character_set_results':'utf8', 'collation_connection':'utf8_general_ci', 'character_set_connection':'utf8', 'character_set_client':'latin1'}" +"set character_set_connection='utf8mb4'; set names utf8; set character_set_client='latin1'; set collation_connection='latin1_swedish_ci';", "{'character_set_results':'utf8', 'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1', 'character_set_client':'latin1'}""set names latin7", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'latin7'}" +"set collation_connection='utf8mb4_general_ci'; ", "{'collation_connection':'utf8mb4_general_ci', 'character_set_connection':'utf8mb4'}" +"set collation_connection='latin1_danish_ci'; ", "{'collation_connection':'latin1_danish_ci', 'character_set_connection':'latin1'}" +"set collation_connection='latin1_swedish_ci'", "{'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1'}" +"set collation_connection='utf8_general_ci'", "{'collation_connection':'utf8_general_ci', 'character_set_connection':'utf8'}" +"SET collation_connection='latin1_swedish_ci'", "{'character_set_connection':'latin1', 'collation_connection':'latin1_swedish_ci'}" +"SET collation_connection='utf8_general_ci'", "{'character_set_connection':'utf8', 'collation_connection':'utf8_general_ci'}" +"SET collation_connection='utf8mb4_general_ci'", "{'character_set_connection':'utf8mb4', 'collation_connection':'utf8mb4_general_ci'}" +"SET character_set_connection='latin1'", "{'character_set_connection':'latin1', 'collation_connection':'latin1_swedish_ci'}" +"SET character_set_connection='utf8'", "{'character_set_connection':'utf8', 'collation_connection':'utf8_general_ci'}" +"SET character_set_connection='utf8mb4'", "{'character_set_connection':'utf8mb4', 'collation_connection':'utf8mb4_general_ci'}" +"SET character_set_results='latin1'", "{'character_set_results':'latin1'}" +"SET character_set_results='binary'", "{'character_set_results':'binary'}" +"SET character_set_results=NULL", "{'character_set_results':''}" +"SET character_set_results='utf8'", "{'character_set_results':'utf8'}" +"SET character_set_results='utf8mb4'", "{'character_set_results':'utf8mb4'}" +"SET character_set_client='latin1'", "{'character_set_client':'latin1'}" +"SET character_set_client='utf8'", "{'character_set_client':'utf8'}" +"SET character_set_client='utf8mb4'", "{'character_set_client':'utf8mb4'}" +"SET character_set_database='latin1'; ", "{'character_set_database':'latin1'}" +"SET character_set_database='utf8'", "{'character_set_database':'utf8'}" +"SET character_set_database='utf8mb4'", "{'character_set_database':'utf8mb4'}" +"SET sql_log_bin=1", "{'sql_log_bin':'ON'}" +"SET sql_log_bin=0", "{'sql_log_bin':'OFF'}" +"set sql_mode=''","{'sql_mode':''}" +"SET sql_mode='PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'", "{'sql_mode':'PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'}" +"SET time_zone='+01:00'","{'time_zone':'+01:00'}" +"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}" +"SET sql_safe_updates='OFF'", "{'sql_safe_updates':'OFF'}" +"SET sql_safe_updates='ON'", "{'sql_safe_updates':'ON'}" +"SET sql_safe_updates=0", "{'sql_safe_updates':'OFF'}" +"SET sql_safe_updates=1", "{'sql_safe_updates':'ON'}" +"SET sql_select_limit=1010", "{'sql_select_limit':'1010'}" +"SET sql_select_limit=2020", "{'sql_select_limit':'2020'}" +"SET sql_select_limit=3030", "{'sql_select_limit':'3030'}" +"SET time_zone='+01:00'; ","{'time_zone':'+01:00'}" +"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'; ","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'; ", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}" +"SET sql_safe_updates='OFF'; ", "{'sql_safe_updates':'OFF'}" +"SET sql_safe_updates='ON'; ", "{'sql_safe_updates':'ON'}" +"SET sql_safe_updates=0; ", "{'sql_safe_updates':'OFF'}" +"SET sql_safe_updates=1; ", "{'sql_safe_updates':'ON'}" +"SET sql_select_limit=1010; ", "{'sql_select_limit':'1010'}" +"SET sql_select_limit=2020; ", "{'sql_select_limit':'2020'}" +"SET sql_select_limit=3030; ", "{'sql_select_limit':'3030'}" +"SET session transaction read only", "{'transaction_read_only':'ON'}" +"SET session transaction read write", "{'transaction_read_only':'OFF'}" +"SET session transaction isolation level READ COMMITTED", "{'transaction_isolation':'READ-COMMITTED'}" +"SET session transaction isolation level READ UNCOMMITTED", "{'transaction_isolation':'READ-UNCOMMITTED'}" +"SET session transaction isolation level REPEATABLE READ", "{'transaction_isolation':'REPEATABLE-READ'}" +"SET session transaction isolation level SERIALIZABLE", "{'transaction_isolation':'SERIALIZABLE'}" +"SET tx_isolation='READ-COMMITTED'", "{'transaction_isolation':'READ-COMMITTED'}" +"SET tx_isolation='READ-UNCOMMITTED'", "{'transaction_isolation':'READ-UNCOMMITTED'}" +"SET tx_isolation='REPEATABLE-READ'", "{'transaction_isolation':'REPEATABLE-READ'}" +"SET tx_isolation='SERIALIZABLE'", "{'transaction_isolation':'SERIALIZABLE'}" +"SET session_track_gtids=OFF", "{'session_track_gtids':'OFF'}" +"SET session_track_gtids=OWN_GTID", "{'session_track_gtids':'OWN_GTID'}" +"SET sql_auto_is_null=OFF", "{'sql_auto_is_null':'OFF'}" +"SET sql_auto_is_null=ON", "{'sql_auto_is_null':'ON'}" +"set max_join_size=20000", "{'max_join_size':'20000'}" +"set max_join_size=10000", "{'max_join_size':'10000'}" +"set max_join_size=18446744073709551615", "{'max_join_size':'18446744073709551615'}" +"set wsrep_sync_wait=1", "{'wsrep_sync_wait':'1'}" +"set wsrep_sync_wait=0", "{'wsrep_sync_wait':'0'}" +"set group_concat_max_len=2048", "{'group_concat_max_len':'2048'}" +"set group_concat_max_len=4096", "{'group_concat_max_len':'4096'}" +"set tx_isolation='READ-COMMITTED', group_concat_max_len=4096", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'4096'}" +"set tx_isolation='READ-COMMITTED', group_concat_max_len=2048", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'2048'}" +"set group_concat_max_len=4096; ", "{'group_concat_max_len':'4096'}" +"SET character_set_database='utf8mb4', max_join_size=10000; ", "{'character_set_database':'utf8mb4', 'max_join_size':'10000'}" +"SET character_set_database='utf8mb4', max_join_size=10000, session_track_gtids=OWN_GTID; ", "{'character_set_database':'utf8mb4', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" +"SET sql_select_limit=3030, session_track_gtids=OWN_GTID; SET max_join_size=10000; ", "{'sql_select_limit':'3030', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" +"SET sql_mode='NO_ENGINE_SUBSTITUTION', sql_select_limit=3030, session_track_gtids=OWN_GTID; SET max_join_size=10000; ", "{'sql_mode':'NO_ENGINE_SUBSTITUTION','sql_select_limit':'3030', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" +"SET character_set_client='utf8', sql_select_limit=3030, max_join_size=18446744073709551615", "{'character_set_client':'utf8', 'sql_select_limit':'3030', 'max_join_size':'18446744073709551615'}" +"SET sql_select_limit=3030, character_set_client='latin1', max_join_size=10000", "{'sql_select_limit':'3030', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"SET session_track_gtids=OFF", "{'session_track_gtids':'OFF'}" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1', max_join_size=10000", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"SET character_set_results='binary', sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1', max_join_size=10000", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"SET character_set_results='binary', max_join_size=10000, sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1'; ", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"SET CHARACTER SET utf8", "{'character_set_results':'utf8', 'character_set_client':'utf8'}", "['character_set_connection', 'collation_connection']" +"SET CHARACTER SET 'utf8'", "{'character_set_results':'utf8', 'character_set_client':'utf8'}", "['character_set_connection', 'collation_connection']" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', max_join_size=10000; SET CHARACTER SET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', max_join_size=10000; SET CHARSET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" +"SET session_track_gtids=ALL_GTIDS", "{'session_track_gtids':'ALL_GTIDS'}" +"SET sql_safe_updates=1, session_track_schema=1, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES')", "{'sql_safe_updates':'ON', 'sql_mode':'concat(@@sql_mode,\',STRICT_TRANS_TABLES\')'}" +"set `group_concat_max_len`=4096", "{'group_concat_max_len':'4096'}" +"SET `sql_select_limit`=3030; ", "{'sql_select_limit':'3030'}" +"SET `time_zone`='+04:00', `sql_mode`='NO_ENGINE_SUBSTITUTION', `max_join_size`=10000; SET CHARACTER SET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" +"SET `character_set_results`='binary', `sql_mode`='NO_ENGINE_SUBSTITUTION', `character_set_client`='latin1', `max_join_size`=10000", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"set `tx_isolation`='READ-COMMITTED', `group_concat_max_len`=4096", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'4096'}" +"SET `sql_auto_is_null`=ON", "{'sql_auto_is_null':'ON'}" +"set `character_set_results`=null; set names latin7; set `character_set_client`='utf8mb4';", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'utf8mb4'}" diff --git a/test/tap/tests/set_testing-t.csv.obsolete b/test/tap/tests/set_testing-t.csv.obsolete new file mode 100644 index 0000000000..d7403e1399 --- /dev/null +++ b/test/tap/tests/set_testing-t.csv.obsolete @@ -0,0 +1,102 @@ +"set character_set_results=null; set names latin7; set character_set_client='utf8mb4';", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'utf8mb4'}" +"set names latin2", "{'character_set_results':'latin2', 'collation_connection':'latin2_general_ci', 'character_set_connection':'latin2', 'character_set_client':'latin2'}" +"set names utf8mb4", "{'character_set_results':'utf8mb4', 'collation_connection':'utf8mb4_general_ci', 'character_set_connection':'utf8mb4', 'character_set_client':'utf8mb4'}" +"set character_set_client='utf8mb4'; set names utf8; set character_set_connection='latin1';", "{'character_set_results':'utf8', 'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1', 'character_set_client':'utf8'}" +"set character_set_database='latin1'; set character_set_connection='utf8mb4'; set names utf8; set character_set_client='latin1';", "{'character_set_database':'latin1', 'character_set_results':'utf8', 'collation_connection':'utf8_general_ci', 'character_set_connection':'utf8', 'character_set_client':'latin1'}" +"set character_set_connection='utf8mb4'; set names utf8; set character_set_client='latin1'; set collation_connection='latin1_swedish_ci';", "{'character_set_results':'utf8', 'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1', 'character_set_client':'latin1'}""set names latin7", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'latin7'}" +"set collation_connection='utf8mb4_general_ci'; ", "{'collation_connection':'utf8mb4_general_ci', 'character_set_connection':'utf8mb4'}" +"set collation_connection='latin1_danish_ci'; ", "{'collation_connection':'latin1_danish_ci', 'character_set_connection':'latin1'}" +"set collation_connection='latin1_swedish_ci'", "{'collation_connection':'latin1_swedish_ci', 'character_set_connection':'latin1'}" +"set collation_connection='utf8_general_ci'", "{'collation_connection':'utf8_general_ci', 'character_set_connection':'utf8'}" +"SET collation_connection='latin1_swedish_ci'", "{'character_set_connection':'latin1', 'collation_connection':'latin1_swedish_ci'}" +"SET collation_connection='utf8_general_ci'", "{'character_set_connection':'utf8', 'collation_connection':'utf8_general_ci'}" +"SET collation_connection='utf8mb4_general_ci'", "{'character_set_connection':'utf8mb4', 'collation_connection':'utf8mb4_general_ci'}" +"SET character_set_connection='latin1'", "{'character_set_connection':'latin1', 'collation_connection':'latin1_swedish_ci'}" +"SET character_set_connection='utf8'", "{'character_set_connection':'utf8', 'collation_connection':'utf8_general_ci'}" +"SET character_set_connection='utf8mb4'", "{'character_set_connection':'utf8mb4', 'collation_connection':'utf8mb4_general_ci'}" +"SET character_set_results='latin1'", "{'character_set_results':'latin1'}" +"SET character_set_results='binary'", "{'character_set_results':'binary'}" +"SET character_set_results=NULL", "{'character_set_results':''}" +"SET character_set_results='utf8'", "{'character_set_results':'utf8'}" +"SET character_set_results='utf8mb4'", "{'character_set_results':'utf8mb4'}" +"SET character_set_client='latin1'", "{'character_set_client':'latin1'}" +"SET character_set_client='utf8'", "{'character_set_client':'utf8'}" +"SET character_set_client='utf8mb4'", "{'character_set_client':'utf8mb4'}" +"SET character_set_database='latin1'; ", "{'character_set_database':'latin1'}" +"SET character_set_database='utf8'", "{'character_set_database':'utf8'}" +"SET character_set_database='utf8mb4'", "{'character_set_database':'utf8mb4'}" +"SET sql_log_bin=1", "{'sql_log_bin':'ON'}" +"SET sql_log_bin=0", "{'sql_log_bin':'OFF'}" +"set sql_mode=''","{'sql_mode':''}" +"SET sql_mode='PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'", "{'sql_mode':'PIPES_AS_CONCAT,NO_ENGINE_SUBSTITUTION'}" +"SET time_zone='+01:00'","{'time_zone':'+01:00'}" +"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}" +"SET sql_safe_updates='OFF'", "{'sql_safe_updates':'OFF'}" +"SET sql_safe_updates='ON'", "{'sql_safe_updates':'ON'}" +"SET sql_safe_updates=0", "{'sql_safe_updates':'OFF'}" +"SET sql_safe_updates=1", "{'sql_safe_updates':'ON'}" +"SET sql_select_limit=1010", "{'sql_select_limit':'1010'}" +"SET sql_select_limit=2020", "{'sql_select_limit':'2020'}" +"SET sql_select_limit=3030", "{'sql_select_limit':'3030'}" +"SET time_zone='+01:00'; ","{'time_zone':'+01:00'}" +"SET time_zone='-03:00', sql_mode='ALLOW_INVALID_DATES'; ","{'time_zone':'-03:00', 'sql_mode':'ALLOW_INVALID_DATES'}" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION'; ", "{'time_zone':'+04:00','sql_mode':'NO_ENGINE_SUBSTITUTION'}" +"SET sql_safe_updates='OFF'; ", "{'sql_safe_updates':'OFF'}" +"SET sql_safe_updates='ON'; ", "{'sql_safe_updates':'ON'}" +"SET sql_safe_updates=0; ", "{'sql_safe_updates':'OFF'}" +"SET sql_safe_updates=1; ", "{'sql_safe_updates':'ON'}" +"SET sql_select_limit=1010; ", "{'sql_select_limit':'1010'}" +"SET sql_select_limit=2020; ", "{'sql_select_limit':'2020'}" +"SET sql_select_limit=3030; ", "{'sql_select_limit':'3030'}" +"SET session transaction read only", "{'transaction_read_only':'ON'}" +"SET session transaction read write", "{'transaction_read_only':'OFF'}" +"SET session transaction isolation level READ COMMITTED", "{'transaction_isolation':'READ-COMMITTED'}" +"SET session transaction isolation level READ UNCOMMITTED", "{'transaction_isolation':'READ-UNCOMMITTED'}" +"SET session transaction isolation level REPEATABLE READ", "{'transaction_isolation':'REPEATABLE-READ'}" +"SET session transaction isolation level SERIALIZABLE", "{'transaction_isolation':'SERIALIZABLE'}" +"SET tx_isolation='READ-COMMITTED'", "{'transaction_isolation':'READ-COMMITTED'}" +"SET tx_isolation='READ-UNCOMMITTED'", "{'transaction_isolation':'READ-UNCOMMITTED'}" +"SET tx_isolation='REPEATABLE-READ'", "{'transaction_isolation':'REPEATABLE-READ'}" +"SET tx_isolation='SERIALIZABLE'", "{'transaction_isolation':'SERIALIZABLE'}" +"SET session_track_gtids=OFF", "{'session_track_gtids':'OFF'}" +"SET session_track_gtids=OWN_GTID", "{'session_track_gtids':'OWN_GTID'}" +"SET sql_auto_is_null=OFF", "{'sql_auto_is_null':'OFF'}" +"SET sql_auto_is_null=ON", "{'sql_auto_is_null':'ON'}" +"set net_write_timeout=30", "{'net_write_timeout':'30'}" +"set net_write_timeout=60", "{'net_write_timeout':'60'}" +"set net_write_timeout=90", "{'net_write_timeout':'90'}" +"set max_join_size=20000", "{'max_join_size':'20000'}" +"set max_join_size=10000", "{'max_join_size':'10000'}" +"set max_join_size=18446744073709551615", "{'max_join_size':'18446744073709551615'}" +"set wsrep_sync_wait=1", "{'wsrep_sync_wait':'1'}" +"set wsrep_sync_wait=0", "{'wsrep_sync_wait':'0'}" +"set group_concat_max_len=2048", "{'group_concat_max_len':'2048'}" +"set group_concat_max_len=4096", "{'group_concat_max_len':'4096'}" +"set tx_isolation='READ-COMMITTED', group_concat_max_len=4096", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'4096'}" +"set tx_isolation='READ-COMMITTED', group_concat_max_len=2048, net_write_timeout=30", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'2048', 'net_write_timeout':'30'}" +"set group_concat_max_len=4096; ", "{'group_concat_max_len':'4096'}" +"SET character_set_database='utf8mb4', max_join_size=10000; ", "{'character_set_database':'utf8mb4', 'max_join_size':'10000'}" +"SET character_set_database='utf8mb4', max_join_size=10000, session_track_gtids=OWN_GTID; ", "{'character_set_database':'utf8mb4', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" +"SET sql_select_limit=3030, session_track_gtids=OWN_GTID; SET max_join_size=10000; ", "{'sql_select_limit':'3030', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" +"SET sql_mode='NO_ENGINE_SUBSTITUTION', sql_select_limit=3030, session_track_gtids=OWN_GTID; SET max_join_size=10000; ", "{'sql_mode':'NO_ENGINE_SUBSTITUTION','sql_select_limit':'3030', 'max_join_size':'10000', 'session_track_gtids':'OWN_GTID'}" +"SET character_set_client='utf8', sql_select_limit=3030, max_join_size=18446744073709551615", "{'character_set_client':'utf8', 'sql_select_limit':'3030', 'max_join_size':'18446744073709551615'}" +"SET sql_select_limit=3030, character_set_client='latin1', max_join_size=10000", "{'sql_select_limit':'3030', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"SET session_track_gtids=OFF", "{'session_track_gtids':'OFF'}" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1', max_join_size=10000", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"SET character_set_results='binary', sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1', max_join_size=10000", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"SET character_set_results='binary', max_join_size=10000, sql_mode='NO_ENGINE_SUBSTITUTION', character_set_client='latin1'; ", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"SET CHARACTER SET utf8", "{'character_set_results':'utf8', 'character_set_client':'utf8'}", "['character_set_connection', 'collation_connection']" +"SET CHARACTER SET 'utf8'", "{'character_set_results':'utf8', 'character_set_client':'utf8'}", "['character_set_connection', 'collation_connection']" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', max_join_size=10000; SET CHARACTER SET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" +"SET time_zone='+04:00', sql_mode='NO_ENGINE_SUBSTITUTION', max_join_size=10000; SET CHARSET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" +"SET session_track_gtids=ALL_GTIDS", "{'session_track_gtids':'ALL_GTIDS'}" +"SET sql_safe_updates=1, session_track_schema=1, sql_mode = concat(@@sql_mode,',STRICT_TRANS_TABLES')", "{'sql_safe_updates':'ON', 'sql_mode':'concat(@@sql_mode,\',STRICT_TRANS_TABLES\')'}" +"set `group_concat_max_len`=4096", "{'group_concat_max_len':'4096'}" +"SET `sql_select_limit`=3030; ", "{'sql_select_limit':'3030'}" +"SET `time_zone`='+04:00', `sql_mode`='NO_ENGINE_SUBSTITUTION', `max_join_size`=10000; SET CHARACTER SET 'latin1'", "{'time_zone':'+04:00', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'max_join_size':'10000', 'character_set_results':'latin1', 'character_set_client':'latin1'}", "['character_set_connection', 'collation_connection']" +"SET `character_set_results`='binary', `sql_mode`='NO_ENGINE_SUBSTITUTION', `character_set_client`='latin1', `max_join_size`=10000", "{'character_set_results':'binary', 'sql_mode':'NO_ENGINE_SUBSTITUTION', 'character_set_client':'latin1', 'max_join_size':'10000'}" +"set `tx_isolation`='READ-COMMITTED', `group_concat_max_len`=4096", "{'transaction_isolation':'READ-COMMITTED', 'group_concat_max_len':'4096'}" +"set `net_write_timeout`=30", "{'net_write_timeout':'30'}" +"SET `sql_auto_is_null`=ON", "{'sql_auto_is_null':'ON'}" +"set `character_set_results`=null; set names latin7; set `character_set_client`='utf8mb4';", "{'character_set_results':'latin7', 'collation_connection':'latin7_general_ci', 'character_set_connection':'latin7', 'character_set_client':'utf8mb4'}" From f6aea2f5f3311cf88d3d1c677d7a14839751ad76 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 14 Mar 2024 10:25:13 +0000 Subject: [PATCH 18/19] fix Makefile identations --- Makefile | 4 ++-- deps/Makefile | 2 +- lib/Makefile | 8 ++++---- src/Makefile | 4 ++-- test/tap/tap/Makefile | 4 ++-- test/tap/tests/Makefile | 8 ++++---- test/tap/tests_with_deps/deprecate_eof_support/Makefile | 4 ++-- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 9084e73915..47e32c2723 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ GIT_VERSION ?= $(shell git describe --long --abbrev=7) ifndef GIT_VERSION -$(error GIT_VERSION is not set) + $(error GIT_VERSION is not set) endif ### NOTES: @@ -47,7 +47,7 @@ ifneq ($(CPLUSPLUS),201703L) CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') LEGACY_BUILD := 1 ifneq ($(CPLUSPLUS),201103L) - $(error Compiler must support at least c++11) + $(error Compiler must support at least c++11) endif endif STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPLUSPLUS) | cut -c3-4) diff --git a/deps/Makefile b/deps/Makefile index 7fa0cec5b7..2b28c2cec3 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -32,7 +32,7 @@ CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep ifneq ($(CPLUSPLUS),201703L) CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') ifneq ($(CPLUSPLUS),201103L) - $(error Compiler must support at least c++11) + $(error Compiler must support at least c++11) endif endif STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPLUSPLUS) | cut -c3-4) diff --git a/lib/Makefile b/lib/Makefile index c752ff254c..b9f61c6cd0 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -3,7 +3,7 @@ GIT_VERSION ?= $(shell git describe --long --abbrev=7) ifndef GIT_VERSION - $(error GIT_VERSION is not set) + $(error GIT_VERSION is not set) endif DEPS_PATH := ../deps @@ -95,7 +95,7 @@ CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep ifneq ($(CPLUSPLUS),201703L) CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') ifneq ($(CPLUSPLUS),201103L) -$(error Compiler must support at least c++11) + $(error Compiler must support at least c++11) endif endif STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPLUSPLUS) | cut -c3-4) @@ -122,8 +122,8 @@ default: libproxysql.a .PHONY: default _OBJ_CXX := ProxySQL_GloVars.oo network.oo debug.oo configfile.oo Query_Cache.oo SpookyV2.oo MySQL_Authentication.oo gen_utils.oo sqlite3db.oo mysql_connection.oo MySQL_HostGroups_Manager.oo mysql_data_stream.oo MySQL_Thread.oo MySQL_Session.oo MySQL_Protocol.oo mysql_backend.oo Query_Processor.oo ProxySQL_Admin.oo ProxySQL_Config.oo ProxySQL_Restapi.oo MySQL_Monitor.oo MySQL_Logger.oo thread.oo MySQL_PreparedStatement.oo ProxySQL_Cluster.oo ClickHouse_Authentication.oo ClickHouse_Server.oo ProxySQL_Statistics.oo Chart_bundle_js.oo ProxySQL_HTTP_Server.oo ProxySQL_RESTAPI_Server.oo font-awesome.min.css.oo main-bundle.min.css.oo set_parser.oo MySQL_Variables.oo c_tokenizer.oo proxysql_utils.oo proxysql_coredump.oo proxysql_sslkeylog.oo \ - sha256crypt.oo \ - proxysql_find_charset.oo ProxySQL_Poll.oo + sha256crypt.oo \ + proxysql_find_charset.oo ProxySQL_Poll.oo OBJ_CXX := $(patsubst %,$(ODIR)/%,$(_OBJ_CXX)) HEADERS := ../include/*.h ../include/*.hpp diff --git a/src/Makefile b/src/Makefile index 52a3d626ee..67ea80f12d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,7 +3,7 @@ GIT_VERSION ?= $(shell git describe --long --abbrev=7) ifndef GIT_VERSION - $(error GIT_VERSION is not set) + $(error GIT_VERSION is not set) endif CENTOSVER := Unknown @@ -109,7 +109,7 @@ CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep ifneq ($(CPLUSPLUS),201703L) CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') ifneq ($(CPLUSPLUS),201103L) -$(error Compiler must support at least c++11) + $(error Compiler must support at least c++11) endif endif STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPLUSPLUS) | cut -c3-4) diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 39d6986f55..627fde406d 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -3,7 +3,7 @@ GIT_VERSION ?= $(shell git describe --long --abbrev=7) ifndef GIT_VERSION - $(error GIT_VERSION is not set) + $(error GIT_VERSION is not set) endif @@ -42,7 +42,7 @@ CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep ifneq ($(CPLUSPLUS),201703L) CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') ifneq ($(CPLUSPLUS),201103L) - $(error Compiler must support at least c++11) + $(error Compiler must support at least c++11) endif endif STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPLUSPLUS) | cut -c3-4) diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 235c9a8540..965146eeeb 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -3,7 +3,7 @@ GIT_VERSION ?= $(shell git describe --long --abbrev=7) ifndef GIT_VERSION - $(error GIT_VERSION is not set) + $(error GIT_VERSION is not set) endif @@ -126,8 +126,8 @@ STATIC_LIBS := $(CITYHASH_LDIR)/libcityhash.a LIBCOREDUMPERAR := ifeq ($(UNAME_S),Linux) - LIBCOREDUMPERAR := $(COREDUMPER_LDIR)/libcoredumper.a - STATIC_LIBS += $(LIBCOREDUMPERAR) + LIBCOREDUMPERAR := $(COREDUMPER_LDIR)/libcoredumper.a + STATIC_LIBS += $(LIBCOREDUMPERAR) endif ### detect compiler support for c++11/17 @@ -135,7 +135,7 @@ CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep ifneq ($(CPLUSPLUS),201703L) CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') ifneq ($(CPLUSPLUS),201103L) - $(error Compiler must support at least c++11) + $(error Compiler must support at least c++11) endif endif STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPLUSPLUS) | cut -c3-4) diff --git a/test/tap/tests_with_deps/deprecate_eof_support/Makefile b/test/tap/tests_with_deps/deprecate_eof_support/Makefile index a1d7192942..16fcbf35b8 100644 --- a/test/tap/tests_with_deps/deprecate_eof_support/Makefile +++ b/test/tap/tests_with_deps/deprecate_eof_support/Makefile @@ -3,7 +3,7 @@ GIT_VERSION ?= $(shell git describe --long --abbrev=7) ifndef GIT_VERSION - $(error GIT_VERSION is not set) + $(error GIT_VERSION is not set) endif @@ -90,7 +90,7 @@ CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep ifneq ($(CPLUSPLUS),201703L) CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') ifneq ($(CPLUSPLUS),201103L) - $(error Compiler must support at least c++11) + $(error Compiler must support at least c++11) endif endif STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPLUSPLUS) | cut -c3-4) From 8a0e326ce54c26fa86ec1035c6eefa6b1069cb10 Mon Sep 17 00:00:00 2001 From: Miro Stauder Date: Thu, 14 Mar 2024 10:26:24 +0000 Subject: [PATCH 19/19] warn about ASAN limitation ASLR > 28bits --- lib/Makefile | 4 ++++ src/Makefile | 4 ++++ test/tap/tap/Makefile | 5 ++++- test/tap/tests/Makefile | 5 ++++- test/tap/tests_with_deps/deprecate_eof_support/Makefile | 5 ++++- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/Makefile b/lib/Makefile index b9f61c6cd0..b94dd2fc65 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -77,6 +77,10 @@ ifeq ($(WITHASAN),1) WASAN := -fsanitize=address # Force the disable of JEMALLOC, since ASAN isn't compatible. export NOJEMALLOC=1 + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif NOJEM := diff --git a/src/Makefile b/src/Makefile index 67ea80f12d..0d2e577cf2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -140,6 +140,10 @@ ifeq ($(WITHASAN),1) WASAN := -fsanitize=address # Force the disable of JEMALLOC, since ASAN isn't compatible. export NOJEMALLOC=1 + # workaroud ASAN limitation ASLR > 28bits + # https://github.com/google/sanitizers/issues/1716 + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif ifeq ($(TEST_WITHASAN),1) WASAN += -DTEST_WITHASAN diff --git a/test/tap/tap/Makefile b/test/tap/tap/Makefile index 627fde406d..b4650be943 100644 --- a/test/tap/tap/Makefile +++ b/test/tap/tap/Makefile @@ -50,9 +50,12 @@ STDCPP := -std=c++$(shell echo $(CPLUSPLUS) | cut -c3-4) -DCXX$(shell echo $(CPL WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address + # Force the disable of JEMALLOC, since ASAN isn't compatible. + export NOJEMALLOC=1 # workaroud ASAN limitation ASLR > 28bits # https://github.com/google/sanitizers/issues/1716 - DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed $(WASAN) diff --git a/test/tap/tests/Makefile b/test/tap/tests/Makefile index 965146eeeb..b1f73e5c0b 100644 --- a/test/tap/tests/Makefile +++ b/test/tap/tests/Makefile @@ -148,9 +148,12 @@ endif WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address -DTEST_WITHASAN + # Force the disable of JEMALLOC, since ASAN isn't compatible. + export NOJEMALLOC=1 # workaroud ASAN limitation ASLR > 28bits # https://github.com/google/sanitizers/issues/1716 - DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed -Wl,-rpath,$(TAP_LDIR) $(WGCOV) $(WASAN) -DGITVERSION=\"$(GIT_VERSION)\" diff --git a/test/tap/tests_with_deps/deprecate_eof_support/Makefile b/test/tap/tests_with_deps/deprecate_eof_support/Makefile index 16fcbf35b8..b4060cdb18 100644 --- a/test/tap/tests_with_deps/deprecate_eof_support/Makefile +++ b/test/tap/tests_with_deps/deprecate_eof_support/Makefile @@ -103,9 +103,12 @@ endif WASAN := ifeq ($(WITHASAN),1) WASAN := -fsanitize=address + # Force the disable of JEMALLOC, since ASAN isn't compatible. + export NOJEMALLOC=1 # workaroud ASAN limitation ASLR > 28bits # https://github.com/google/sanitizers/issues/1716 - DUMMY := $(shell sudo sysctl vm.mmap_rnd_bits=28) + # sudo sysctl vm.mmap_rnd_bits=28 + $(warning ASAN needs ASLR =< 28bits, make sure 'sysctl vm.mmap_rnd_bits=28' is set.) endif OPT := $(STDCPP) -O2 -ggdb -Wl,--no-as-needed -Wl,-rpath,"../../tap" $(WGCOV) $(WASAN)