summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-01-29 12:42:31 +0200
committerMichael Widenius <monty@askmonty.org>2010-01-29 12:42:31 +0200
commit4847e50ddb2cf37f8edb627f38be757634605186 (patch)
treef3d5715eff66360dbc2f66104bccd057c8228e0e /sql/sql_cache.cc
parenta0417475678013914fb91c44be279b4107e3ffdb (diff)
parent89b1bb0be8c59eaf77e17e3e51ee9252e76e5c1d (diff)
downloadmariadb-git-4847e50ddb2cf37f8edb627f38be757634605186.tar.gz
Changed version number from RC to stable
Fixed bug in Yassle to get correct error messages in case of errors Provide better error messages in case of ssl connect failure Updated out-of-date ssl certificates to fix failing mysql-test-system (certificates now active for 10 years) Fixed bug in query_cache that could cause asserts and hangs in DEBUG builds. Fixed bug where one connection did not see changes done by another connection. configure.in: Changed version number from RC to stable extra/yassl/src/yassl_error.cpp: Fixed bug in Yassle to get correct error messages in case of errors - 'error' is an enum that hold more error numbers than the enum was defined for include/violite.h: Added error output string for sslaccept() and sslconnect() to get reason for connect failure mysql-test/mysql-test-run.pl: Write failed test cases if mysql-test-run fails because of too many errors mysql-test/r/grant.result: Update results to reflect new certificates mysql-test/r/openssl_1.result: Update results to reflect new certificates mysql-test/std_data/cacert.pem: Update ssl certificate mysql-test/std_data/client-cert.pem: Update ssl certificate mysql-test/std_data/client-key.pem: Update ssl certificate mysql-test/std_data/server-cert.pem: Update ssl certificate mysql-test/std_data/server-key.pem: Update ssl certificate mysql-test/t/grant.test: Update test to reflect new certificates mysql-test/t/openssl_1.test: Update test to reflect new certificates mysql-test/t/query_cache_debug.test: Remove 'big_test' as test is now fast sql-common/client.c: Give a better error message if ssl connect fails sql/net_serv.cc: Fixed compiler warnings sql/slave.cc: Give a better error message in logs if ssl connect fails sql/sql_cache.cc: debug_wait_for_kill() now removes the set watch variable after kill signal This is needed as invalidate_table() may be called twice for one query. Ensure that net->query_cache_query is reset after query. This fixes assert in query_cache_end_of_result() if query_cache_query holds results from previous query. Removed DBUG_ASSERT(0), as this code can be run by query_cache_debug.test sql/sql_connect.cc: Give a better error message if ssl connect fails sql/sql_parse.cc: Fixed bug where one connection did not see changes done by another connection. For statements that changes tables, close_thread_tables() MUST be called before sending OK as a table handler may not make the changes available for other connections before unlock_tables(). vio/viossl.c: Give a better error message if ssl connect fails
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 9e65e07f1a1..302d5e95a28 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -377,9 +377,11 @@ TODO list:
static void debug_wait_for_kill(const char *info)
{
- DBUG_ENTER("debug_wait_for_kill");
const char *prev_info;
THD *thd;
+ char buff[1024];
+ DBUG_ENTER("debug_wait_for_kill");
+
thd= current_thd;
prev_info= thd->proc_info;
thd->proc_info= info;
@@ -387,8 +389,16 @@ static void debug_wait_for_kill(const char *info)
while(!thd->killed)
my_sleep(1000);
thd->killed= THD::NOT_KILLED;
+ /*
+ Remove the set debug variable, to ensure we don't get stuck on it again
+ This is needed as for MyISAM, invalidate_table() may be called twice
+ (Once from mysql_delete() and once from mi_update_status())
+ */
+ sprintf(buff, "-d,%s", info);
+ DBUG_SET(buff);
sql_print_information("Exit debug_wait_for_kill");
thd->proc_info= prev_info;
+
DBUG_VOID_RETURN;
}
@@ -914,15 +924,18 @@ void query_cache_insert(NET *net, const char *packet, ulong length)
void query_cache_abort(NET *net)
{
+ THD *thd;
DBUG_ENTER("query_cache_abort");
- THD *thd= current_thd;
/* See the comment on double-check locking usage above. */
if (net->query_cache_query == 0)
DBUG_VOID_RETURN;
if (query_cache.try_lock())
+ {
+ net->query_cache_query = 0;
DBUG_VOID_RETURN;
+ }
/*
While we were waiting another thread might have changed the status
@@ -932,6 +945,7 @@ void query_cache_abort(NET *net)
net->query_cache_query);
if (query_block)
{
+ thd= current_thd;
thd_proc_info(thd, "storing result in query cache");
DUMP(&query_cache);
BLOCK_LOCK_WR(query_block);
@@ -941,6 +955,7 @@ void query_cache_abort(NET *net)
DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
}
+ DBUG_ASSERT(!net->query_cache_query);
query_cache.unlock();
DBUG_VOID_RETURN;
}
@@ -970,8 +985,12 @@ void query_cache_end_of_result(THD *thd)
#endif
if (query_cache.try_lock())
+ {
+ thd->net.query_cache_query= 0;
DBUG_VOID_RETURN;
+ }
+ /* thd->net.query_cache_query may have changed during resize */
query_block= ((Query_cache_block*) thd->net.query_cache_query);
if (query_block)
{
@@ -997,8 +1016,8 @@ void query_cache_end_of_result(THD *thd)
to this function. In the release version that query should be ignored
and removed from QC.
*/
- DBUG_ASSERT(0);
query_cache.free_query(query_block);
+ thd->net.query_cache_query= 0;
query_cache.unlock();
DBUG_VOID_RETURN;
}