mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#44495: Prepared Statement: CALL p(<x>) - `thd->protocol == &thd->protocol_text' failed
Merge Konstantin's patch and add a test case.
This commit is contained in:
@ -17940,6 +17940,57 @@ static void test_bug41078(void)
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Bug#44495: Prepared Statement:
|
||||
CALL p(<x>) - `thd->protocol == &thd->protocol_text' failed
|
||||
*/
|
||||
|
||||
static void test_bug44495()
|
||||
{
|
||||
int rc;
|
||||
MYSQL con;
|
||||
MYSQL_STMT *stmt;
|
||||
|
||||
DBUG_ENTER("test_bug44495");
|
||||
myheader("test_44495");
|
||||
|
||||
rc= mysql_query(mysql, "DROP PROCEDURE IF EXISTS p1");
|
||||
myquery(rc);
|
||||
|
||||
rc= mysql_query(mysql, "CREATE PROCEDURE p1(IN arg VARCHAR(25))"
|
||||
" BEGIN SET @stmt = CONCAT('SELECT \"', arg, '\"');"
|
||||
" PREPARE ps1 FROM @stmt;"
|
||||
" EXECUTE ps1;"
|
||||
" DROP PREPARE ps1;"
|
||||
"END;");
|
||||
myquery(rc);
|
||||
|
||||
DIE_UNLESS(mysql_init(&con));
|
||||
|
||||
DIE_UNLESS(mysql_real_connect(&con, opt_host, opt_user, opt_password,
|
||||
current_db, opt_port, opt_unix_socket,
|
||||
CLIENT_MULTI_RESULTS));
|
||||
|
||||
stmt= mysql_simple_prepare(&con, "CALL p1('abc')");
|
||||
check_stmt(stmt);
|
||||
|
||||
rc= mysql_stmt_execute(stmt);
|
||||
check_execute(stmt, rc);
|
||||
|
||||
rc= my_process_stmt_result(stmt);
|
||||
DIE_UNLESS(rc == 1);
|
||||
|
||||
mysql_stmt_close(stmt);
|
||||
|
||||
mysql_close(&con);
|
||||
|
||||
rc= mysql_query(mysql, "DROP PROCEDURE p1");
|
||||
myquery(rc);
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
/*
|
||||
Read and parse arguments and MySQL options from my.cnf
|
||||
*/
|
||||
@ -18255,6 +18306,7 @@ static struct my_tests_st my_tests[]= {
|
||||
{ "test_bug36326", test_bug36326 },
|
||||
#endif
|
||||
{ "test_bug41078", test_bug41078 },
|
||||
{ "test_bug44495", test_bug44495 },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user