Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f84ba1b5
Commit
f84ba1b5
authored
Apr 09, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge pilot:mysql/mysql-5.1-rpl
into shellback.(none):/home/msvensson/mysql/mysql-5.1-new-rpl
parents
3478d27f
ed6b8e22
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
170 additions
and
87 deletions
+170
-87
mysql-test/include/check-testcase.test
mysql-test/include/check-testcase.test
+1
-1
mysql-test/include/restart_mysqld.inc
mysql-test/include/restart_mysqld.inc
+15
-0
mysql-test/include/wait_until_disconnected.inc
mysql-test/include/wait_until_disconnected.inc
+21
-0
mysql-test/r/events_bugs.result
mysql-test/r/events_bugs.result
+1
-0
mysql-test/r/events_restart.result
mysql-test/r/events_restart.result
+22
-0
mysql-test/r/events_restart_phase1.result
mysql-test/r/events_restart_phase1.result
+0
-16
mysql-test/r/events_restart_phase3.result
mysql-test/r/events_restart_phase3.result
+0
-6
mysql-test/t/events_bugs.test
mysql-test/t/events_bugs.test
+3
-0
mysql-test/t/events_restart-master.opt
mysql-test/t/events_restart-master.opt
+1
-0
mysql-test/t/events_restart.test
mysql-test/t/events_restart.test
+106
-0
mysql-test/t/events_restart_phase2-master.opt
mysql-test/t/events_restart_phase2-master.opt
+0
-1
mysql-test/t/events_restart_phase2.test
mysql-test/t/events_restart_phase2.test
+0
-41
mysql-test/t/events_restart_phase3-master.opt
mysql-test/t/events_restart_phase3-master.opt
+0
-1
mysql-test/t/events_restart_phase3.test
mysql-test/t/events_restart_phase3.test
+0
-21
No files found.
mysql-test/include/check-testcase.test
View file @
f84ba1b5
...
...
@@ -13,7 +13,7 @@
show
global
variables
where
Variable_name
!=
'timestamp'
;
# Dump all databases, there should be none
# except
mysql, test and information_schema
# except
those that was created during bootstrap
show
databases
;
# The test database should not contain any tables
...
...
mysql-test/include/restart_mysqld.inc
0 → 100644
View file @
f84ba1b5
# Write file to make mysql-test-run.pl expect crash and restart
--
exec
echo
"restart"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
--
exec
$MYSQLADMIN
--
defaults
-
file
=
$MYSQLTEST_VARDIR
/
my
.
cnf
shutdown
# Call script that will poll the server waiting for it to be gone
--
source
include
/
wait_until_disconnected
.
inc
# Turn on reconnect
--
enable_reconnect
# Call script that will poll the server waiting for it to be back online again
--
source
include
/
wait_until_connected_again
.
inc
mysql-test/include/wait_until_disconnected.inc
0 → 100644
View file @
f84ba1b5
#
# Include this script to wait until the connection to the
# server has been dropped
--
disable_result_log
--
disable_query_log
let
$counter
=
500
;
let
$mysql_errno
=
9999
;
while
(
!
$mysql_errno
)
{
--
error
0
,
2002
,
2006
show
status
;
dec
$counter
;
if
(
!
$counter
)
{
--
die
Server
failed
to
dissapear
}
--
sleep
0.1
}
--
enable_query_log
--
enable_result_log
mysql-test/r/events_bugs.result
View file @
f84ba1b5
...
...
@@ -736,3 +736,4 @@ select name from mysql.event where name = 'p' and sql_mode = @full_mode;
name
drop event e1;
DROP DATABASE events_test;
SET GLOBAL event_scheduler= 'ON';
mysql-test/r/events_restart
_phase2
.result
→
mysql-test/r/events_restart.result
View file @
f84ba1b5
set global event_scheduler=off;
drop database if exists events_test;
create database events_test;
use events_test;
create table execution_log(name char(10));
create event abc1 on schedule every 1 second do
insert into execution_log value('abc1');
create event abc2 on schedule every 1 second do
insert into execution_log value('abc2');
create event abc3 on schedule every 1 second do
insert into execution_log value('abc3');
create table event_like like mysql.event;
insert into event_like select * from mysql.event;
alter table mysql.event
change column body body longtext character set utf8 collate utf8_bin;
"Now we restart the server"
use events_test;
select @@event_scheduler;
@@event_scheduler
...
...
@@ -40,3 +56,9 @@ Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
Now let's restart the server again
use events_test;
select @@event_scheduler;
@@event_scheduler
ON
drop table execution_log;
drop database events_test;
mysql-test/r/events_restart_phase1.result
deleted
100644 → 0
View file @
3478d27f
set global event_scheduler=off;
drop database if exists events_test;
create database events_test;
use events_test;
create table execution_log(name char(10));
create event abc1 on schedule every 1 second do
insert into execution_log value('abc1');
create event abc2 on schedule every 1 second do
insert into execution_log value('abc2');
create event abc3 on schedule every 1 second do
insert into execution_log value('abc3');
create table event_like like mysql.event;
insert into event_like select * from mysql.event;
alter table mysql.event
change column body body longtext character set utf8 collate utf8_bin;
"Now we restart the server"
mysql-test/r/events_restart_phase3.result
deleted
100644 → 0
View file @
3478d27f
use events_test;
select @@event_scheduler;
@@event_scheduler
ON
drop table execution_log;
drop database events_test;
mysql-test/t/events_bugs.test
View file @
f84ba1b5
...
...
@@ -971,4 +971,7 @@ let $wait_condition=
DROP
DATABASE
events_test
;
# Restore event_schedulre setting to how it was when test started
SET
GLOBAL
event_scheduler
=
'ON'
;
# THIS MUST BE THE LAST LINE in this file.
mysql-test/t/events_restart-master.opt
0 → 100644
View file @
f84ba1b5
--event-scheduler
mysql-test/t/events_restart
_phase1
.test
→
mysql-test/t/events_restart.test
View file @
f84ba1b5
# Can't test with embedded server that doesn't support grants
--
source
include
/
not_embedded
.
inc
#
# Test that when the server is restarted, it checks mysql.event table,
# and disables the scheduler if it's not up to date.
...
...
@@ -41,3 +42,65 @@ insert into event_like select * from mysql.event;
alter
table
mysql
.
event
change
column
body
body
longtext
character
set
utf8
collate
utf8_bin
;
--
echo
"Now we restart the server"
--
source
include
/
restart_mysqld
.
inc
use
events_test
;
# Event scheduler should be disabled: the system tables are damaged
select
@@
event_scheduler
;
# Try various Event Scheduler operation and check the output.
--
error
ER_EVENTS_DB_ERROR
show
events
;
--
error
ER_EVENTS_DB_ERROR
select
event_name
from
information_schema
.
events
;
--
error
ER_EVENTS_DB_ERROR
show
create
event
intact_check
;
--
error
ER_EVENTS_DB_ERROR
drop
event
no_such_event
;
--
error
ER_EVENTS_DB_ERROR
create
event
intact_check_1
on
schedule
every
5
hour
do
select
5
;
--
error
ER_EVENTS_DB_ERROR
alter
event
intact_check_1
on
schedule
every
8
hour
do
select
8
;
--
error
ER_EVENTS_DB_ERROR
alter
event
intact_check_1
rename
to
intact_check_2
;
--
error
ER_EVENTS_DB_ERROR
drop
event
intact_check_1
;
--
error
ER_EVENTS_DB_ERROR
drop
event
intact_check_2
;
--
error
ER_EVENTS_DB_ERROR
drop
event
intact_check
;
--
error
ER_EVENTS_DB_ERROR
set
global
event_scheduler
=
on
;
--
error
ER_EVENTS_DB_ERROR
set
global
event_scheduler
=
off
;
show
variables
like
'event_scheduler'
;
--
echo
Make
sure
that
we
still
can
create
and
drop
databases
,
--
echo
and
no
warnings
are
produced
.
drop
database
if
exists
mysqltest_database_not_exists
;
create
database
mysqltest_db1
;
drop
database
mysqltest_db1
;
--
echo
Restore
the
original
mysql
.
event
table
drop
table
mysql
.
event
;
rename
table
event_like
to
mysql
.
event
;
--
echo
Now
let
's restart the server again
--source include/restart_mysqld.inc
# We need this file primarily to make sure that the scheduler is restarted
# and enabled after we have restored mysql.event table.
# This is the final step of the "cleanup".
#
# Make sure also that events are executed OK after restart, just in case.
use events_test;
# Make sure the scheduler was started successfully
select @@event_scheduler;
let $wait_condition=select count(distinct name)=3 from execution_log;
--source include/wait_condition.inc
drop table execution_log;
# Will drop all events
drop database events_test;
let $wait_condition=
select count(*) = 0 from information_schema.processlist
where db='
events_test
' and command = '
Connect
'
and
user
=
current_user
();
--
source
include
/
wait_condition
.
inc
mysql-test/t/events_restart_phase2-master.opt
deleted
100644 → 0
View file @
3478d27f
--event-scheduler=on --force-restart
mysql-test/t/events_restart_phase2.test
deleted
100644 → 0
View file @
3478d27f
# Can't test with embedded server that doesn't support grants
--
source
include
/
not_embedded
.
inc
use
events_test
;
# Event scheduler should be disabled: the system tables are damaged
select
@@
event_scheduler
;
# Try various Event Scheduler operation and check the output.
--
error
ER_EVENTS_DB_ERROR
show
events
;
--
error
ER_EVENTS_DB_ERROR
select
event_name
from
information_schema
.
events
;
--
error
ER_EVENTS_DB_ERROR
show
create
event
intact_check
;
--
error
ER_EVENTS_DB_ERROR
drop
event
no_such_event
;
--
error
ER_EVENTS_DB_ERROR
create
event
intact_check_1
on
schedule
every
5
hour
do
select
5
;
--
error
ER_EVENTS_DB_ERROR
alter
event
intact_check_1
on
schedule
every
8
hour
do
select
8
;
--
error
ER_EVENTS_DB_ERROR
alter
event
intact_check_1
rename
to
intact_check_2
;
--
error
ER_EVENTS_DB_ERROR
drop
event
intact_check_1
;
--
error
ER_EVENTS_DB_ERROR
drop
event
intact_check_2
;
--
error
ER_EVENTS_DB_ERROR
drop
event
intact_check
;
--
error
ER_EVENTS_DB_ERROR
set
global
event_scheduler
=
on
;
--
error
ER_EVENTS_DB_ERROR
set
global
event_scheduler
=
off
;
show
variables
like
'event_scheduler'
;
--
echo
Make
sure
that
we
still
can
create
and
drop
databases
,
--
echo
and
no
warnings
are
produced
.
drop
database
if
exists
mysqltest_database_not_exists
;
create
database
mysqltest_db1
;
drop
database
mysqltest_db1
;
--
echo
Restore
the
original
mysql
.
event
table
drop
table
mysql
.
event
;
rename
table
event_like
to
mysql
.
event
;
--
echo
Now
let
'
s
restart
the
server
again
mysql-test/t/events_restart_phase3-master.opt
deleted
100644 → 0
View file @
3478d27f
--event-scheduler=1
mysql-test/t/events_restart_phase3.test
deleted
100644 → 0
View file @
3478d27f
# Can't test with embedded server that doesn't support grants
--
source
include
/
not_embedded
.
inc
#
# We need this file primarily to make sure that the scheduler is restarted
# and enabled after we have restored mysql.event table.
# This is the final step of the "cleanup".
#
# Make sure also that events are executed OK after restart, just in case.
use
events_test
;
# Make sure the scheduler was started successfully
select
@@
event_scheduler
;
let
$wait_condition
=
select
count
(
distinct
name
)
=
3
from
execution_log
;
--
source
include
/
wait_condition
.
inc
drop
table
execution_log
;
# Will drop all events
drop
database
events_test
;
let
$wait_condition
=
select
count
(
*
)
=
0
from
information_schema
.
processlist
where
db
=
'events_test'
and
command
=
'Connect'
and
user
=
current_user
();
--
source
include
/
wait_condition
.
inc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment