
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.
27 lines
751 B
C++
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;
|
|
}
|