1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Initial implementation for COM_MULTI

This commit is contained in:
Georg Richter
2015-12-17 19:21:52 +01:00
parent 955bb8d6ff
commit c8648cf4b2
12 changed files with 197 additions and 17 deletions

View File

@@ -0,0 +1,55 @@
/*
*/
#include "my_test.h"
static int com_multi_1(MYSQL *mysql)
{
int rc;
my_bool is_multi= 1;
if (mysql_options(mysql, MARIADB_OPT_COM_MULTI, &is_multi))
{
diag("COM_MULT not supported");
return SKIP;
}
rc= mysql_query(mysql, "SET @a:=1");
check_mysql_rc(rc, mysql);
rc= mysql_query(mysql, "SET @b:=2");
check_mysql_rc(rc, mysql);
rc= mysql_query(mysql, "select @a,@b");
check_mysql_rc(rc, mysql);
rc= mariadb_flush_multi_command(mysql);
check_mysql_rc(rc, mysql);
/* question: how will result sets look like ? */
diag("error: %s", mysql_error(mysql));
return OK;
}
struct my_tests_st my_tests[] = {
{"com_multi_1", com_multi_1, TEST_CONNECTION_NEW, 0, NULL, NULL},
{NULL, NULL, 0, 0, NULL, NULL}
};
int main(int argc, char **argv)
{
mysql_library_init(0,0,NULL);
if (argc > 1)
get_options(argc, argv);
get_envvars();
run_tests(my_tests);
mysql_server_end();
return(exit_status());
}