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
bcd854fe
Commit
bcd854fe
authored
Nov 21, 2013
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5308 Crash when running with slow_query_log=1
- Make log_slow_statement() always call delete_explain_query().
parent
146c8a48
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
mysql-test/r/explain_slowquerylog.result
mysql-test/r/explain_slowquerylog.result
+12
-0
mysql-test/t/explain_slowquerylog.test
mysql-test/t/explain_slowquerylog.test
+14
-0
sql/sql_parse.cc
sql/sql_parse.cc
+4
-4
No files found.
mysql-test/r/explain_slowquerylog.result
View file @
bcd854fe
...
@@ -39,3 +39,15 @@ SELECT 'Server still alive?' as 'Yes';
...
@@ -39,3 +39,15 @@ SELECT 'Server still alive?' as 'Yes';
Yes
Yes
Server still alive?
Server still alive?
DROP TABLE t1;
DROP TABLE t1;
#
# MDEV-5308 Crash when running with slow_query_log=1
#
SET @save1= @@log_slow_rate_limit;
SET @save2= @@long_query_time;
SET log_slow_rate_limit=1000;
SET long_query_time=0.000001;
SELECT 1;
1
1
SET log_slow_rate_limit=@save1;
SET long_query_time=@save2;
mysql-test/t/explain_slowquerylog.test
View file @
bcd854fe
...
@@ -47,3 +47,17 @@ SET max_join_size = 10;
...
@@ -47,3 +47,17 @@ SET max_join_size = 10;
SELECT
'Server still alive?'
as
'Yes'
;
SELECT
'Server still alive?'
as
'Yes'
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-5308 Crash when running with slow_query_log=1
--
echo
#
SET
@
save1
=
@@
log_slow_rate_limit
;
SET
@
save2
=
@@
long_query_time
;
SET
log_slow_rate_limit
=
1000
;
SET
long_query_time
=
0.000001
;
SELECT
1
;
SET
log_slow_rate_limit
=@
save1
;
SET
long_query_time
=@
save2
;
sql/sql_parse.cc
View file @
bcd854fe
...
@@ -1554,7 +1554,7 @@ void log_slow_statement(THD *thd)
...
@@ -1554,7 +1554,7 @@ void log_slow_statement(THD *thd)
statement in a trigger or stored function
statement in a trigger or stored function
*/
*/
if
(
unlikely
(
thd
->
in_sub_stmt
))
if
(
unlikely
(
thd
->
in_sub_stmt
))
DBUG_VOID_RETURN
;
// Don't set time for sub stmt
goto
end
;
// Don't set time for sub stmt
/* Follow the slow log filter configuration. */
/* Follow the slow log filter configuration. */
...
@@ -1562,8 +1562,7 @@ void log_slow_statement(THD *thd)
...
@@ -1562,8 +1562,7 @@ void log_slow_statement(THD *thd)
(
thd
->
variables
.
log_slow_filter
(
thd
->
variables
.
log_slow_filter
&&
!
(
thd
->
variables
.
log_slow_filter
&
thd
->
query_plan_flags
)))
&&
!
(
thd
->
variables
.
log_slow_filter
&
thd
->
query_plan_flags
)))
{
{
delete_explain_query
(
thd
->
lex
);
goto
end
;
DBUG_VOID_RETURN
;
}
}
if
(((
thd
->
server_status
&
SERVER_QUERY_WAS_SLOW
)
||
if
(((
thd
->
server_status
&
SERVER_QUERY_WAS_SLOW
)
||
...
@@ -1580,7 +1579,7 @@ void log_slow_statement(THD *thd)
...
@@ -1580,7 +1579,7 @@ void log_slow_statement(THD *thd)
*/
*/
if
(
thd
->
variables
.
log_slow_rate_limit
>
1
&&
if
(
thd
->
variables
.
log_slow_rate_limit
>
1
&&
(
global_query_id
%
thd
->
variables
.
log_slow_rate_limit
)
!=
0
)
(
global_query_id
%
thd
->
variables
.
log_slow_rate_limit
)
!=
0
)
DBUG_VOID_RETURN
;
goto
end
;
thd_proc_info
(
thd
,
"logging slow query"
);
thd_proc_info
(
thd
,
"logging slow query"
);
slow_log_print
(
thd
,
thd
->
query
(),
thd
->
query_length
(),
slow_log_print
(
thd
,
thd
->
query
(),
thd
->
query_length
(),
...
@@ -1588,6 +1587,7 @@ void log_slow_statement(THD *thd)
...
@@ -1588,6 +1587,7 @@ void log_slow_statement(THD *thd)
thd_proc_info
(
thd
,
0
);
thd_proc_info
(
thd
,
0
);
}
}
end:
delete_explain_query
(
thd
->
lex
);
delete_explain_query
(
thd
->
lex
);
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
...
...
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