diff options
author | Sergey Petrunia <psergey@askmonty.org> | 2009-06-10 01:11:33 +0400 |
---|---|---|
committer | Sergey Petrunia <psergey@askmonty.org> | 2009-06-10 01:11:33 +0400 |
commit | a875eb202c28496c089df5c00b9497b974ec2bab (patch) | |
tree | f462823874fbcb7842e5dabe052c8b376323d1c1 /sql/table.h | |
parent | 539851aef1bcb07b9f3b35d3aff689d5cdde1d2d (diff) | |
download | mariadb-git-a875eb202c28496c089df5c00b9497b974ec2bab.tar.gz |
MWL#17: Table elimination
- Make elimination work with aggregate functions. The problem was that aggregate functions
reported all table bits in used_tables(), and that prevented table elimination. Fixed by
making aggregate functions return more correct value from used_tables().
mysql-test/r/ps_11bugs.result:
MWL#17: Table elimination
- Update test results. The difference is because of Item_ref change: outer references to constants
are now recognized as constants, too.
mysql-test/r/subselect.result:
- Update test results. The difference is because of Item_ref change: outer references to constants
are now recognized as constants, too.
mysql-test/r/table_elim.result:
MWL#17: Table elimination
- Check that elimination works in presense of aggreagate functions
mysql-test/t/table_elim.test:
MWL#17: Table elimination
- Check that elimination works in presense of aggreagate functions
sql/item.h:
MWL#17: Table elimination
- Add Item_ref::const_item() which calls (*ref)->const_item(). Before this diff Item_ref used the
default implementation of const_item(){ return used_tables()==0; }. This is no longer true, as
COUNT(*) now has used_tables()==0 but const_item()==FALSE.
sql/item_sum.cc:
MWL#17: Table elimination
- Make Item_sum() and it descendants not to return all bits in used_tables(). This is needed
because otherwise table elimination can't work in presense of aggregate functions
- COUNT(*) now has used_tables()==0 and const_item()==FALSE. Had to change
Item_ref::const_item() to account for this.
sql/item_sum.h:
MWL#17: Table elimination
- Add comments
Diffstat (limited to 'sql/table.h')
0 files changed, 0 insertions, 0 deletions