Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.5.7
-
MXS-SPRINT-125
Description
There seems to be a strange behavior with maxscale when resetting a connection, after having a failed prepared statement.
#define check_mysql_rc(rc, mysql) \
|
do {\ |
if (rc)\ |
{\
|
diag("Error (%d): %s (%d) in %s line %d", rc, mysql_error(mysql), \ |
mysql_errno(mysql), __FILE__, __LINE__);\
|
return(FAIL);\ |
}\
|
} while(0) |
 |
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
int rc; |
rc= mariadb_stmt_execute_direct(stmt, "SELECT 1 FROM nonexisting_table", -1); |
FAIL_IF(rc==0, "Expected error\n"); |
rc = mysql_stmt_close(stmt);
|
check_mysql_rc(rc, mysql);
|
rc= mysql_reset_connection(mysql);
|
check_mysql_rc(rc, mysql); => result in error
|
error is "Unknown prepared statement handler (4294967295) given to MaxScale (1243) "
4294967295 correspond to -1 => this is usually use by COM_STMT_EXECUTE to indicate to execute last prepared statement. mariadb_stmt_execute_direct might send a COM_STMT_CLOSE + COM_STMT_EXECUTE with id -1.
I don't understand what can cause this, because error occur on reset, but there is a strange behaviour with maxscale with this special "-1" feature.