Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-base
into lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge sql/events.cc: Auto merged
This commit is contained in:
commit
d87ae86bc6
@ -3,6 +3,10 @@ drop database if exists mysqltest_db1;
|
||||
drop database if exists mysqltest_db2;
|
||||
create database events_test;
|
||||
use events_test;
|
||||
select * from information_schema.global_variables where variable_name like 'event_scheduler';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
EVENT_SCHEDULER ON
|
||||
SET GLOBAL event_scheduler = 'OFF';
|
||||
CREATE EVENT lower_case ON SCHEDULE EVERY 1 MINUTE DO SELECT 1;
|
||||
CREATE EVENT Lower_case ON SCHEDULE EVERY 2 MINUTE DO SELECT 2;
|
||||
ERROR HY000: Event 'Lower_case' already exists
|
||||
|
@ -125,3 +125,12 @@ drop function bug27563;
|
||||
drop procedure proc27563;
|
||||
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 ';
|
||||
EXECUTE stmt;
|
||||
#
|
||||
# Bug#19723: kill of active connection yields different error code
|
||||
# depending on platform.
|
||||
#
|
||||
|
||||
# Connection: con2.
|
||||
KILL CONNECTION_ID();
|
||||
SELECT 1;
|
||||
ERROR HY000: Lost connection to MySQL server during query
|
||||
|
@ -4,3 +4,6 @@ select 1+1;
|
||||
select 1+2;
|
||||
1+2
|
||||
3
|
||||
SHOW GLOBAL VARIABLES LIKE 'thread_handling';
|
||||
Variable_name Value
|
||||
thread_handling no-threads
|
||||
|
1
mysql-test/t/events_bugs-master.opt
Normal file
1
mysql-test/t/events_bugs-master.opt
Normal file
@ -0,0 +1 @@
|
||||
--event-scheduler
|
@ -9,6 +9,21 @@ drop database if exists mysqltest_db2;
|
||||
create database events_test;
|
||||
use events_test;
|
||||
|
||||
#
|
||||
# START: Bug #31332 --event-scheduler option misbehaving
|
||||
#
|
||||
|
||||
# NOTE!! this test must come first! It's testing that the --event-scheduler
|
||||
# option with no argument in events_bugs-master.opt turns the scheduler on.
|
||||
|
||||
select * from information_schema.global_variables where variable_name like 'event_scheduler';
|
||||
|
||||
SET GLOBAL event_scheduler = 'OFF';
|
||||
|
||||
#
|
||||
# END: Bug #31332
|
||||
#
|
||||
|
||||
#
|
||||
# START - 16415: Events: event names are case sensitive
|
||||
#
|
||||
|
@ -1142,6 +1142,7 @@ END$$
|
||||
|
||||
DELIMITER ;$$
|
||||
|
||||
let $wait_timeout= 300;
|
||||
let $wait_condition=select count(*) = 0 from information_schema.events where event_name='event_status';
|
||||
--source include/wait_condition.inc
|
||||
|
||||
|
@ -304,3 +304,19 @@ while ($i)
|
||||
dec $i ;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
###########################################################################
|
||||
|
||||
--echo #
|
||||
--echo # Bug#19723: kill of active connection yields different error code
|
||||
--echo # depending on platform.
|
||||
--echo #
|
||||
|
||||
--echo
|
||||
--echo # Connection: con2.
|
||||
--connection con2
|
||||
|
||||
KILL CONNECTION_ID();
|
||||
|
||||
--error 2013
|
||||
SELECT 1;
|
||||
|
@ -3,3 +3,4 @@
|
||||
#
|
||||
select 1+1;
|
||||
select 1+2;
|
||||
SHOW GLOBAL VARIABLES LIKE 'thread_handling';
|
||||
|
@ -146,7 +146,7 @@ bool
|
||||
Events::set_opt_event_scheduler(char *argument)
|
||||
{
|
||||
if (argument == NULL)
|
||||
opt_event_scheduler= Events::EVENTS_DISABLED;
|
||||
opt_event_scheduler= Events::EVENTS_ON;
|
||||
else
|
||||
{
|
||||
int type;
|
||||
|
@ -356,10 +356,35 @@ String *Item_func_concat::val_str(String *str)
|
||||
}
|
||||
else
|
||||
{ // Two big const strings
|
||||
if (tmp_value.alloc(max_length) ||
|
||||
tmp_value.copy(*res) ||
|
||||
tmp_value.append(*res2))
|
||||
/*
|
||||
NOTE: We should be prudent in the initial allocation unit -- the
|
||||
size of the arguments is a function of data distribution, which
|
||||
can be any. Instead of overcommitting at the first row, we grow
|
||||
the allocated amount by the factor of 2. This ensures that no
|
||||
more than 25% of memory will be overcommitted on average.
|
||||
*/
|
||||
|
||||
uint concat_len= res->length() + res2->length();
|
||||
|
||||
if (tmp_value.alloced_length() < concat_len)
|
||||
{
|
||||
if (tmp_value.alloced_length() == 0)
|
||||
{
|
||||
if (tmp_value.alloc(concat_len))
|
||||
goto null;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint new_len = max(tmp_value.alloced_length() * 2, concat_len);
|
||||
|
||||
if (tmp_value.realloc(new_len))
|
||||
goto null;
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp_value.copy(*res) || tmp_value.append(*res2))
|
||||
goto null;
|
||||
|
||||
res= &tmp_value;
|
||||
use_as_buff=str;
|
||||
}
|
||||
@ -679,8 +704,33 @@ String *Item_func_concat_ws::val_str(String *str)
|
||||
}
|
||||
else
|
||||
{ // Two big const strings
|
||||
if (tmp_value.alloc(max_length) ||
|
||||
tmp_value.copy(*res) ||
|
||||
/*
|
||||
NOTE: We should be prudent in the initial allocation unit -- the
|
||||
size of the arguments is a function of data distribution, which can
|
||||
be any. Instead of overcommitting at the first row, we grow the
|
||||
allocated amount by the factor of 2. This ensures that no more than
|
||||
25% of memory will be overcommitted on average.
|
||||
*/
|
||||
|
||||
uint concat_len= res->length() + sep_str->length() + res2->length();
|
||||
|
||||
if (tmp_value.alloced_length() < concat_len)
|
||||
{
|
||||
if (tmp_value.alloced_length() == 0)
|
||||
{
|
||||
if (tmp_value.alloc(concat_len))
|
||||
goto null;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint new_len = max(tmp_value.alloced_length() * 2, concat_len);
|
||||
|
||||
if (tmp_value.realloc(new_len))
|
||||
goto null;
|
||||
}
|
||||
}
|
||||
|
||||
if (tmp_value.copy(*res) ||
|
||||
tmp_value.append(*sep_str) ||
|
||||
tmp_value.append(*res2))
|
||||
goto null;
|
||||
|
@ -7745,12 +7745,13 @@ mysqld_get_one_option(int optid,
|
||||
break;
|
||||
}
|
||||
case OPT_ONE_THREAD:
|
||||
global_system_variables.thread_handling= 2;
|
||||
global_system_variables.thread_handling=
|
||||
SCHEDULER_ONE_THREAD_PER_CONNECTION;
|
||||
break;
|
||||
case OPT_THREAD_HANDLING:
|
||||
{
|
||||
global_system_variables.thread_handling=
|
||||
find_type_or_exit(argument, &thread_handling_typelib, opt->name);
|
||||
find_type_or_exit(argument, &thread_handling_typelib, opt->name)-1;
|
||||
break;
|
||||
}
|
||||
case OPT_FT_BOOLEAN_SYNTAX:
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
|
||||
enum scheduler_types
|
||||
{
|
||||
SCHEDULER_ONE_THREAD_PER_CONNECTION=1,
|
||||
SCHEDULER_ONE_THREAD_PER_CONNECTION=0,
|
||||
SCHEDULER_NO_THREADS,
|
||||
SCHEDULER_POOL_OF_THREADS
|
||||
};
|
||||
|
@ -818,7 +818,20 @@ void THD::awake(THD::killed_state state_to_set)
|
||||
if (!slave_thread)
|
||||
thread_scheduler.post_kill_notification(this);
|
||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||
close_active_vio();
|
||||
if (this != current_thd)
|
||||
{
|
||||
/*
|
||||
In addition to a signal, let's close the socket of the thread that
|
||||
is being killed. This is to make sure it does not block if the
|
||||
signal is lost. This needs to be done only on platforms where
|
||||
signals are not a reliable interruption mechanism.
|
||||
|
||||
If we're killing ourselves, we know that we're not blocked, so this
|
||||
hack is not used.
|
||||
*/
|
||||
|
||||
close_active_vio();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (mysys_var)
|
||||
|
Loading…
x
Reference in New Issue
Block a user