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
2d5338ce
Commit
2d5338ce
authored
Feb 18, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revision of fix_fields calls in subqueries transformation
after merge fix
parent
a66b398e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
7 deletions
+38
-7
sql/item_subselect.cc
sql/item_subselect.cc
+36
-7
sql/sql_prepare.cc
sql/sql_prepare.cc
+2
-0
No files found.
sql/item_subselect.cc
View file @
2d5338ce
...
...
@@ -713,9 +713,14 @@ Item_in_subselect::single_value_transformer(JOIN *join,
select_lex
->
ref_pointer_array
,
(
char
*
)
"<ref>"
,
this
->
full_name
()));
/*
AND and comparison functions can't be changed during fix_fields()
we can assign select_lex->having here, and pass 0 as last
argument (reference) to fix_fields()
*/
select_lex
->
having
=
join
->
having
=
and_items
(
join
->
having
,
item
);
select_lex
->
having_fix_field
=
1
;
if
(
join
->
having
->
fix_fields
(
thd
,
join
->
tables_list
,
&
join
->
having
))
if
(
join
->
having
->
fix_fields
(
thd
,
join
->
tables_list
,
0
))
{
select_lex
->
having_fix_field
=
0
;
goto
err
;
...
...
@@ -735,13 +740,17 @@ Item_in_subselect::single_value_transformer(JOIN *join,
if
(
!
abort_on_null
)
{
having
=
new
Item_is_not_null_test
(
this
,
having
);
/*
Item_is_not_null_test can't be changed during fix_fields()
we can assign select_lex->having here, and pass 0 as last
argument (reference) to fix_fields()
*/
select_lex
->
having
=
join
->
having
=
(
join
->
having
?
new
Item_cond_and
(
having
,
join
->
having
)
:
having
);
select_lex
->
having_fix_field
=
1
;
if
(
join
->
having
->
fix_fields
(
thd
,
join
->
tables_list
,
&
join
->
having
))
if
(
join
->
having
->
fix_fields
(
thd
,
join
->
tables_list
,
0
))
{
select_lex
->
having_fix_field
=
0
;
goto
err
;
...
...
@@ -751,14 +760,24 @@ Item_in_subselect::single_value_transformer(JOIN *join,
new
Item_func_isnull
(
isnull
));
}
item
->
name
=
(
char
*
)
in_additional_cond
;
/*
AND can't be changed during fix_fields()
we can assign select_lex->having here, and pass 0 as last
argument (reference) to fix_fields()
*/
select_lex
->
where
=
join
->
conds
=
and_items
(
join
->
conds
,
item
);
if
(
join
->
conds
->
fix_fields
(
thd
,
join
->
tables_list
,
&
join
->
conds
))
if
(
join
->
conds
->
fix_fields
(
thd
,
join
->
tables_list
,
0
))
goto
err
;
}
else
{
if
(
select_lex
->
master_unit
()
->
first_select
()
->
next_select
())
{
/*
comparison functions can't be changed during fix_fields()
we can assign select_lex->having here, and pass 0 as last
argument (reference) to fix_fields()
*/
select_lex
->
having
=
join
->
having
=
func
->
create
(
expr
,
...
...
@@ -767,7 +786,7 @@ Item_in_subselect::single_value_transformer(JOIN *join,
(
char
*
)
"<result>"
));
select_lex
->
having_fix_field
=
1
;
if
(
join
->
having
->
fix_fields
(
thd
,
join
->
tables_list
,
&
join
->
having
))
0
))
{
select_lex
->
having_fix_field
=
0
;
goto
err
;
...
...
@@ -880,9 +899,14 @@ Item_in_subselect::row_value_transformer(JOIN *join)
select_lex
->
group_list
.
first
||
!
select_lex
->
table_list
.
elements
)
{
/*
AND can't be changed during fix_fields()
we can assign select_lex->having here, and pass 0 as last
argument (reference) to fix_fields()
*/
select_lex
->
having
=
join
->
having
=
and_items
(
join
->
having
,
item
);
select_lex
->
having_fix_field
=
1
;
if
(
join
->
having
->
fix_fields
(
thd
,
join
->
tables_list
,
&
join
->
having
))
if
(
join
->
having
->
fix_fields
(
thd
,
join
->
tables_list
,
0
))
{
select_lex
->
having_fix_field
=
0
;
goto
err
;
...
...
@@ -891,8 +915,13 @@ Item_in_subselect::row_value_transformer(JOIN *join)
}
else
{
/*
AND can't be changed during fix_fields()
we can assign select_lex->having here, and pass 0 as last
argument (reference) to fix_fields()
*/
select_lex
->
where
=
join
->
conds
=
and_items
(
join
->
conds
,
item
);
if
(
join
->
conds
->
fix_fields
(
thd
,
join
->
tables_list
,
&
join
->
having
))
if
(
join
->
conds
->
fix_fields
(
thd
,
join
->
tables_list
,
0
))
goto
err
;
}
if
(
stmt
)
...
...
sql/sql_prepare.cc
View file @
2d5338ce
...
...
@@ -697,6 +697,8 @@ static bool mysql_test_upd_fields(Prepared_statement *stmt,
// this memory pool was opened in open_and_lock_tables
thd
->
ps_setup_free_memory
();
DBUG_RETURN
(
1
);
}
if
(
setup_tables
(
table_list
)
||
setup_fields
(
thd
,
0
,
table_list
,
fields
,
1
,
0
,
0
)
||
setup_conds
(
thd
,
table_list
,
&
conds
)
||
thd
->
net
.
report_error
)
...
...
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