Files
MaxScale/system-test/mxs2490_ps_execute_direct.cpp
Esa Korhonen 08f5174915 MXS-2900 Rename maxscale-system-test directory to system-test
A link with the old directory name is provided.
2020-07-28 15:24:27 +03:00

27 lines
751 B
C++

/**
* MXS-2490: Unknown prepared statement handler (0) given to mysqld_stmt_execute
*
* See:
*
* https://mariadb.com/kb/en/library/mariadb_stmt_execute_direct/
* https://mariadb.com/kb/en/library/com_stmt_execute/#statement-id
*/
#include "testconnections.h"
int main(int argc, char** argv)
{
TestConnections test(argc, argv);
test.set_timeout(30);
test.maxscales->connect();
MYSQL_STMT* stmt = mysql_stmt_init(test.maxscales->conn_rwsplit[0]);
std::string query = "SELECT user FROM mysql.user";
test.expect(mariadb_stmt_execute_direct(stmt, query.c_str(), query.length()) == 0,
"execute_direct should work: %s", mysql_stmt_error(stmt));
mysql_stmt_close(stmt);
return test.global_result;
}