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
f545817e
Commit
f545817e
authored
Apr 03, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post review changes for the fix of bug #16504.
parent
f0bfea2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
17 deletions
+16
-17
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+2
-2
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+13
-14
No files found.
sql/item_cmpfunc.cc
View file @
f545817e
...
@@ -3740,7 +3740,7 @@ void Item_equal::sort(Item_field_cmpfunc cmp, void *arg)
...
@@ -3740,7 +3740,7 @@ void Item_equal::sort(Item_field_cmpfunc cmp, void *arg)
Check appearance of new constant items in the multiple equality object
Check appearance of new constant items in the multiple equality object
SYNOPSIS
SYNOPSIS
check
()
update_const
()
DESCRIPTION
DESCRIPTION
The function checks appearance of new constant items among
The function checks appearance of new constant items among
...
@@ -3753,7 +3753,7 @@ void Item_equal::sort(Item_field_cmpfunc cmp, void *arg)
...
@@ -3753,7 +3753,7 @@ void Item_equal::sort(Item_field_cmpfunc cmp, void *arg)
none
none
*/
*/
void
Item_equal
::
check
_const
()
void
Item_equal
::
update
_const
()
{
{
List_iterator
<
Item_field
>
it
(
fields
);
List_iterator
<
Item_field
>
it
(
fields
);
Item
*
item
;
Item
*
item
;
...
...
sql/item_cmpfunc.h
View file @
f545817e
...
@@ -1196,7 +1196,7 @@ public:
...
@@ -1196,7 +1196,7 @@ public:
bool
contains
(
Field
*
field
);
bool
contains
(
Field
*
field
);
Item_field
*
get_first
()
{
return
fields
.
head
();
}
Item_field
*
get_first
()
{
return
fields
.
head
();
}
void
merge
(
Item_equal
*
item
);
void
merge
(
Item_equal
*
item
);
void
check
_const
();
void
update
_const
();
enum
Functype
functype
()
const
{
return
MULT_EQUAL_FUNC
;
}
enum
Functype
functype
()
const
{
return
MULT_EQUAL_FUNC
;
}
longlong
val_int
();
longlong
val_int
();
const
char
*
func_name
()
const
{
return
"multiple equal"
;
}
const
char
*
func_name
()
const
{
return
"multiple equal"
;
}
...
...
sql/sql_select.cc
View file @
f545817e
...
@@ -136,7 +136,7 @@ static enum_nested_loop_state
...
@@ -136,7 +136,7 @@ static enum_nested_loop_state
end_write_group
(
JOIN
*
join
,
JOIN_TAB
*
join_tab
,
bool
end_of_records
);
end_write_group
(
JOIN
*
join
,
JOIN_TAB
*
join_tab
,
bool
end_of_records
);
static
int
test_if_group_changed
(
List
<
Cached_item
>
&
list
);
static
int
test_if_group_changed
(
List
<
Cached_item
>
&
list
);
static
int
join_read_const_table
(
JOIN
*
join
,
JOIN
_TAB
*
tab
,
POSITION
*
pos
);
static
int
join_read_const_table
(
JOIN_TAB
*
tab
,
POSITION
*
pos
);
static
int
join_read_system
(
JOIN_TAB
*
tab
);
static
int
join_read_system
(
JOIN_TAB
*
tab
);
static
int
join_read_const
(
JOIN_TAB
*
tab
);
static
int
join_read_const
(
JOIN_TAB
*
tab
);
static
int
join_read_key
(
JOIN_TAB
*
tab
);
static
int
join_read_key
(
JOIN_TAB
*
tab
);
...
@@ -2111,7 +2111,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
...
@@ -2111,7 +2111,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
s
=
p_pos
->
table
;
s
=
p_pos
->
table
;
s
->
type
=
JT_SYSTEM
;
s
->
type
=
JT_SYSTEM
;
join
->
const_table_map
|=
s
->
table
->
map
;
join
->
const_table_map
|=
s
->
table
->
map
;
if
((
tmp
=
join_read_const_table
(
join
,
s
,
p_pos
)))
if
((
tmp
=
join_read_const_table
(
s
,
p_pos
)))
{
{
if
(
tmp
>
0
)
if
(
tmp
>
0
)
DBUG_RETURN
(
1
);
// Fatal error
DBUG_RETURN
(
1
);
// Fatal error
...
@@ -2148,8 +2148,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
...
@@ -2148,8 +2148,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
s
->
type
=
JT_SYSTEM
;
s
->
type
=
JT_SYSTEM
;
join
->
const_table_map
|=
table
->
map
;
join
->
const_table_map
|=
table
->
map
;
set_position
(
join
,
const_count
++
,
s
,(
KEYUSE
*
)
0
);
set_position
(
join
,
const_count
++
,
s
,(
KEYUSE
*
)
0
);
if
((
tmp
=
join_read_const_table
(
join
,
s
,
if
((
tmp
=
join_read_const_table
(
s
,
join
->
positions
+
const_count
-
1
)))
join
->
positions
+
const_count
-
1
)))
{
{
if
(
tmp
>
0
)
if
(
tmp
>
0
)
DBUG_RETURN
(
1
);
// Fatal error
DBUG_RETURN
(
1
);
// Fatal error
...
@@ -2201,8 +2200,8 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
...
@@ -2201,8 +2200,8 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
if
(
create_ref_for_key
(
join
,
s
,
start_keyuse
,
if
(
create_ref_for_key
(
join
,
s
,
start_keyuse
,
found_const_table_map
))
found_const_table_map
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
if
((
tmp
=
join_read_const_table
(
join
,
s
,
if
((
tmp
=
join_read_const_table
(
s
,
join
->
positions
+
const_count
-
1
)))
join
->
positions
+
const_count
-
1
)))
{
{
if
(
tmp
>
0
)
if
(
tmp
>
0
)
DBUG_RETURN
(
1
);
// Fatal error
DBUG_RETURN
(
1
);
// Fatal error
...
@@ -7183,7 +7182,7 @@ static COND* substitute_for_best_equal_field(COND *cond,
...
@@ -7183,7 +7182,7 @@ static COND* substitute_for_best_equal_field(COND *cond,
of a condition after reading a constant table
of a condition after reading a constant table
SYNOPSIS
SYNOPSIS
check_const_equal_item
()
update_const_equal_items
()
cond condition whose multiple equalities are to be checked
cond condition whose multiple equalities are to be checked
table constant table that has been read
table constant table that has been read
...
@@ -7194,8 +7193,7 @@ static COND* substitute_for_best_equal_field(COND *cond,
...
@@ -7194,8 +7193,7 @@ static COND* substitute_for_best_equal_field(COND *cond,
the multiple equality appropriately.
the multiple equality appropriately.
*/
*/
static
void
check_const_equal_items
(
COND
*
cond
,
static
void
update_const_equal_items
(
COND
*
cond
,
JOIN_TAB
*
tab
)
JOIN_TAB
*
tab
)
{
{
if
(
!
(
cond
->
used_tables
()
&
tab
->
table
->
map
))
if
(
!
(
cond
->
used_tables
()
&
tab
->
table
->
map
))
return
;
return
;
...
@@ -7206,13 +7204,13 @@ static void check_const_equal_items(COND *cond,
...
@@ -7206,13 +7204,13 @@ static void check_const_equal_items(COND *cond,
List_iterator_fast
<
Item
>
li
(
*
cond_list
);
List_iterator_fast
<
Item
>
li
(
*
cond_list
);
Item
*
item
;
Item
*
item
;
while
((
item
=
li
++
))
while
((
item
=
li
++
))
check
_const_equal_items
(
item
,
tab
);
update
_const_equal_items
(
item
,
tab
);
}
}
else
if
(
cond
->
type
()
==
Item
::
FUNC_ITEM
&&
else
if
(
cond
->
type
()
==
Item
::
FUNC_ITEM
&&
((
Item_cond
*
)
cond
)
->
functype
()
==
Item_func
::
MULT_EQUAL_FUNC
)
((
Item_cond
*
)
cond
)
->
functype
()
==
Item_func
::
MULT_EQUAL_FUNC
)
{
{
Item_equal
*
item_equal
=
(
Item_equal
*
)
cond
;
Item_equal
*
item_equal
=
(
Item_equal
*
)
cond
;
item_equal
->
check
_const
();
item_equal
->
update
_const
();
}
}
}
}
...
@@ -10139,7 +10137,7 @@ int safe_index_read(JOIN_TAB *tab)
...
@@ -10139,7 +10137,7 @@ int safe_index_read(JOIN_TAB *tab)
static
int
static
int
join_read_const_table
(
JOIN
*
join
,
JOIN
_TAB
*
tab
,
POSITION
*
pos
)
join_read_const_table
(
JOIN_TAB
*
tab
,
POSITION
*
pos
)
{
{
int
error
;
int
error
;
DBUG_ENTER
(
"join_read_const_table"
);
DBUG_ENTER
(
"join_read_const_table"
);
...
@@ -10193,8 +10191,9 @@ join_read_const_table(JOIN *join, JOIN_TAB *tab, POSITION *pos)
...
@@ -10193,8 +10191,9 @@ join_read_const_table(JOIN *join, JOIN_TAB *tab, POSITION *pos)
table
->
maybe_null
=
0
;
table
->
maybe_null
=
0
;
/* Check appearance of new constant items in Item_equal objects */
/* Check appearance of new constant items in Item_equal objects */
JOIN
*
join
=
tab
->
join
;
if
(
join
->
conds
)
if
(
join
->
conds
)
check
_const_equal_items
(
join
->
conds
,
tab
);
update
_const_equal_items
(
join
->
conds
,
tab
);
TABLE_LIST
*
tbl
;
TABLE_LIST
*
tbl
;
for
(
tbl
=
join
->
select_lex
->
leaf_tables
;
tbl
;
tbl
=
tbl
->
next_leaf
)
for
(
tbl
=
join
->
select_lex
->
leaf_tables
;
tbl
;
tbl
=
tbl
->
next_leaf
)
{
{
...
@@ -10204,7 +10203,7 @@ join_read_const_table(JOIN *join, JOIN_TAB *tab, POSITION *pos)
...
@@ -10204,7 +10203,7 @@ join_read_const_table(JOIN *join, JOIN_TAB *tab, POSITION *pos)
{
{
embedded
=
embedding
;
embedded
=
embedding
;
if
(
embedded
->
on_expr
)
if
(
embedded
->
on_expr
)
check
_const_equal_items
(
embedded
->
on_expr
,
tab
);
update
_const_equal_items
(
embedded
->
on_expr
,
tab
);
embedding
=
embedded
->
embedding
;
embedding
=
embedded
->
embedding
;
}
}
while
(
embedding
&&
while
(
embedding
&&
...
...
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