diff options
-rw-r--r-- | mysql-test/ndb/ndbcluster.sh | 6 | ||||
-rw-r--r-- | ndb/test/src/CpcClient.cpp | 42 | ||||
-rw-r--r-- | sql/sql_parse.cc | 2 | ||||
-rw-r--r-- | tests/client_test.c | 25 |
4 files changed, 49 insertions, 26 deletions
diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 848223a091c..2d529f8fe0f 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -191,7 +191,7 @@ if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else echo "Unable to start $exec_mgmtsrvr from `pwd`" exit 1 fi -if sleep_until_file_created $fs_ndb/ndb_3.pid 30 +if sleep_until_file_created $fs_ndb/ndb_3.pid 120 then :; else exit 1 fi @@ -201,7 +201,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) -if sleep_until_file_created $fs_ndb/ndb_1.pid 30 +if sleep_until_file_created $fs_ndb/ndb_1.pid 120 then :; else stop_default_ndbcluster exit 1 @@ -212,7 +212,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) -if sleep_until_file_created $fs_ndb/ndb_2.pid 30 +if sleep_until_file_created $fs_ndb/ndb_2.pid 120 then :; else stop_default_ndbcluster exit 1 diff --git a/ndb/test/src/CpcClient.cpp b/ndb/test/src/CpcClient.cpp index 2ef23528360..1d1b4fcb977 100644 --- a/ndb/test/src/CpcClient.cpp +++ b/ndb/test/src/CpcClient.cpp @@ -30,7 +30,7 @@ 0, 0, \ 0, \ (desc), \ - (void *)(value) } + (value) } #define CPC_ARG(name, type, opt, desc) \ { (name), \ @@ -351,17 +351,12 @@ SimpleCpcClient::define_process(Process & p, Properties& reply){ int SimpleCpcClient::list_processes(Vector<Process> &procs, Properties& reply) { - enum Proclist { - Proclist_Start, - Proclist_End, - Proclist_Entry - }; + int start, end, entry; const ParserRow_t list_reply[] = { - CPC_CMD("start processes", Proclist_Start, ""), - - CPC_CMD("end processes", Proclist_End, ""), + CPC_CMD("start processes", &start, ""), + CPC_CMD("end processes", &end, ""), - CPC_CMD("process", Proclist_Entry, ""), + CPC_CMD("process", &entry, ""), CPC_ARG("id", Int, Mandatory, "Id of process."), CPC_ARG("name", String, Mandatory, "Name of process"), CPC_ARG("group", String, Mandatory, "Group of process"), @@ -390,26 +385,29 @@ SimpleCpcClient::list_processes(Vector<Process> &procs, Properties& reply) { bool done = false; while(!done) { const Properties *proc; - enum Proclist p; - cpc_recv(list_reply, &proc, (void **)&p); + void *p; + cpc_recv(list_reply, &proc, &p); - switch(p) { - case Proclist_Start: + if(p == &start) + { /* do nothing */ - break; - case Proclist_End: + } + else if(p == &end) + { done = true; - break; - case Proclist_Entry: + } + else if(p == &entry) + { if(proc != NULL){ Process p; convert(* proc, p); procs.push_back(p); } - break; - default: - /* ignore */ - break; + } + else + { + ndbout_c("internal error: %d", __LINE__); + return -1; } } return 0; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a0728f58372..6082b943b7f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1613,7 +1613,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, table_list.schema_table= schema_table; } - /* command not cachable => no gap for data base name */ + thd->query_length= strlen(packet); // for simplicity: don't optimize if (!(thd->query=fields=thd->memdup(packet,thd->query_length+1))) break; mysql_log.write(thd,command,"%s %s",table_list.table_name, fields); diff --git a/tests/client_test.c b/tests/client_test.c index d815a9abb3e..498b57fdeab 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -12481,6 +12481,30 @@ static void test_truncation_option() mysql_stmt_close(stmt); } + +/* Bug#6761 - mysql_list_fields doesn't work */ + +static void test_bug6761(void) +{ + const char *stmt_text; + MYSQL_RES *res; + int rc; + myheader("test_bug6761"); + + stmt_text= "CREATE TABLE t1 (a int, b char(255), c decimal)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + res= mysql_list_fields(mysql, "t1", "%"); + DIE_UNLESS(res && mysql_num_fields(res) == 3); + mysql_free_result(res); + + stmt_text= "DROP TABLE t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -12687,6 +12711,7 @@ static struct my_tests_st my_tests[]= { { "test_bug4172", test_bug4172 }, { "test_conversion", test_conversion }, { "test_rewind", test_rewind }, + { "test_bug6761", test_bug6761 }, { "test_view", test_view }, { "test_view_where", test_view_where }, { "test_view_2where", test_view_2where }, |