From 0741a4d1b0fa15865fd7bd1a3e8a785d388dd69b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Oct 2007 15:32:07 +0300 Subject: Removed extra spaces Added extra debug client/mysql_upgrade.c: Removed extra space client/mysqlcheck.c: Removed extra space client/mysqldump.c: Removed extra space client/mysqlimport.c: Removed extra space client/mysqlshow.c: Removed extra space client/mysqlslap.c: Removed extra space client/mysqltest.c: Removed extra space sql/handler.cc: Added extra debug --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/mysqltest.c') diff --git a/client/mysqltest.c b/client/mysqltest.c index 1c98ea3bf50..9e85a526ffa 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4489,7 +4489,7 @@ static struct my_option my_long_options[] = {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .", + {"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.", (uchar**) &debug_check_flag, (uchar**) &debug_check_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", -- cgit v1.2.1 From 641bc9a45f1c7cdeca495f0941928a6195c3abfc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 18 Feb 2008 16:47:00 +0200 Subject: Fixed a previous patch. BitKeeper/etc/ignore: added libmysqld/sql_profile.cc client/mysqltest.c: Use my_micro_time() instead of my_getsystime() for faster execution. include/config-win.h: Moved a definition into a header file. mysys/my_getsystime.c: Use GetSystemTimeAsFileTime() instead of QueryPerformanceCounter() for faster execution. --- client/mysqltest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'client/mysqltest.c') diff --git a/client/mysqltest.c b/client/mysqltest.c index f6af4b430c4..9b96810e732 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -7330,7 +7330,7 @@ void timer_output(void) ulonglong timer_now(void) { - return my_getsystime() / 10000; + return my_micro_time() / 1000; } -- cgit v1.2.1 From 30d644f859ee65748f12e3861abaf1fbb2c3b2c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Mar 2008 13:39:56 +0300 Subject: A patch for Bug#35329: connect does not set mysql_errno variable. The problem was that 'connect' command didn't set mysql_errno variable, thus the script was unable to determine whether connection was opened or not. The fix is to set this variable. Test cases will be added in the scope of Bug33507 into connect.test file. client/mysqltest.c: Set 'mysql_errno' variable. --- client/mysqltest.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'client/mysqltest.c') diff --git a/client/mysqltest.c b/client/mysqltest.c index 52e02789579..7ef184ae7e8 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -4221,11 +4221,13 @@ int connect_n_handle_errors(struct st_command *command, if (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0, CLIENT_MULTI_STATEMENTS)) { + var_set_errno(mysql_errno(con)); handle_error(command, mysql_errno(con), mysql_error(con), mysql_sqlstate(con), ds); return 0; /* Not connected */ } + var_set_errno(0); handle_no_error(command); return 1; /* Connected */ } -- cgit v1.2.1 From 4018b13915c2fa972cf4da90ab1b2272b855a490 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Mar 2008 15:51:22 +0400 Subject: Bug #33334 mysqltest_embedded crashes when disconnecting before reap. Before breaking the connection we have to check that there's no query executing at the moment. Otherwise it can lead to crash in embedded server. client/mysqltest.c: Bug #33334 mysqltest_embedded crashes when disconnecting before reap. Wait until the query thread is finished before we break the connection. Waiting part moved to a separate wait_query_thread_end() function mysql-test/r/flush.result: Bug #33334 mysqltest_embedded crashes when disconnecting before reap. test result mysql-test/t/flush.test: Bug #33334 mysqltest_embedded crashes when disconnecting before reap. test case --- client/mysqltest.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) (limited to 'client/mysqltest.c') diff --git a/client/mysqltest.c b/client/mysqltest.c index 88575c26bc6..b028794295c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -542,6 +542,17 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len, return 0; } +static void wait_query_thread_end(struct st_connection *con) +{ + if (!con->query_done) + { + pthread_mutex_lock(&con->mutex); + while (!con->query_done) + pthread_cond_wait(&con->cond, &con->mutex); + pthread_mutex_unlock(&con->mutex); + } +} + #else /*EMBEDDED_LIBRARY*/ #define do_send_query(cn,q,q_len,flags) mysql_send_query(&cn->mysql, q, q_len) @@ -3939,7 +3950,14 @@ void do_close_connection(struct st_command *command) con->mysql.net.vio = 0; } } -#endif +#else + /* + As query could be still executed in a separate theread + we need to check if the query's thread was finished and probably wait + (embedded-server specific) + */ + wait_query_thread_end(con); +#endif /*EMBEDDED_LIBRARY*/ if (con->stmt) mysql_stmt_close(con->stmt); con->stmt= 0; @@ -4229,6 +4247,9 @@ void do_connect(struct st_command *command) (int) (sizeof(connections)/sizeof(struct st_connection))); } +#ifdef EMBEDDED_LIBRARY + con_slot->query_done= 1; +#endif if (!mysql_init(&con_slot->mysql)) die("Failed on mysql_init()"); if (opt_compress || con_compress) @@ -5716,16 +5737,11 @@ void run_query_normal(struct st_connection *cn, struct st_command *command, } #ifdef EMBEDDED_LIBRARY /* - Here we handle 'reap' command, so we need to check if the - query's thread was finished and probably wait + Here we handle 'reap' command, so we need to check if the + query's thread was finished and probably wait */ else if (flags & QUERY_REAP_FLAG) - { - pthread_mutex_lock(&cn->mutex); - while (!cn->query_done) - pthread_cond_wait(&cn->cond, &cn->mutex); - pthread_mutex_unlock(&cn->mutex); - } + wait_query_thread_end(cn); #endif /*EMBEDDED_LIBRARY*/ if (!(flags & QUERY_REAP_FLAG)) DBUG_VOID_RETURN; -- cgit v1.2.1