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
295da156
Commit
295da156
authored
Oct 27, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug in HAVING error handling
small Item_ref optimization
parent
c3127c7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
sql/item.cc
sql/item.cc
+11
-11
No files found.
sql/item.cc
View file @
295da156
...
@@ -822,23 +822,22 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
...
@@ -822,23 +822,22 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
{
{
if
(
!
ref
)
if
(
!
ref
)
{
{
SELECT_LEX
*
sl
=
thd
->
lex
.
select
->
outer_select
();
if
((
ref
=
find_item_in_list
(
this
,
thd
->
lex
.
select
->
item_list
,
if
((
ref
=
find_item_in_list
(
this
,
thd
->
lex
.
select
->
item_list
,
REPORT_EXCEPT_NOT_FOUND
))
==
(
sl
?
REPORT_EXCEPT_NOT_FOUND
:
REPORT_ALL_ERRORS
)
))
==
(
Item
**
)
not_found_item
)
(
Item
**
)
not_found_item
)
{
{
/*
/*
We can't find table field in table list of current select,
We can't find table field in table list of current select,
consequently we have to find it in outer subselect(s).
consequently we have to find it in outer subselect(s).
We can't join lists of outer & current select, because of scope
We can't join lists of outer & current select, because of scope
of view rules. For example if both tables (outer & current) have
of view rules. For example if both tables (outer & current) have
field 'field' it is not mistake to refer to this field without
field 'field' it is not mistake to refer to this field without
mention of table name, but if we join tables in one list it will
mention of table name, but if we join tables in one list it will
cause error ER_NON_UNIQ_ERROR in find_item_in_list.
cause error ER_NON_UNIQ_ERROR in find_item_in_list.
*/
*/
SELECT_LEX
*
last
=
0
;
SELECT_LEX
*
last
=
0
;
for
(
SELECT_LEX
*
sl
=
thd
->
lex
.
select
->
outer_select
();
for
(
;
sl
;
sl
=
sl
->
outer_select
())
sl
;
sl
=
sl
->
outer_select
())
if
((
ref
=
find_item_in_list
(
this
,
(
last
=
sl
)
->
item_list
,
if
((
ref
=
find_item_in_list
(
this
,
(
last
=
sl
)
->
item_list
,
REPORT_EXCEPT_NOT_FOUND
))
!=
REPORT_EXCEPT_NOT_FOUND
))
!=
(
Item
**
)
not_found_item
)
(
Item
**
)
not_found_item
)
...
@@ -852,13 +851,14 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
...
@@ -852,13 +851,14 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
{
{
// Call to report error
// Call to report error
find_item_in_list
(
this
,
thd
->
lex
.
select
->
item_list
,
REPORT_ALL_ERRORS
);
find_item_in_list
(
this
,
thd
->
lex
.
select
->
item_list
,
REPORT_ALL_ERRORS
);
ref
=
0
;
return
1
;
return
1
;
}
}
else
else
{
{
depended_from
=
last
;
depended_from
=
last
;
/*
/*
Mark all selects from resolved to 1 before select where was
Mark all selects from resolved to 1 before select where was
found table as depended (of select where was found table)
found table as depended (of select where was found table)
*/
*/
for
(
SELECT_LEX
*
s
=
thd
->
lex
.
select
;
for
(
SELECT_LEX
*
s
=
thd
->
lex
.
select
;
...
@@ -867,9 +867,9 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
...
@@ -867,9 +867,9 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
if
(
!
s
->
depended
)
if
(
!
s
->
depended
)
{
{
// Select is depended of outer select
// Select is depended of outer select
s
->
depended
=
s
->
master_unit
()
->
depended
=
1
;
s
->
depended
=
s
->
master_unit
()
->
depended
=
1
;
//Tables will be reopened many times
//Tables will be reopened many times
for
(
TABLE_LIST
*
tbl
=
for
(
TABLE_LIST
*
tbl
=
(
TABLE_LIST
*
)
s
->
table_list
.
first
;
(
TABLE_LIST
*
)
s
->
table_list
.
first
;
tbl
;
tbl
;
tbl
=
tbl
->
next
)
tbl
=
tbl
->
next
)
...
...
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