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
3aaeb730
Commit
3aaeb730
authored
Sep 25, 2013
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
c0028bd2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
30 deletions
+24
-30
sql/sql_parse.cc
sql/sql_parse.cc
+24
-30
No files found.
sql/sql_parse.cc
View file @
3aaeb730
...
...
@@ -1493,7 +1493,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd
->
update_all_stats
();
log_slow_statement
(
thd
);
/* psergey-todo: this is the place we could print EXPLAIN to slow query log */
thd_proc_info
(
thd
,
"cleaning up"
);
thd
->
reset_query
();
...
...
@@ -3351,9 +3350,8 @@ end_with_restore_list:
else
{
result
->
reset_offset_limit
();
thd
->
lex
->
query_plan_footprint
->
print_explain
(
result
,
thd
->
lex
->
describe
);
//delete thd->lex->query_plan_footprint;
//thd->lex->query_plan_footprint= NULL;
thd
->
lex
->
query_plan_footprint
->
print_explain
(
result
,
thd
->
lex
->
describe
);
}
if
(
res
)
...
...
@@ -4881,9 +4879,14 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
if
(
!
(
result
=
new
select_send
()))
return
1
;
/* purecov: inspected */
thd
->
send_explain_fields
(
result
);
//thd->lex->query_plan_footprint= new QPF_query;
/*
This will call optimize() for all parts of query. The query plan is
printed out below.
*/
res
=
mysql_explain_union
(
thd
,
&
thd
->
lex
->
unit
,
result
);
/* Print EXPLAIN only if we don't have an error */
if
(
!
res
)
{
/*
...
...
@@ -4891,20 +4894,9 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
top-level LIMIT
*/
result
->
reset_offset_limit
();
thd
->
lex
->
query_plan_footprint
->
print_explain
(
result
,
thd
->
lex
->
describe
);
}
//delete thd->lex->query_plan_footprint;
//thd->lex->query_plan_footprint= NULL;
//psergey-todo: here, produce the EXPLAIN output.
// mysql_explain_union() itself is only responsible for calling
// optimize() for all parts of the query.
/*
The code which prints the extended description is not robust
against malformed queries, so skip it if we have an error.
*/
if
(
!
res
&&
(
lex
->
describe
&
DESCRIBE_EXTENDED
))
thd
->
lex
->
query_plan_footprint
->
print_explain
(
result
,
thd
->
lex
->
describe
);
if
(
lex
->
describe
&
DESCRIBE_EXTENDED
)
{
char
buff
[
1024
];
String
str
(
buff
,(
uint32
)
sizeof
(
buff
),
system_charset_info
);
...
...
@@ -4917,6 +4909,8 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
push_warning
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_NOTE
,
ER_YES
,
str
.
c_ptr_safe
());
}
}
if
(
res
)
result
->
abort_result_set
();
else
...
...
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