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
5e03ab83
Commit
5e03ab83
authored
May 20, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not find keys in external fields (bug 446 related)
parent
d58b4bed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
sql/sql_select.cc
sql/sql_select.cc
+16
-4
No files found.
sql/sql_select.cc
View file @
5e03ab83
...
@@ -1929,7 +1929,10 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
...
@@ -1929,7 +1929,10 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
case
Item_func
:
:
OPTIMIZE_NONE
:
case
Item_func
:
:
OPTIMIZE_NONE
:
break
;
break
;
case
Item_func
:
:
OPTIMIZE_KEY
:
case
Item_func
:
:
OPTIMIZE_KEY
:
if
(
cond_func
->
key_item
()
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
cond_func
->
key_item
()
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
&&
// field from outer query can't be used as key
!
((
Item_field
*
)
(
cond_func
->
key_item
()
->
real_item
()))
->
depended_from
)
add_key_field
(
key_fields
,
*
and_level
,
add_key_field
(
key_fields
,
*
and_level
,
((
Item_field
*
)
(
cond_func
->
key_item
()
->
real_item
()))
((
Item_field
*
)
(
cond_func
->
key_item
()
->
real_item
()))
->
field
,
->
field
,
...
@@ -1940,7 +1943,10 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
...
@@ -1940,7 +1943,10 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
bool
equal_func
=
(
cond_func
->
functype
()
==
Item_func
::
EQ_FUNC
||
bool
equal_func
=
(
cond_func
->
functype
()
==
Item_func
::
EQ_FUNC
||
cond_func
->
functype
()
==
Item_func
::
EQUAL_FUNC
);
cond_func
->
functype
()
==
Item_func
::
EQUAL_FUNC
);
if
(
cond_func
->
arguments
()[
0
]
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
cond_func
->
arguments
()[
0
]
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
&&
// field from outer query can't be used as key
!
((
Item_field
*
)
(
cond_func
->
arguments
()[
0
]
->
real_item
()))
->
depended_from
)
{
{
add_key_field
(
key_fields
,
*
and_level
,
add_key_field
(
key_fields
,
*
and_level
,
((
Item_field
*
)
(
cond_func
->
arguments
()[
0
])
->
real_item
())
((
Item_field
*
)
(
cond_func
->
arguments
()[
0
])
->
real_item
())
...
@@ -1949,7 +1955,10 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
...
@@ -1949,7 +1955,10 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
(
cond_func
->
arguments
()[
1
]),
usable_tables
);
(
cond_func
->
arguments
()[
1
]),
usable_tables
);
}
}
if
(
cond_func
->
arguments
()[
1
]
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
&&
if
(
cond_func
->
arguments
()[
1
]
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
&&
cond_func
->
functype
()
!=
Item_func
::
LIKE_FUNC
)
cond_func
->
functype
()
!=
Item_func
::
LIKE_FUNC
&&
// field from outer query can't be used as key
!
((
Item_field
*
)
(
cond_func
->
arguments
()[
1
]
->
real_item
()))
->
depended_from
)
{
{
add_key_field
(
key_fields
,
*
and_level
,
add_key_field
(
key_fields
,
*
and_level
,
((
Item_field
*
)
(
cond_func
->
arguments
()[
1
])
->
real_item
())
((
Item_field
*
)
(
cond_func
->
arguments
()[
1
])
->
real_item
())
...
@@ -1961,7 +1970,10 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
...
@@ -1961,7 +1970,10 @@ add_key_fields(JOIN_TAB *stat,KEY_FIELD **key_fields,uint *and_level,
}
}
case
Item_func
:
:
OPTIMIZE_NULL
:
case
Item_func
:
:
OPTIMIZE_NULL
:
/* column_name IS [NOT] NULL */
/* column_name IS [NOT] NULL */
if
(
cond_func
->
arguments
()[
0
]
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
)
if
(
cond_func
->
arguments
()[
0
]
->
real_item
()
->
type
()
==
Item
::
FIELD_ITEM
&&
// field from outer query can't be used as key
!
((
Item_field
*
)
(
cond_func
->
arguments
()[
0
]
->
real_item
()))
->
depended_from
)
{
{
add_key_field
(
key_fields
,
*
and_level
,
add_key_field
(
key_fields
,
*
and_level
,
((
Item_field
*
)
(
cond_func
->
arguments
()[
0
])
->
real_item
())
((
Item_field
*
)
(
cond_func
->
arguments
()[
0
])
->
real_item
())
...
...
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