diff --git a/test/tap/tests/clickhouse_php_conn-t.php b/test/tap/tests/clickhouse_php_conn-t.php index 259e919b1..d06360f5a 100644 --- a/test/tap/tests/clickhouse_php_conn-t.php +++ b/test/tap/tests/clickhouse_php_conn-t.php @@ -56,8 +56,8 @@ echo ":: ProxySQL connection completed".PHP_EOL; echo ":: Starting schema and table creation...".PHP_EOL; if ($port !== 6090) { - $proxy->query("CREATE DATABASE IF NOT EXISTS test_clickhouse_types_php"); - $proxy->query("USE test_clickhouse_types_php"); + $proxy->query("CREATE DATABASE IF NOT EXISTS test"); + $proxy->query("USE test"); $proxy->query("DROP TABLE IF EXISTS types_table"); $proxy->query("CREATE TABLE IF NOT EXISTS types_table (EventDate DATE, DateTime DATETIME, col1 TINYINT, col2 SMALLINT, col3 INT, col4 BIGINT, col5 FLOAT, col6 DOUBLE)"); @@ -80,8 +80,8 @@ if ($port !== 6090) { echo ":: Finished operations on MySQL conn".PHP_EOL; exit(0); } else { - $proxy->query("CREATE DATABASE IF NOT EXISTS test_clickhouse_types_php"); - $proxy->query("USE test_clickhouse_types_php"); + $proxy->query("CREATE DATABASE IF NOT EXISTS test"); + $proxy->query("USE test"); $proxy->query("DROP TABLE IF EXISTS types_table"); $proxy->query("CREATE TABLE IF NOT EXISTS types_table (EventDate DATE, DateTime DATETIME, col1 UInt8, col2 Int16, col3 Int32, col4 Int64, col5 Nullable(Float32), col6 Float64) ENGINE=MergeTree(EventDate, (EventDate), 8192)"); } @@ -266,7 +266,7 @@ foreach ($exp_rows as $exp_row) { $exit_code |= !($types_match & $vals_match); } -$proxy->query("DROP DATABASE IF EXISTS test_clickhouse_types_php"); +$proxy->query("DROP DATABASE IF EXISTS test"); $result->free(); exit($exit_code); diff --git a/test/tap/tests/reg_test_3493-USE_with_comment-t.cpp b/test/tap/tests/reg_test_3493-USE_with_comment-t.cpp index 9ae225108..064920359 100644 --- a/test/tap/tests/reg_test_3493-USE_with_comment-t.cpp +++ b/test/tap/tests/reg_test_3493-USE_with_comment-t.cpp @@ -6,7 +6,7 @@ * test performs the following actions: * * 1. Open a MYSQL connection to ProxySQL. - * 2. Drops and creates multiple databases called 'reg_test_3493_use_comment-N'. + * 2. Drops and creates multiple databases called 'test_use_comment-N'. * 3. Performs a 'USE' statement in the connection. * 3. Checks the currently selected database in **a new backend database connection** by means of the * connection annotation "create_new_connection=1". This way it's ensured that ProxySQL is properly keeping @@ -176,21 +176,21 @@ int main(int argc, char** argv) { MYSQL* proxysql_mysql = mysql_init(NULL); - db_query.push_back(std::make_tuple("reg_test_3493_use_comment", "/*+ placeholder_comment */ USE reg_test_3493_use_comment", false)); - db_query.push_back(std::make_tuple("`reg_test_3493_use_comment-a1`", "USE /*+ placeholder_comment */ `reg_test_3493_use_comment-a1`", true)); - db_query.push_back(std::make_tuple("reg_test_3493_use_comment_1", " USE /*+ placeholder_comment */ `reg_test_3493_use_comment_1`", false)); - db_query.push_back(std::make_tuple("reg_test_3493_use_comment_2", "USE/*+ placeholder_comment */ `reg_test_3493_use_comment_2`", false)); - db_query.push_back(std::make_tuple("reg_test_3493_use_comment_3", "USE /*+ placeholder_comment */`reg_test_3493_use_comment_3`", true)); - db_query.push_back(std::make_tuple("reg_test_3493_use_comment_4", " USE /*+ placeholder_comment */ reg_test_3493_use_comment_4", false)); - db_query.push_back(std::make_tuple("reg_test_3493_use_comment_5", "USE/*+ placeholder_comment */ reg_test_3493_use_comment_5", false)); - db_query.push_back(std::make_tuple("reg_test_3493_use_comment_6", "USE /*+ placeholder_comment */reg_test_3493_use_comment_6", true)); - db_query.push_back(std::make_tuple("`reg_test_3493_use_comment-1`", " USE /*+ placeholder_comment */ `reg_test_3493_use_comment-1`", false)); - db_query.push_back(std::make_tuple("`reg_test_3493_use_comment-2`", "USE/*+ placeholder_comment */ `reg_test_3493_use_comment-2`", false)); - db_query.push_back(std::make_tuple("`reg_test_3493_use_comment-3`", "USE /*+ placeholder_comment */`reg_test_3493_use_comment-3`", true)); - db_query.push_back(std::make_tuple("`reg_test_3493_use_comment-4`", "/*+ placeholder_comment */USE `reg_test_3493_use_comment-4`", false)); - db_query.push_back(std::make_tuple("`reg_test_3493_use_comment-5`", "USE/*+ placeholder_comment */`reg_test_3493_use_comment-5`", false)); - db_query.push_back(std::make_tuple("`reg_test_3493_use_comment-6`", "/* comment */USE`reg_test_3493_use_comment-6`", false)); - db_query.push_back(std::make_tuple("`reg_test_3493_use_comment-7`", "USE`reg_test_3493_use_comment-7`", false)); + db_query.push_back(std::make_tuple("test_use_comment", "/*+ placeholder_comment */ USE test_use_comment", false)); + db_query.push_back(std::make_tuple("`test_use_comment-a1`", "USE /*+ placeholder_comment */ `test_use_comment-a1`", true)); + db_query.push_back(std::make_tuple("test_use_comment_1", " USE /*+ placeholder_comment */ `test_use_comment_1`", false)); + db_query.push_back(std::make_tuple("test_use_comment_2", "USE/*+ placeholder_comment */ `test_use_comment_2`", false)); + db_query.push_back(std::make_tuple("test_use_comment_3", "USE /*+ placeholder_comment */`test_use_comment_3`", true)); + db_query.push_back(std::make_tuple("test_use_comment_4", " USE /*+ placeholder_comment */ test_use_comment_4", false)); + db_query.push_back(std::make_tuple("test_use_comment_5", "USE/*+ placeholder_comment */ test_use_comment_5", false)); + db_query.push_back(std::make_tuple("test_use_comment_6", "USE /*+ placeholder_comment */test_use_comment_6", true)); + db_query.push_back(std::make_tuple("`test_use_comment-1`", " USE /*+ placeholder_comment */ `test_use_comment-1`", false)); + db_query.push_back(std::make_tuple("`test_use_comment-2`", "USE/*+ placeholder_comment */ `test_use_comment-2`", false)); + db_query.push_back(std::make_tuple("`test_use_comment-3`", "USE /*+ placeholder_comment */`test_use_comment-3`", true)); + db_query.push_back(std::make_tuple("`test_use_comment-4`", "/*+ placeholder_comment */USE `test_use_comment-4`", false)); + db_query.push_back(std::make_tuple("`test_use_comment-5`", "USE/*+ placeholder_comment */`test_use_comment-5`", false)); + db_query.push_back(std::make_tuple("`test_use_comment-6`", "/* comment */USE`test_use_comment-6`", false)); + db_query.push_back(std::make_tuple("`test_use_comment-7`", "USE`test_use_comment-7`", false)); plan(db_query.size() * 2); 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 dcebe2ce0..d0bcf6dbb 100644 --- a/test/tap/tests/reg_test_4072-show-warnings-t.cpp +++ b/test/tap/tests/reg_test_4072-show-warnings-t.cpp @@ -50,9 +50,9 @@ int main(int argc, char** argv) { fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, mysql_error(proxysql)); return exit_status(); } - MYSQL_QUERY(proxysql, "DROP DATABASE IF EXISTS testdb"); - MYSQL_QUERY(proxysql, "CREATE DATABASE testdb"); - MYSQL_QUERY(proxysql, "CREATE TABLE testdb.`tmp` ( " \ + MYSQL_QUERY(proxysql, "DROP DATABASE IF EXISTS test"); + MYSQL_QUERY(proxysql, "CREATE DATABASE test"); + MYSQL_QUERY(proxysql, "CREATE TABLE test.`tmp` ( " \ "`id` bigint(20) NOT NULL AUTO_INCREMENT, " \ "`text1` varchar(200) COLLATE utf8_bin NOT NULL, " \ "`text2` varchar(200) COLLATE utf8_bin NOT NULL, " \ @@ -61,15 +61,15 @@ int main(int argc, char** argv) { ") ENGINE = InnoDB"); diag("Inserting rows..."); - MYSQL_QUERY(proxysql, "INSERT INTO testdb.tmp(text1, text2, time) values('dummy text1', 'dummy text2', now())"); + MYSQL_QUERY(proxysql, "INSERT INTO test.tmp(text1, text2, time) values('dummy text1', 'dummy text2', now())"); for (int i = 0; i < 7; i++) { - MYSQL_QUERY(proxysql, "INSERT INTO testdb.tmp(text1, text2, time) SELECT text1, text2, time FROM testdb.tmp"); + MYSQL_QUERY(proxysql, "INSERT INTO test.tmp(text1, text2, time) SELECT text1, text2, time FROM test.tmp"); } std::this_thread::sleep_for(std::chrono::seconds(2)); - MYSQL_QUERY(proxysql, "SELECT COUNT(*) FROM testdb.tmp a JOIN testdb.tmp b JOIN testdb.tmp c"); + MYSQL_QUERY(proxysql, "SELECT COUNT(*) FROM test.tmp a JOIN test.tmp b JOIN test.tmp c"); auto mysql_result = mysql_use_result(proxysql); @@ -88,7 +88,7 @@ int main(int argc, char** argv) { diag("Done... Total rows to fetch:'%lu'", add_row_count); diag("Fetching all rows..."); - MYSQL_QUERY(proxysql, "SELECT a.* FROM testdb.tmp a JOIN testdb.tmp b JOIN testdb.tmp c WHERE 1/0 OR 1=1"); + MYSQL_QUERY(proxysql, "SELECT a.* FROM test.tmp a JOIN test.tmp b JOIN test.tmp c WHERE 1/0 OR 1=1"); mysql_result = mysql_use_result(proxysql); diff --git a/test/tap/tests/set_character_set-t.cpp b/test/tap/tests/set_character_set-t.cpp index 3606a1056..b0fdce464 100644 --- a/test/tap/tests/set_character_set-t.cpp +++ b/test/tap/tests/set_character_set-t.cpp @@ -67,19 +67,19 @@ int main(int argc, char** argv) { return exit_status(); } - if (mysql_query(mysql, "drop database if exists t1")) { + if (mysql_query(mysql, "drop database if exists test")) { fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, mysql_error(mysql)); return exit_status(); } - if (mysql_query(mysql, "create database t1 charset utf8")) { + if (mysql_query(mysql, "create database test charset utf8")) { fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, mysql_error(mysql)); return exit_status(); } - if (mysql_query(mysql, "use t1")) { + if (mysql_query(mysql, "use test")) { fprintf(stderr, "File %s, line %d, Error: %s\n", __FILE__, __LINE__, mysql_error(mysql)); return exit_status(); diff --git a/test/tap/tests/test_binlog_reader-t.cpp b/test/tap/tests/test_binlog_reader-t.cpp index cd04f83dd..b8b7ab9fc 100644 --- a/test/tap/tests/test_binlog_reader-t.cpp +++ b/test/tap/tests/test_binlog_reader-t.cpp @@ -46,12 +46,12 @@ using nlohmann::json; int create_testing_tables(MYSQL* mysql_server) { // Create the testing database - MYSQL_QUERY(mysql_server, "CREATE DATABASE IF NOT EXISTS binlog_db"); - MYSQL_QUERY(mysql_server, "DROP TABLE IF EXISTS binlog_db.gtid_test"); + MYSQL_QUERY(mysql_server, "CREATE DATABASE IF NOT EXISTS test"); + MYSQL_QUERY(mysql_server, "DROP TABLE IF EXISTS test.gtid_test"); MYSQL_QUERY( mysql_server, - "CREATE TABLE IF NOT EXISTS binlog_db.gtid_test (" + "CREATE TABLE IF NOT EXISTS test.gtid_test (" " id INTEGER NOT NULL AUTO_INCREMENT," " a INT NOT NULL," " c varchar(255)," @@ -71,7 +71,7 @@ int insert_random_data(MYSQL* proxysql_mysql, uint32_t rows) { for (uint32_t i = 0; i < rows; i++) { string update_query {}; string_format( - "INSERT INTO binlog_db.gtid_test (a, c, pad) VALUES ('%d', '%s', '%s')", update_query, + "INSERT INTO test.gtid_test (a, c, pad) VALUES ('%d', '%s', '%s')", update_query, i, rnd_c.c_str(), rnd_pad.c_str() ); MYSQL_QUERY(proxysql_mysql, update_query.c_str()); @@ -85,7 +85,7 @@ int perform_update(MYSQL* proxysql_mysql, uint32_t rows) { string rnd_c = random_string(rand() % 100 + 5); string rnd_pad = random_string(rand() % 60 + 5); - string query { "UPDATE binlog_db.gtid_test SET a=a+1, c=REVERSE(c)" }; + string query { "UPDATE test.gtid_test SET a=a+1, c=REVERSE(c)" }; MYSQL_QUERY(proxysql_mysql, query.c_str()); return EXIT_SUCCESS; @@ -96,10 +96,10 @@ const uint32_t NUM_ROWS = 3000; const uint32_t NUM_CHECKS = 500; map> extract_hosgtroups_stats(const vector& conn_pool_stats) { - uint32_t hg_50_queries = 0; - uint32_t hg_50_sync_queries = 0; - uint32_t hg_60_queries = 0; - uint32_t hg_60_sync_queries = 0; + uint32_t hg_1900_queries = 0; + uint32_t hg_1900_sync_queries = 0; + uint32_t hg_1901_queries = 0; + uint32_t hg_1901_sync_queries = 0; for (const auto& conn_pool_stats_row : conn_pool_stats) { if (conn_pool_stats_row.size() < 3) { @@ -112,16 +112,16 @@ map> extract_hosgtroups_stats(const vector