Below is the list of changes that have just been committed into a local
5.0 repository of psergey. When psergey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2120 06/05/07 19:01:49 sergefp@stripped +1 -0
BUG#16798: Merge into 5.0: s/used_tables()/!const_item()/, added comment about its
effects.
sql/sql_select.cc
1.411 06/05/07 19:01:43 sergefp@stripped +14 -2
BUG#16798: Merge into 5.0: s/used_tables()/!const_item()/, added comment about its
effects.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: sergefp
# Host: newbox.mylan
# Root: /home/psergey/mysql-5.0-bug16798-merge
--- 1.410/sql/sql_select.cc 2006-05-06 13:19:05 +04:00
+++ 1.411/sql/sql_select.cc 2006-05-07 19:01:43 +04:00
@@ -2377,7 +2377,19 @@
{
if (old->field == new_fields->field)
{
- if (new_fields->val->used_tables())
+ /*
+ NOTE: below const_item() call really works as "!used_tables()", i.e.
+ it can return FALSE where it is feasible to make it return TRUE.
+
+ The cause is as follows: Some of the tables are already known to be
+ const tables (the detection code is in make_join_statistics(),
+ above the update_ref_and_keys() call), but we didn't propagate
+ information about this: TABLE::const_table is not set to TRUE, and
+ Item::update_used_tables() hasn't been called for each item.
+ The result of this is that we're missing some 'ref' accesses.
+ TODO: OptimizerTeam: Fix this
+ */
+ if (!new_fields->val->const_item())
{
/*
If the value matches, we can use the key reference.
@@ -2407,7 +2419,7 @@
new_fields->null_rejecting);
}
else if (old->eq_func && new_fields->eq_func &&
- ((!old->val->used_tables() && old->val->is_null()) ||
+ ((old->val->const_item() && old->val->is_null()) ||
new_fields->val->is_null()))
{
/* field = expression OR field IS NULL */
| Thread |
|---|
| • bk commit into 5.0 tree (sergefp:1.2120) BUG#16798 | Sergey Petrunia | 7 May |