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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
833e4075
Commit
833e4075
authored
Mar 02, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into lmy004.:/work/mysql-5.1-bug17494
parents
cb46f3a3
5513aaa3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
6 deletions
+55
-6
mysql-test/r/events_logs_tests.result
mysql-test/r/events_logs_tests.result
+19
-0
mysql-test/t/events_logs_tests-master.opt
mysql-test/t/events_logs_tests-master.opt
+0
-0
mysql-test/t/events_logs_tests.test
mysql-test/t/events_logs_tests.test
+15
-0
sql/event_timed.cc
sql/event_timed.cc
+2
-0
sql/sp_head.cc
sql/sp_head.cc
+17
-5
sql/sp_head.h
sql/sp_head.h
+2
-1
No files found.
mysql-test/r/events_
slow_query
.result
→
mysql-test/r/events_
logs_tests
.result
View file @
833e4075
create database if not exists events_test;
create database if not exists events_test;
use events_test;
use events_test;
"Check General Query Log"
SET GLOBAL event_scheduler=0;
create event log_general on schedule every 1 minute do seLect '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
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
DROP EVENT log_general;
SET GLOBAL event_scheduler=0;
"Check slow query log"
"Save the values"
"Save the values"
SET @old_global_long_query_time:=(select get_value());
SET @old_global_long_query_time:=(select get_value());
SET @old_session_long_query_time:=@@long_query_time;
SET @old_session_long_query_time:=@@long_query_time;
...
...
mysql-test/t/events_
slow_query
-master.opt
→
mysql-test/t/events_
logs_tests
-master.opt
View file @
833e4075
File moved
mysql-test/t/events_
slow_query
.test
→
mysql-test/t/events_
logs_tests
.test
View file @
833e4075
create
database
if
not
exists
events_test
;
create
database
if
not
exists
events_test
;
use
events_test
;
use
events_test
;
--
echo
"Check General Query Log"
SET
GLOBAL
event_scheduler
=
0
;
create
event
log_general
on
schedule
every
1
minute
do
seLect
'alabala'
,
sleep
(
3
)
from
dual
;
TRUNCATE
mysql
.
general_log
;
SELECT
user_host
,
command_type
,
argument
FROM
mysql
.
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"
--
sleep
2
SELECT
user_host
,
command_type
,
argument
FROM
mysql
.
general_log
;
DROP
EVENT
log_general
;
SET
GLOBAL
event_scheduler
=
0
;
--
sleep
1
--
echo
"Check slow query log"
--
disable_query_log
--
disable_query_log
DELIMITER
|
;
DELIMITER
|
;
CREATE
FUNCTION
get_value
()
CREATE
FUNCTION
get_value
()
...
...
sql/event_timed.cc
View file @
833e4075
...
@@ -1164,6 +1164,8 @@ Event_timed::execute(THD *thd, MEM_ROOT *mem_root)
...
@@ -1164,6 +1164,8 @@ Event_timed::execute(THD *thd, MEM_ROOT *mem_root)
empty_item_list
.
empty
();
empty_item_list
.
empty
();
if
(
thd
->
enable_slow_log
)
if
(
thd
->
enable_slow_log
)
sphead
->
m_flags
|=
sp_head
::
LOG_SLOW_STATEMENTS
;
sphead
->
m_flags
|=
sp_head
::
LOG_SLOW_STATEMENTS
;
sphead
->
m_flags
|=
sp_head
::
LOG_GENERAL_LOG
;
ret
=
sphead
->
execute_procedure
(
thd
,
&
empty_item_list
);
ret
=
sphead
->
execute_procedure
(
thd
,
&
empty_item_list
);
}
}
else
else
...
...
sql/sp_head.cc
View file @
833e4075
...
@@ -1413,6 +1413,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
...
@@ -1413,6 +1413,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
sp_rcontext
*
save_spcont
,
*
octx
;
sp_rcontext
*
save_spcont
,
*
octx
;
sp_rcontext
*
nctx
=
NULL
;
sp_rcontext
*
nctx
=
NULL
;
bool
save_enable_slow_log
=
false
;
bool
save_enable_slow_log
=
false
;
bool
save_log_general
=
false
;
DBUG_ENTER
(
"sp_head::execute_procedure"
);
DBUG_ENTER
(
"sp_head::execute_procedure"
);
DBUG_PRINT
(
"info"
,
(
"procedure %s"
,
m_name
.
str
));
DBUG_PRINT
(
"info"
,
(
"procedure %s"
,
m_name
.
str
));
...
@@ -1511,20 +1512,28 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
...
@@ -1511,20 +1512,28 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
DBUG_PRINT
(
"info"
,(
" %.*s: eval args done"
,
m_name
.
length
,
m_name
.
str
));
DBUG_PRINT
(
"info"
,(
" %.*s: eval args done"
,
m_name
.
length
,
m_name
.
str
));
}
}
if
(
thd
->
enable_slow_log
&&
!
(
m_flags
&
LOG_SLOW_STATEMENTS
)
)
if
(
!
(
m_flags
&
LOG_SLOW_STATEMENTS
)
&&
thd
->
enable_slow_log
)
{
{
DBUG_PRINT
(
"info"
,
(
"Disabling slow log for the execution"
));
DBUG_PRINT
(
"info"
,
(
"Disabling slow log for the execution"
));
save_enable_slow_log
=
t
hd
->
enable_slow_log
;
save_enable_slow_log
=
t
rue
;
thd
->
enable_slow_log
=
FALSE
;
thd
->
enable_slow_log
=
FALSE
;
}
}
if
(
!
(
m_flags
&
LOG_GENERAL_LOG
)
&&
!
(
thd
->
options
&
OPTION_LOG_OFF
))
{
DBUG_PRINT
(
"info"
,
(
"Disabling general log for the execution"
));
save_log_general
=
true
;
/* disable this bit */
thd
->
options
|=
OPTION_LOG_OFF
;
}
thd
->
spcont
=
nctx
;
thd
->
spcont
=
nctx
;
if
(
!
err_status
)
if
(
!
err_status
)
err_status
=
execute
(
thd
);
err_status
=
execute
(
thd
);
if
(
save_enable_slow_log
&&
!
(
m_flags
&
LOG_SLOW_STATEMENTS
))
if
(
save_log_general
)
thd
->
enable_slow_log
=
save_enable_slow_log
;
thd
->
options
&=
~
OPTION_LOG_OFF
;
if
(
save_enable_slow_log
)
thd
->
enable_slow_log
=
true
;
/*
/*
In the case when we weren't able to employ reuse mechanism for
In the case when we weren't able to employ reuse mechanism for
OUT/INOUT paranmeters, we should reallocate memory. This
OUT/INOUT paranmeters, we should reallocate memory. This
...
@@ -2303,6 +2312,9 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
...
@@ -2303,6 +2312,9 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
(the order of query cache and subst_spvars calls is irrelevant because
(the order of query cache and subst_spvars calls is irrelevant because
queries with SP vars can't be cached)
queries with SP vars can't be cached)
*/
*/
if
(
unlikely
((
thd
->
options
&
OPTION_LOG_OFF
)
==
0
))
general_log_print
(
thd
,
COM_QUERY
,
"%s"
,
thd
->
query
);
if
(
query_cache_send_result_to_client
(
thd
,
if
(
query_cache_send_result_to_client
(
thd
,
thd
->
query
,
thd
->
query_length
)
<=
0
)
thd
->
query
,
thd
->
query_length
)
<=
0
)
{
{
...
...
sql/sp_head.h
View file @
833e4075
...
@@ -125,7 +125,8 @@ class sp_head :private Query_arena
...
@@ -125,7 +125,8 @@ class sp_head :private Query_arena
HAS_SET_AUTOCOMMIT_STMT
=
64
,
// Is set if a procedure with 'set autocommit'
HAS_SET_AUTOCOMMIT_STMT
=
64
,
// Is set if a procedure with 'set autocommit'
/* Is set if a procedure with COMMIT (implicit or explicit) | ROLLBACK */
/* Is set if a procedure with COMMIT (implicit or explicit) | ROLLBACK */
HAS_COMMIT_OR_ROLLBACK
=
128
,
HAS_COMMIT_OR_ROLLBACK
=
128
,
LOG_SLOW_STATEMENTS
=
256
LOG_SLOW_STATEMENTS
=
256
,
// Used by events
LOG_GENERAL_LOG
=
512
// Used by events
};
};
/* TYPE_ENUM_FUNCTION, TYPE_ENUM_PROCEDURE or TYPE_ENUM_TRIGGER */
/* TYPE_ENUM_FUNCTION, TYPE_ENUM_PROCEDURE or TYPE_ENUM_TRIGGER */
...
...
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