diff --git a/maxscale-system-test/CMakeLists.txt b/maxscale-system-test/CMakeLists.txt index ec163fda5..52f7512f0 100644 --- a/maxscale-system-test/CMakeLists.txt +++ b/maxscale-system-test/CMakeLists.txt @@ -207,6 +207,9 @@ add_test_executable(mxs2167_extra_port.cpp mxs2167_extra_port mxs2167_extra_port # Test KILL QUERY functionality add_test_executable(kill_query.cpp kill_query replication LABELS REPL_BACKEND) +# MXS-2250: DESCRIBE on temporary table should work. +add_test_executable(mxs2250_describe_temp_table.cpp mxs2250_describe_temp_table mxs2250_describe_temp_table LABELS REPL_BACKEND) + ############################################ # BEGIN: Tests that require GTID # ############################################ diff --git a/maxscale-system-test/cnf/maxscale.cnf.template.mxs2250_describe_temp_table b/maxscale-system-test/cnf/maxscale.cnf.template.mxs2250_describe_temp_table new file mode 100644 index 000000000..5e81561ef --- /dev/null +++ b/maxscale-system-test/cnf/maxscale.cnf.template.mxs2250_describe_temp_table @@ -0,0 +1,61 @@ +[maxscale] +threads=###threads### +log_warning=1 + +[server1] +type=server +address=###node_server_IP_1### +port=###node_server_port_1### +protocol=mariadbbackend + +[server2] +type=server +address=###node_server_IP_2### +port=###node_server_port_2### +protocol=mariadbbackend + +[server3] +type=server +address=###node_server_IP_3### +port=###node_server_port_3### +protocol=mariadbbackend + +[server4] +type=server +address=###node_server_IP_4### +port=###node_server_port_4### +protocol=mariadbbackend + +[Monitor] +type=monitor +module=mariadbmon +servers=server1,server2,server3,server4 +user=maxskysql +password=skysql +monitor_interval=1000 + +[RWS] +type=service +router=readwritesplit +servers=server1,server2,server3,server4 +user=maxskysql +password=skysql +slave_selection_criteria=LEAST_ROUTER_CONNECTIONS + +[RWS-Listener] +type=listener +service=RWS +protocol=mariadbclient +port=4006 +#socket=/tmp/rwsplit.sock + +[CLI] +type=service +router=cli + +[CLI Listener] +type=listener +service=CLI +protocol=maxscaled +#address=localhost +socket=default diff --git a/maxscale-system-test/mxs2250_describe_temp_table.cpp b/maxscale-system-test/mxs2250_describe_temp_table.cpp new file mode 100644 index 000000000..2e89f913d --- /dev/null +++ b/maxscale-system-test/mxs2250_describe_temp_table.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019 MariaDB Corporation Ab + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file and at www.mariadb.com/bsl11. + * + * Change Date: 2022-01-01 + * + * On the date above, in accordance with the Business Source License, use + * of this software will be governed by version 2 or later of the General + * Public License. + */ + +#include "mariadb_func.h" +#include "testconnections.h" + +int main(int argc, char* argv[]) +{ + TestConnections test(argc, argv); + + Connection rwsplit = test.maxscales->rwsplit(); + + test.expect(rwsplit.connect(), + "Could not connect to rwsplit."); + test.expect(rwsplit.query("CREATE TEMPORARY TABLE mxs2250 (a int)"), + "Could not create temporary table."); + test.expect(rwsplit.query("DESCRIBE mxs2250"), + "Could not describe temporary table."); + + return test.global_result; +}