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
be885ebe
Commit
be885ebe
authored
Jun 26, 2014
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup, more tests.
parent
c6be7445
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
mysql-test/r/analyze_stmt.result
mysql-test/r/analyze_stmt.result
+9
-0
mysql-test/t/analyze_stmt.test
mysql-test/t/analyze_stmt.test
+7
-0
sql/sql_parse.cc
sql/sql_parse.cc
+1
-9
No files found.
mysql-test/r/analyze_stmt.result
View file @
be885ebe
...
...
@@ -242,3 +242,12 @@ analyze update t1 set i=8;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 4 100.00 100.00
drop table t1;
#
# Check ANALYZE SELECT INTO
#
create table t1 (i int);
insert into t1 values (1);
analyze select * from t1 into @var;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 NULL 100.00 NULL
drop table t1;
mysql-test/t/analyze_stmt.test
View file @
be885ebe
...
...
@@ -191,3 +191,10 @@ insert into t1 values (1),(2),(3),(4);
analyze
update
t1
set
i
=
8
;
drop
table
t1
;
--
echo
#
--
echo
# Check ANALYZE SELECT INTO
--
echo
#
create
table
t1
(
i
int
);
insert
into
t1
values
(
1
);
analyze
select
*
from
t1
into
@
var
;
drop
table
t1
;
sql/sql_parse.cc
View file @
be885ebe
...
...
@@ -5256,11 +5256,9 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
}
else
{
select_result
*
save_result
;
Protocol
*
save_protocol
;
if
(
lex
->
analyze_stmt
)
{
save_result
=
result
;
result
=
new
select_send_analyze
();
save_protocol
=
thd
->
protocol
;
thd
->
protocol
=
new
Protocol_discard
(
thd
);
...
...
@@ -5277,16 +5275,10 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
if
(
lex
->
analyze_stmt
)
{
result
=
save_result
;
if
(
!
result
&&
!
(
result
=
new
select_send
()))
return
1
;
delete
thd
->
protocol
;
thd
->
protocol
=
save_protocol
;
if
(
!
res
)
thd
->
lex
->
explain
->
send_explain
(
thd
);
if
(
result
!=
lex
->
result
)
delete
result
;
res
=
thd
->
lex
->
explain
->
send_explain
(
thd
);
}
}
}
...
...
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