Files
MaxScale/maxscale-system-test/mxs2490_ps_execute_direct.cpp
Markus Mäkelä 8a176d64aa MXS-2490: Add direct execution support
Certain MariaDB connectors will use the direct execution for batching
COM_STMT_PREPARE and COM_STMT_EXECUTE execution without waiting for the
COM_STMT_PREPARE to complete. In these cases the COM_STMT_EXECUTE (and
other COM_STMT commands as well) will use the special ID 0xffffffff. When
this is detected, it should be substituted with the ID of the latest
statement that was prepared.
2019-07-09 14:59:52 +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;
}