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
3956950b
Commit
3956950b
authored
Jul 24, 2012
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-408: SHOW EXPLAIN: Some values are chopped off in SHOW EXPLAIN output
- Fix I_S table definition for EXPLAIN output.
parent
8950ed8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
4 deletions
+56
-4
mysql-test/r/show_explain.result
mysql-test/r/show_explain.result
+25
-0
mysql-test/t/show_explain.test
mysql-test/t/show_explain.test
+28
-1
sql/sql_show.cc
sql/sql_show.cc
+3
-3
No files found.
mysql-test/r/show_explain.result
View file @
3956950b
...
...
@@ -926,4 +926,29 @@ a
16
set debug_dbug='';
drop table t1;
#
# MDEV-408: SHOW EXPLAIN: Some values are chopped off in SHOW EXPLAIN output
#
CREATE TABLE t1 (a INT, b VARCHAR(35)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (3989,'Abilene'),(3873,'Akron');
CREATE TABLE t2 (c INT, d VARCHAR(52) PRIMARY KEY, KEY(c)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (86,'English'),(87,'Russian');
explain SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 index_subquery PRIMARY,c c 5 func 1 Using index; Using where
set @show_explain_probe_select_id=1;
set debug_dbug='d,show_explain_probe_join_exec_start';
SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 index_subquery PRIMARY,c c 5 func 1 Using index; Using where
Warnings:
Note 1003 SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's'
SUM(a + SLEEP(0.1))
7862
set debug_dbug='';
drop table t1, t2;
# End
drop table t0;
mysql-test/t/show_explain.test
View file @
3956950b
...
...
@@ -947,5 +947,32 @@ set debug_dbug='';
drop
table
t1
;
drop
table
t0
;
--
echo
#
--
echo
# MDEV-408: SHOW EXPLAIN: Some values are chopped off in SHOW EXPLAIN output
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
VARCHAR
(
35
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
3989
,
'Abilene'
),(
3873
,
'Akron'
);
CREATE
TABLE
t2
(
c
INT
,
d
VARCHAR
(
52
)
PRIMARY
KEY
,
KEY
(
c
))
ENGINE
=
InnoDB
;
INSERT
INTO
t2
VALUES
(
86
,
'English'
),(
87
,
'Russian'
);
explain
SELECT
SUM
(
a
+
SLEEP
(
0.1
))
FROM
t1
WHERE
a
IN
(
SELECT
c
FROM
t2
WHERE
d
<
b
)
OR
b
<
's'
;
set
@
show_explain_probe_select_id
=
1
;
set
debug_dbug
=
'd,show_explain_probe_join_exec_start'
;
--
send
SELECT
SUM
(
a
+
SLEEP
(
0.1
))
FROM
t1
WHERE
a
IN
(
SELECT
c
FROM
t2
WHERE
d
<
b
)
OR
b
<
's'
;
connection
default
;
--
source
include
/
wait_condition
.
inc
evalp
show
explain
for
$thr2
;
connection
con1
;
reap
;
set
debug_dbug
=
''
;
drop
table
t1
,
t2
;
--
echo
# End
drop
table
t0
;
sql/sql_show.cc
View file @
3956950b
...
...
@@ -8495,11 +8495,11 @@ ST_FIELD_INFO show_explain_fields_info[]=
SKIP_OPEN_TABLE
},
{
"table"
,
NAME_CHAR_LEN
,
MYSQL_TYPE_STRING
,
0
/*value*/
,
MY_I_S_MAYBE_NULL
,
"table"
,
SKIP_OPEN_TABLE
},
{
"type"
,
1
1
,
MYSQL_TYPE_STRING
,
0
,
MY_I_S_MAYBE_NULL
,
"type"
,
SKIP_OPEN_TABLE
},
{
"type"
,
1
5
,
MYSQL_TYPE_STRING
,
0
,
MY_I_S_MAYBE_NULL
,
"type"
,
SKIP_OPEN_TABLE
},
{
"possible_keys"
,
NAME_CHAR_LEN
*
MAX_KEY
,
MYSQL_TYPE_STRING
,
0
/*value*/
,
MY_I_S_MAYBE_NULL
,
"possible_keys"
,
SKIP_OPEN_TABLE
},
{
"key"
,
NAME_CHAR_LEN
,
MYSQL_TYPE_STRING
,
0
/*value*/
,
MY_I_S_MAYBE_NULL
,
"key"
,
SKIP_OPEN_TABLE
},
{
"key"
,
NAME_CHAR_LEN
*
MAX_KEY
,
MYSQL_TYPE_STRING
,
0
/*value*/
,
MY_I_S_MAYBE_NULL
,
"key"
,
SKIP_OPEN_TABLE
},
{
"key_len"
,
NAME_CHAR_LEN
*
MAX_KEY
,
MYSQL_TYPE_STRING
,
0
/*value*/
,
MY_I_S_MAYBE_NULL
,
"key_len"
,
SKIP_OPEN_TABLE
},
{
"ref"
,
NAME_CHAR_LEN
*
MAX_REF_PARTS
,
MYSQL_TYPE_STRING
,
0
/*value*/
,
...
...
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