Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.1.19, 3.3.3
-
None
Description
While mysql_stmt_error() returns the correct result from failing mysql_stmt_prepare(), mysql_error() returns the error from mysql_stmt_execute()
static int test_execute_direct_error(MYSQL *mysql) |
{
|
MYSQL_STMT *stmt= mysql_stmt_init(mysql);
|
int rc; |
|
rc= mariadb_stmt_execute_direct(stmt, SL("SELECT SYNTAX_ERROR")); |
diag("stmt_error: %s", mysql_stmt_error(stmt)) |
diag("mysql_error: %s", mysql_error(mysql)) |
FAIL_IF(!rc, "Error expected") |
|
mysql_stmt_close(stmt);
|
return OK; |
}
|
Output:
# stmt_error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CALL P1()' at line 1
|
# mysql_error: Unknown prepared statement handler (4294967295) given to mysqld_stmt_execute
|