Below is the list of changes that have just been committed into a local
5.1 repository of thek. When thek does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-03-14 11:10:35+01:00, thek@stripped +3 -0
bla.patch
mysql-test/r/information_schema.result@stripped, 2007-03-14 10:44:42+01:00, thek@stripped +19 -0
Import patch bla.patch
mysql-test/t/information_schema.test@stripped, 2007-03-14 10:44:43+01:00, thek@stripped +32 -0
Import patch bla.patch
sql/mysqld.cc@stripped, 2007-03-14 10:44:42+01:00, thek@stripped +60 -17
Import patch bla.patch
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: thek
# Host: kpdesk.mysql.com
# Root: /home/thek/dev/bug26174/my51-bug26174
--- 1.618/sql/mysqld.cc 2007-03-14 11:10:43 +01:00
+++ 1.619/sql/mysqld.cc 2007-03-14 11:10:43 +01:00
@@ -6569,8 +6569,15 @@ static int show_ssl_ctx_get_session_cach
static int show_ssl_get_version(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_CHAR;
- var->value= const_cast<char*>(thd->net.vio->ssl_arg ?
- SSL_get_version((SSL*) thd->net.vio->ssl_arg) : "");
+ /*
+ We need to check if we have a connection
+ since this isn't always true if we for example
+ call global status from inside an event.
+ */
+ if( thd->net.vio && thd->net.vio->ssl_arg )
+ var->value= const_cast<char*>(SSL_get_version((SSL*) thd->net.vio->ssl_arg));
+ else
+ var->value= "";
return 0;
}
@@ -6578,9 +6585,15 @@ static int show_ssl_session_reused(THD *
{
var->type= SHOW_LONG;
var->value= buff;
- *((long *)buff)= (long)thd->net.vio->ssl_arg ?
- SSL_session_reused((SSL*) thd->net.vio->ssl_arg) :
- 0;
+ /*
+ We need to check if we have a connection
+ since this isn't always true if we for example
+ call global status from inside an event.
+ */
+ if( thd->net.vio && thd->net.vio->ssl_arg )
+ *((long *)buff)= (long)SSL_session_reused((SSL*) thd->net.vio->ssl_arg);
+ else
+ *((long *)buff)= 0;
return 0;
}
@@ -6588,9 +6601,15 @@ static int show_ssl_get_default_timeout(
{
var->type= SHOW_LONG;
var->value= buff;
- *((long *)buff)= (long)thd->net.vio->ssl_arg ?
- SSL_get_default_timeout((SSL*)thd->net.vio->ssl_arg) :
- 0;
+ /*
+ We need to check if we have a connection
+ since this isn't always true if we for example
+ call global status from inside an event.
+ */
+ if( thd->net.vio && thd->net.vio->ssl_arg )
+ *((long *)buff)= (long)SSL_get_default_timeout((SSL*)thd->net.vio->ssl_arg);
+ else
+ *((long *)buff)= 0;
return 0;
}
@@ -6598,9 +6617,15 @@ static int show_ssl_get_verify_mode(THD
{
var->type= SHOW_LONG;
var->value= buff;
- *((long *)buff)= (long)thd->net.vio->ssl_arg ?
- SSL_get_verify_mode((SSL*)thd->net.vio->ssl_arg) :
- 0;
+ /*
+ We need to check if we have a connection
+ since this isn't always true if we for example
+ call global status from inside an event.
+ */
+ if( thd->net.vio && thd->net.vio->ssl_arg )
+ *((long *)buff)= (long)SSL_get_verify_mode((SSL*)thd->net.vio->ssl_arg);
+ else
+ *((long *)buff)= 0;
return 0;
}
@@ -6608,17 +6633,30 @@ static int show_ssl_get_verify_depth(THD
{
var->type= SHOW_LONG;
var->value= buff;
- *((long *)buff)= (long)thd->net.vio->ssl_arg ?
- SSL_get_verify_depth((SSL*)thd->net.vio->ssl_arg) :
- 0;
+ /*
+ We need to check if we have a connection
+ since this isn't always true if we for example
+ call global status from inside an event.
+ */
+ if( thd->net.vio && thd->net.vio->ssl_arg )
+ *((long *)buff)= (long)SSL_get_verify_depth((SSL*)thd->net.vio->ssl_arg);
+ else
+ *((long *)buff)= 0;
return 0;
}
static int show_ssl_get_cipher(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_CHAR;
- var->value= const_cast<char*>(thd->net.vio->ssl_arg ?
- SSL_get_cipher((SSL*) thd->net.vio->ssl_arg) : "");
+ /*
+ We need to check if we have a connection
+ since this isn't always true if we for example
+ call global status from inside an event.
+ */
+ if( thd->net.vio && thd->net.vio->ssl_arg )
+ var->value= const_cast<char*>(SSL_get_cipher((SSL*) thd->net.vio->ssl_arg));
+ else
+ var->value= "";
return 0;
}
@@ -6626,7 +6664,12 @@ static int show_ssl_get_cipher_list(THD
{
var->type= SHOW_CHAR;
var->value= buff;
- if (thd->net.vio->ssl_arg)
+ /*
+ We need to check if we have a connection
+ since this isn't always true if we for example
+ call global status from inside an event.
+ */
+ if (thd->net.vio && thd->net.vio->ssl_arg)
{
int i;
const char *p;
--- 1.147/mysql-test/r/information_schema.result 2007-03-14 11:10:43 +01:00
+++ 1.148/mysql-test/r/information_schema.result 2007-03-14 11:10:43 +01:00
@@ -1408,4 +1408,23 @@ select user,db from information_schema.p
user db
user3148 test
drop user user3148@localhost;
+DROP TABLE IF EXISTS thread_status;
+CREATE TABLE thread_status (variable_name VARCHAR(64),
+variable_value DECIMAL(22,7));
+DROP EVENT IF EXISTS log_status;
+CREATE EVENT log_status
+ON SCHEDULE EVERY 1 SECOND
+DO
+BEGIN
+INSERT INTO thread_status SELECT variable_name, variable_value FROM
+information_schema.global_status;
+END$$
+SET GLOBAL event_scheduler=1;
+SELECT * FROM thread_status LIMIT 1,2;
+variable_name variable_value
+ABORTED_CONNECTS 0.0000000
+BINLOG_CACHE_DISK_USE 0.0000000
+DROP EVENT log_status;
+DROP TABLE thread_status;
+SET GLOBAL event_scheduler=0;
End of 5.1 tests.
--- 1.94/mysql-test/t/information_schema.test 2007-03-14 11:10:43 +01:00
+++ 1.95/mysql-test/t/information_schema.test 2007-03-14 11:10:43 +01:00
@@ -1042,5 +1042,37 @@ select user,db from information_schema.p
connection default;
drop user user3148@localhost;
+
+
+#
+# Bug #26174 Server Crash: INSERT ... SELECT ... FROM I_S.GLOBAL_STATUS in Event
+#
+--disable_warnings
+DROP TABLE IF EXISTS thread_status;
+CREATE TABLE thread_status (variable_name VARCHAR(64),
+variable_value DECIMAL(22,7));
+DROP EVENT IF EXISTS log_status;
+--enable_warnings
+
+DELIMITER $$;
+
+CREATE EVENT log_status
+ ON SCHEDULE EVERY 1 SECOND
+ DO
+ BEGIN
+ INSERT INTO thread_status SELECT variable_name, variable_value FROM
+information_schema.global_status;
+ END$$
+
+DELIMITER ;$$
+
+SET GLOBAL event_scheduler=1;
+sleep 1;
+SELECT * FROM thread_status LIMIT 1,2;
+
+DROP EVENT log_status;
+DROP TABLE thread_status;
+SET GLOBAL event_scheduler=0;
+
--echo End of 5.1 tests.
| Thread |
|---|
| • bk commit into 5.1 tree (thek:1.2443) | kpettersson | 14 Mar |