summaryrefslogtreecommitdiff
path: root/tests/client_test.c
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2004-10-21 18:33:53 +0400
committerkonstantin@mysql.com <>2004-10-21 18:33:53 +0400
commit49a58fc64ee811fd71a974f493540c19d98ada73 (patch)
tree7058ab30d1d358a25767f8022ee18348b8f22709 /tests/client_test.c
parent37ab172624222a9c414cb265e4c2eff819fd17f5 (diff)
downloadmariadb-git-49a58fc64ee811fd71a974f493540c19d98ada73.tar.gz
A fix and test case for bug#6059 "mysql_stmt_field_count returns
positive numbers when no resultset is available": when sending result set metadata we need to use virtual select_result::send_fields, and not address protocol directly, because select_result descendents may intercept result set (it's the case for example for SELECT INTO OUTFILE).
Diffstat (limited to 'tests/client_test.c')
-rw-r--r--tests/client_test.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/client_test.c b/tests/client_test.c
index 0b30cc3386d..1d2a85e54f4 100644
--- a/tests/client_test.c
+++ b/tests/client_test.c
@@ -10541,6 +10541,22 @@ static void test_bug5315()
}
+static void test_bug6059()
+{
+ MYSQL_STMT *stmt;
+ const char *stmt_text;
+ int rc;
+
+ myheader("test_bug6059");
+
+ stmt_text= "SELECT 'foo' INTO OUTFILE 'x.3'";
+
+ stmt= mysql_stmt_init(mysql);
+ rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
+ DIE_UNLESS(mysql_stmt_field_count(stmt) == 0);
+ mysql_stmt_close(stmt);
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
*/
@@ -10851,6 +10867,7 @@ int main(int argc, char **argv)
test_bug5194(); /* bulk inserts in prepared mode */
test_bug5315(); /* check that mysql_change_user closes all
prepared statements */
+ test_bug6059(); /* correct metadata for SELECT ... INTO OUTFILE */
/*
XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST
DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH.