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
c7837821
Commit
c7837821
authored
Mar 02, 2006
by
andrey@lmy004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test
parent
550e73cc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
16 deletions
+31
-16
mysql-test/r/events_logs_tests.result
mysql-test/r/events_logs_tests.result
+16
-11
mysql-test/t/events_logs_tests.test
mysql-test/t/events_logs_tests.test
+15
-5
No files found.
mysql-test/r/events_logs_tests.result
View file @
c7837821
create database if not exists events_test;
use events_test;
"We use procedure here because its statements won't be logged into the general log"
"If we had used normal select that are logged in different ways depending on whether"
"the test suite is run in normal mode or with --ps-protocol"
CREATE procedure select_general_log()
BEGIN
SELECT user_host, argument FROM mysql.general_log WHERE argument LIKE '%alabala%';
END|
"Check General Query Log"
SET GLOBAL event_scheduler=0;
create event log_general on schedule every 1 minute do
se
Lect 'alabala', sleep(3) from dual;
create event log_general on schedule every 1 minute do
SE
Lect 'alabala', sleep(3) from dual;
TRUNCATE mysql.general_log;
SELECT user_host, command_type, argument FROM mysql.general_log;
user_host command_type argument
root[root] @ localhost [] Query SELECT user_host, command_type, argument FROM mysql.general_log
"1 row, the current statement!"
call select_general_log();
user_host argument
SET GLOBAL event_scheduler=1;
"Wait the scheduler to start"
"Should see 3 rows. The create, the seLect and the select from the general_log"
SELECT user_host, command_type, argument FROM mysql.general_log;
user_host command_type argument
root[root] @ localhost [] Query SELECT user_host, command_type, argument FROM mysql.general_log
root[root] @ localhost [] Query SET GLOBAL event_scheduler=1
root[root] @ localhost [localhost] Query seLect 'alabala', sleep(3) from dual
root[root] @ localhost [] Query SELECT user_host, command_type, argument FROM mysql.general_log
"Should see 3 rows - the 'SELect' is in the middle. The other two are selects from general_log"
call select_general_log();
user_host argument
root[root] @ localhost [localhost] SELect 'alabala', sleep(3) from dual
DROP PROCEDURE select_general_log;
DROP EVENT log_general;
SET GLOBAL event_scheduler=0;
"Check slow query log"
...
...
mysql-test/t/events_logs_tests.test
View file @
c7837821
create
database
if
not
exists
events_test
;
use
events_test
;
--
echo
"We use procedure here because its statements won't be logged into the general log"
--
echo
"If we had used normal select that are logged in different ways depending on whether"
--
echo
"the test suite is run in normal mode or with --ps-protocol"
delimiter
|
;
CREATE
procedure
select_general_log
()
BEGIN
SELECT
user_host
,
argument
FROM
mysql
.
general_log
WHERE
argument
LIKE
'%alabala%'
;
END
|
delimiter
;
|
--
echo
"Check General Query Log"
SET
GLOBAL
event_scheduler
=
0
;
create
event
log_general
on
schedule
every
1
minute
do
se
Lect
'alabala'
,
sleep
(
3
)
from
dual
;
create
event
log_general
on
schedule
every
1
minute
do
SE
Lect
'alabala'
,
sleep
(
3
)
from
dual
;
TRUNCATE
mysql
.
general_log
;
SELECT
user_host
,
command_type
,
argument
FROM
mysql
.
general_log
;
--
echo
"1 row, the current statement!"
call
select_general_log
();
SET
GLOBAL
event_scheduler
=
1
;
--
echo
"Wait the scheduler to start"
--
echo
"Should see 3 rows
. The create, the seLect and the select from the
general_log"
--
echo
"Should see 3 rows
- the 'SELect' is in the middle. The other two are selects from
general_log"
--
sleep
2
SELECT
user_host
,
command_type
,
argument
FROM
mysql
.
general_log
;
call
select_general_log
();
DROP
PROCEDURE
select_general_log
;
DROP
EVENT
log_general
;
SET
GLOBAL
event_scheduler
=
0
;
--
sleep
1
...
...
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