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
29d01b0a
Commit
29d01b0a
authored
Oct 27, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge: post-merge fixes
parents
9292953d
53b11ef2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
mysql-test/t/disabled.def
mysql-test/t/disabled.def
+0
-1
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+7
-2
sql/item_sum.cc
sql/item_sum.cc
+14
-5
No files found.
mysql-test/t/disabled.def
View file @
29d01b0a
...
...
@@ -10,7 +10,6 @@
#
##############################################################################
events_time_zone : Test is not predictable as it depends on precise timing.
table_elim : sergeyp to reapply 2643.26.4 in Item_sum::update_used_tables
lowercase_table3 : Bug#11762269 2010-06-30 alik main.lowercase_table3 on Mac OSX
read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
sum_distinct-big : Bug#11764126 2010-11-15 mattiasj was not tested
...
...
sql/item_cmpfunc.cc
View file @
29d01b0a
...
...
@@ -1424,7 +1424,11 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
cache
->
setup
(
args
[
0
]);
if
(
cache
->
cols
()
==
1
)
{
if
((
used_tables_cache
=
args
[
0
]
->
used_tables
()))
/*
Note: there can be cases when used_tables()==0 && !const_item(). See
Item_sum::update_used_tables for details.
*/
if
((
used_tables_cache
=
args
[
0
]
->
used_tables
())
||
!
args
[
0
]
->
const_item
())
cache
->
set_used_tables
(
OUTER_REF_TABLE_BIT
);
else
cache
->
set_used_tables
(
0
);
...
...
@@ -1434,7 +1438,8 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
uint
n
=
cache
->
cols
();
for
(
uint
i
=
0
;
i
<
n
;
i
++
)
{
if
(
args
[
0
]
->
element_index
(
i
)
->
used_tables
())
Item
*
element
=
args
[
0
]
->
element_index
(
i
);
if
(
element
->
used_tables
()
||
!
element
->
const_item
())
((
Item_cache
*
)
cache
->
element_index
(
i
))
->
set_used_tables
(
OUTER_REF_TABLE_BIT
);
else
((
Item_cache
*
)
cache
->
element_index
(
i
))
->
set_used_tables
(
0
);
...
...
sql/item_sum.cc
View file @
29d01b0a
...
...
@@ -550,11 +550,20 @@ void Item_sum::update_used_tables ()
args
[
i
]
->
update_used_tables
();
used_tables_cache
|=
args
[
i
]
->
used_tables
();
}
used_tables_cache
&=
PSEUDO_TABLE_BITS
;
/* the aggregate function is aggregated into its local context */
used_tables_cache
|=
(
1
<<
aggr_sel
->
join
->
table_count
)
-
1
;
/*
MariaDB: don't run the following {
used_tables_cache&= PSEUDO_TABLE_BITS;
// the aggregate function is aggregated into its local context
used_tables_cache |= (1 << aggr_sel->join->table_count) - 1;
} because if we do it, table elimination will assume that
- constructs like "COUNT(*)" use columns from all tables
- so, it is not possible to eliminate any table
our solution for COUNT(*) is that it has
item->used_tables() == 0 && !item->const_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