From 74ee4e8ea8721b4c583f71d1cb200df5e727f96a Mon Sep 17 00:00:00 2001 From: Valentin Rakush Date: Wed, 6 May 2020 08:22:40 +0000 Subject: [PATCH] PROXYSQLTEST automation for query rules fast routing (cherry picked from commit 6bca353e2955ffa710d31b4863cd382917a7f9be) --- .../test_mysql_query_rules_fast_routing-t.cpp | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 test/tap/tests/test_mysql_query_rules_fast_routing-t.cpp diff --git a/test/tap/tests/test_mysql_query_rules_fast_routing-t.cpp b/test/tap/tests/test_mysql_query_rules_fast_routing-t.cpp new file mode 100644 index 000000000..814263e67 --- /dev/null +++ b/test/tap/tests/test_mysql_query_rules_fast_routing-t.cpp @@ -0,0 +1,72 @@ +#include +#include +#include +#include + +#include + +#include +#include + +#include "tap.h" +#include "command_line.h" +#include "utils.h" + +int main(int argc, char** argv) { + CommandLine cl; + + std::random_device rd; //Will be used to obtain a seed for the random number engine + std::mt19937 gen(rd()); //Standard mersenne_twister_engine seeded with rd() + std::uniform_int_distribution<> dis(100000, 1000000); + + if(cl.getEnv()) + return exit_status(); + + plan(6); + diag("Testing query rules fast routing"); + + MYSQL* mysqlAdmin = mysql_init(NULL); + if (!mysqlAdmin) return exit_status(); + if (!mysql_real_connect(mysqlAdmin, cl.host, "admin", "admin", NULL, 6032, NULL, 0)) return exit_status(); + + const auto NUM_REPS=3; + char query[1024] = {0}; + for (auto i=0; i