diff options
author | Michael Widenius <monty@askmonty.org> | 2010-01-29 12:42:31 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2010-01-29 12:42:31 +0200 |
commit | 4847e50ddb2cf37f8edb627f38be757634605186 (patch) | |
tree | f3d5715eff66360dbc2f66104bccd057c8228e0e /sql | |
parent | a0417475678013914fb91c44be279b4107e3ffdb (diff) | |
parent | 89b1bb0be8c59eaf77e17e3e51ee9252e76e5c1d (diff) | |
download | mariadb-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')
-rw-r--r-- | sql/net_serv.cc | 4 | ||||
-rw-r--r-- | sql/slave.cc | 5 | ||||
-rw-r--r-- | sql/sql_cache.cc | 25 | ||||
-rw-r--r-- | sql/sql_connect.cc | 3 | ||||
-rw-r--r-- | sql/sql_parse.cc | 21 |
5 files changed, 45 insertions, 13 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index f987067b9b3..4e1d507de2c 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -219,7 +219,7 @@ my_bool net_realloc(NET *net, size_t length) -1 Don't know if data is ready or not */ -#if !defined(EMBEDDED_LIBRARY) +#if !defined(EMBEDDED_LIBRARY) && defined(DBUG_OFF) static int net_data_is_ready(my_socket sd) { @@ -280,7 +280,7 @@ static int net_data_is_ready(my_socket sd) void net_clear(NET *net, my_bool clear_buffer) { -#if !defined(EMBEDDED_LIBRARY) +#if !defined(EMBEDDED_LIBRARY) && defined(DBUG_OFF) size_t count; int ready; #endif diff --git a/sql/slave.cc b/sql/slave.cc index 5de79d55b31..e4fd07de44b 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3803,10 +3803,11 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, suppress_warnings= 0; mi->report(ERROR_LEVEL, last_errno, "error %s to master '%s@%s:%d'" - " - retry-time: %d retries: %lu", + " - retry-time: %d retries: %lu message: %s", (reconnect ? "reconnecting" : "connecting"), mi->user, mi->host, mi->port, - mi->connect_retry, master_retry_count); + mi->connect_retry, master_retry_count, + mysql_error(mysql)); } /* By default we try forever. The reason is that failure will trigger 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; } diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 8f02828e18c..9f1597433d2 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -798,6 +798,7 @@ static int check_connection(THD *thd) DBUG_PRINT("info", ("client capabilities: %lu", thd->client_capabilities)); if (thd->client_capabilities & CLIENT_SSL) { + char error_string[1024]; /* Do the SSL layering. */ if (!ssl_acceptor_fd) { @@ -806,7 +807,7 @@ static int check_connection(THD *thd) return 1; } DBUG_PRINT("info", ("IO layer change in progress...")); - if (sslaccept(ssl_acceptor_fd, net->vio, net->read_timeout)) + if (sslaccept(ssl_acceptor_fd, net->vio, net->read_timeout, error_string)) { DBUG_PRINT("error", ("Failed to accept new SSL connection")); inc_host_errors(&thd->remote.sin_addr); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 481dc5a9b32..9c222837f81 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1252,12 +1252,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ha_maria::implicit_commit(thd, FALSE); #endif - net_end_statement(thd); - query_cache_end_of_result(thd); /* Multiple queries exits, execute them individually */ close_thread_tables(thd); + + net_end_statement(thd); + query_cache_end_of_result(thd); + ulong length= (ulong)(packet_end - beginning_of_next_stmt); log_slow_statement(thd); @@ -1645,13 +1647,22 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ha_maria::implicit_commit(thd, FALSE); #endif - net_end_statement(thd); - query_cache_end_of_result(thd); - + if (!(sql_command_flags[thd->lex->sql_command] & CF_CHANGES_DATA)) + { + /* No changes in data; We can send ok at once to the client */ + net_end_statement(thd); + query_cache_end_of_result(thd); + } thd->proc_info= "closing tables"; /* Free tables */ close_thread_tables(thd); + if (sql_command_flags[thd->lex->sql_command] & CF_CHANGES_DATA) + { + net_end_statement(thd); + query_cache_end_of_result(thd); + } + log_slow_statement(thd); thd_proc_info(thd, "cleaning up"); |