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
01d7da67
Commit
01d7da67
authored
Mar 25, 2015
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-7834: ANALYZE FORMAT=JSON output column should be named ANALYZE
parent
e15d7926
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
11 deletions
+14
-11
mysql-test/r/analyze_format_json.result
mysql-test/r/analyze_format_json.result
+7
-7
sql/sql_class.cc
sql/sql_class.cc
+6
-3
sql/sql_class.h
sql/sql_class.h
+1
-1
No files found.
mysql-test/r/analyze_format_json.result
View file @
01d7da67
...
...
@@ -3,7 +3,7 @@ create table t0 (a int);
INSERT INTO t0 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
# r_filtered=30%, because 3 rows match: 0,1,2
analyze format=json select * from t0 where a<3;
EXPLAIN
ANALYZE
{
"query_block": {
"select_id": 1,
...
...
@@ -31,7 +31,7 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f
1 SIMPLE t1 ref a a 5 test.t0.a 1 NULL 100.00 NULL
analyze format=json
select * from t0, t1 where t1.a=t0.a and t0.a > 9;
EXPLAIN
ANALYZE
{
"query_block": {
"select_id": 1,
...
...
@@ -71,7 +71,7 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f
1 SIMPLE t1 ref a a 5 test.t0.a 1 1.00 100.00 40.00 Using where
analyze format=json
select * from t0, t1 where t1.a=t0.a and t1.b<4;
EXPLAIN
ANALYZE
{
"query_block": {
"select_id": 1,
...
...
@@ -113,7 +113,7 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f
1 SIMPLE tbl2 ALL NULL NULL NULL NULL 100 100.00 100.00 94.00 Using where; Using join buffer (flat, BNL join)
analyze format=json
select * from t1 tbl1, t1 tbl2 where tbl1.b<20 and tbl2.b<60;
EXPLAIN
ANALYZE
{
"query_block": {
"select_id": 1,
...
...
@@ -150,7 +150,7 @@ EXPLAIN
}
analyze format=json
select * from t1 tbl1, t1 tbl2 where tbl1.b<20 and tbl2.b<60 and tbl1.c > tbl2.c;
EXPLAIN
ANALYZE
{
"query_block": {
"select_id": 1,
...
...
@@ -196,7 +196,7 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, key(a));
insert into t2 values (0),(1);
analyze format=json select * from t1 straight_join t2 force index(a) where t2.a=t1.a;
EXPLAIN
ANALYZE
{
"query_block": {
"select_id": 1,
...
...
@@ -244,7 +244,7 @@ select database();
database()
NULL
analyze format=json select * from test.t1 where t1.a<5;
EXPLAIN
ANALYZE
{
"query_block": {
"select_id": 1,
...
...
sql/sql_class.cc
View file @
01d7da67
...
...
@@ -2464,7 +2464,7 @@ int THD::send_explain_fields(select_result *result, uint8 explain_flags, bool is
{
List
<
Item
>
field_list
;
if
(
lex
->
explain_json
)
make_explain_json_field_list
(
field_list
);
make_explain_json_field_list
(
field_list
,
is_analyze
);
else
make_explain_field_list
(
field_list
,
explain_flags
,
is_analyze
);
...
...
@@ -2475,9 +2475,12 @@ int THD::send_explain_fields(select_result *result, uint8 explain_flags, bool is
}
void
THD
::
make_explain_json_field_list
(
List
<
Item
>
&
field_list
)
void
THD
::
make_explain_json_field_list
(
List
<
Item
>
&
field_list
,
bool
is_analyze
)
{
Item
*
item
=
new
Item_empty_string
(
"EXPLAIN"
,
78
,
system_charset_info
);
Item
*
item
=
new
Item_empty_string
((
is_analyze
?
"ANALYZE"
:
"EXPLAIN"
),
78
,
system_charset_info
);
field_list
.
push_back
(
item
);
}
...
...
sql/sql_class.h
View file @
01d7da67
...
...
@@ -3171,7 +3171,7 @@ public:
bool
is_analyze
);
void
make_explain_field_list
(
List
<
Item
>
&
field_list
,
uint8
explain_flags
,
bool
is_analyze
);
void
make_explain_json_field_list
(
List
<
Item
>
&
field_list
);
void
make_explain_json_field_list
(
List
<
Item
>
&
field_list
,
bool
is_analyze
);
/**
Clear the current error, if any.
...
...
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