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
12d6f89b
Commit
12d6f89b
authored
Jun 26, 2014
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-6393: ANALYZE SELECT crashes ... Don't try printing EXPLAIN if we had an error.
parent
b7d10e56
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletion
+45
-1
mysql-test/r/analyze_stmt.result
mysql-test/r/analyze_stmt.result
+18
-0
mysql-test/t/analyze_stmt.test
mysql-test/t/analyze_stmt.test
+25
-0
sql/sql_parse.cc
sql/sql_parse.cc
+2
-1
No files found.
mysql-test/r/analyze_stmt.result
View file @
12d6f89b
...
@@ -197,3 +197,21 @@ select * from t1;
...
@@ -197,3 +197,21 @@ select * from t1;
a b
a b
6 6
6 6
drop table t0, t1;
drop table t0, t1;
#
# MDEV-6393: ANALYZE SELECT crashes in Explain_query::print_explain with a non-existing column
#
create table t1 (i int);
insert into t1 values (1),(2);
analyze select a from t1;
ERROR 42S22: Unknown column 'a' in 'field list'
analyze delete from t1 where a=2;
ERROR 42S22: Unknown column 'a' in 'where clause'
analyze update t1 set a=2;
ERROR 42S22: Unknown column 'a' in 'field list'
create table t2 like t1;
insert into t2 select * from t1;
analyze update t2,t1 set t2.i=5 where t2.a=t1.a;
ERROR 42S22: Unknown column 't2.a' in 'where clause'
analyze delete t1 from t2,t1 where t2.a=t1.a;
ERROR 42S22: Unknown column 't2.a' in 'where clause'
drop table t1,t2;
mysql-test/t/analyze_stmt.test
View file @
12d6f89b
...
@@ -146,3 +146,28 @@ select * from t1;
...
@@ -146,3 +146,28 @@ select * from t1;
drop
table
t0
,
t1
;
drop
table
t0
,
t1
;
--
echo
#
--
echo
# MDEV-6393: ANALYZE SELECT crashes in Explain_query::print_explain with a non-existing column
--
echo
#
create
table
t1
(
i
int
);
insert
into
t1
values
(
1
),(
2
);
--
error
ER_BAD_FIELD_ERROR
analyze
select
a
from
t1
;
--
error
ER_BAD_FIELD_ERROR
analyze
delete
from
t1
where
a
=
2
;
--
error
ER_BAD_FIELD_ERROR
analyze
update
t1
set
a
=
2
;
create
table
t2
like
t1
;
insert
into
t2
select
*
from
t1
;
--
error
ER_BAD_FIELD_ERROR
analyze
update
t2
,
t1
set
t2
.
i
=
5
where
t2
.
a
=
t1
.
a
;
--
error
ER_BAD_FIELD_ERROR
analyze
delete
t1
from
t2
,
t1
where
t2
.
a
=
t1
.
a
;
drop
table
t1
,
t2
;
sql/sql_parse.cc
View file @
12d6f89b
...
@@ -5282,6 +5282,7 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
...
@@ -5282,6 +5282,7 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
return
1
;
return
1
;
delete
thd
->
protocol
;
delete
thd
->
protocol
;
thd
->
protocol
=
save_protocol
;
thd
->
protocol
=
save_protocol
;
if
(
!
res
)
thd
->
lex
->
explain
->
send_explain
(
thd
);
thd
->
lex
->
explain
->
send_explain
(
thd
);
if
(
result
!=
lex
->
result
)
if
(
result
!=
lex
->
result
)
...
...
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