summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-07-15 15:22:50 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-07-15 15:22:50 -0300
commit5f9440d2a628b8f78ce4f172a2028f2749800639 (patch)
treeb7ec392f0ecee1f666ac1eb127db5e17f8e8ef11 /tests
parent422696d673dececd0feb54c28d05327bf4825834 (diff)
parentc6b8dcedf91ddfe1cf9c4c114b0c42714238ac99 (diff)
downloadmariadb-git-5f9440d2a628b8f78ce4f172a2028f2749800639.tar.gz
Bug#44495: Prepared Statement: CALL p(<x>) - `thd->protocol == &thd->protocol_text' failed
Merge Konstantin's patch and add a test case. tests/mysql_client_test.c: Add test case for Bug#44495
Diffstat (limited to 'tests')
-rw-r--r--tests/mysql_client_test.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index b836293442a..c51e3984fc9 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -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 }
};