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
45809273
Commit
45809273
authored
Jul 05, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-4665 crash when referencing missing function in a subquery
don't ignore the return value fix_fields()
parent
44e5fcde
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
mysql-test/r/sp_missing_4665.result
mysql-test/r/sp_missing_4665.result
+6
-0
mysql-test/t/sp_missing_4665.test
mysql-test/t/sp_missing_4665.test
+9
-0
sql/table.cc
sql/table.cc
+7
-5
No files found.
mysql-test/r/sp_missing_4665.result
0 → 100644
View file @
45809273
create table t (a int);
create or replace view v as select 1 from t where a;
delete from v where (select g());
ERROR 42000: FUNCTION test.g does not exist
drop view v;
drop table t;
mysql-test/t/sp_missing_4665.test
0 → 100644
View file @
45809273
#
# MDEV-4665 crash when referencing missing function in a subquery
#
create
table
t
(
a
int
);
create
or
replace
view
v
as
select
1
from
t
where
a
;
--
error
ER_SP_DOES_NOT_EXIST
delete
from
v
where
(
select
g
());
drop
view
v
;
drop
table
t
;
sql/table.cc
View file @
45809273
...
...
@@ -3683,6 +3683,7 @@ bool TABLE_LIST::prep_where(THD *thd, Item **conds,
bool
no_where_clause
)
{
DBUG_ENTER
(
"TABLE_LIST::prep_where"
);
bool
res
=
FALSE
;
for
(
TABLE_LIST
*
tbl
=
merge_underlying_list
;
tbl
;
tbl
=
tbl
->
next_local
)
{
...
...
@@ -3731,10 +3732,11 @@ bool TABLE_LIST::prep_where(THD *thd, Item **conds,
if
(
tbl
==
0
)
{
if
(
*
conds
&&
!
(
*
conds
)
->
fixed
)
(
*
conds
)
->
fix_fields
(
thd
,
conds
);
*
conds
=
and_conds
(
*
conds
,
where
->
copy_andor_structure
(
thd
));
if
(
*
conds
&&
!
(
*
conds
)
->
fixed
)
(
*
conds
)
->
fix_fields
(
thd
,
conds
);
res
=
(
*
conds
)
->
fix_fields
(
thd
,
conds
);
if
(
!
res
)
*
conds
=
and_conds
(
*
conds
,
where
->
copy_andor_structure
(
thd
));
if
(
*
conds
&&
!
(
*
conds
)
->
fixed
&&
!
res
)
res
=
(
*
conds
)
->
fix_fields
(
thd
,
conds
);
}
if
(
arena
)
thd
->
restore_active_arena
(
arena
,
&
backup
);
...
...
@@ -3742,7 +3744,7 @@ bool TABLE_LIST::prep_where(THD *thd, Item **conds,
}
}
DBUG_RETURN
(
FALSE
);
DBUG_RETURN
(
res
);
}
/**
...
...
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