Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge 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@stripped, 2007-02-01 10:50:41+02:00, gkodinov@stripped +1 -0
Merge gkodinov@stripped:/home/bk/mysql-5.0-opt
into rakia.gmz:/home/kgeorge/mysql/autopush/B25551-5.0-opt
MERGE: 1.2341.74.1
sql/sql_select.cc@stripped, 2007-02-01 10:50:33+02:00, gkodinov@stripped +0 -0
Auto merged
MERGE: 1.481.1.1
# 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: gkodinov
# Host: rakia.gmz
# Root: /home/kgeorge/mysql/autopush/B25551-5.0-opt/RESYNC
--- 1.487/sql/sql_select.cc 2007-01-30 23:14:50 +02:00
+++ 1.488/sql/sql_select.cc 2007-02-01 10:50:33 +02:00
@@ -873,10 +873,11 @@ JOIN::optimize()
}
/*
Check if we can optimize away GROUP BY/DISTINCT.
- We can do that if there are no aggregate functions and the
+ We can do that if there are no aggregate functions, the
fields in DISTINCT clause (if present) and/or columns in GROUP BY
(if present) contain direct references to all key parts of
- an unique index (in whatever order).
+ an unique index (in whatever order) and if the key parts of the
+ unique index cannot contain NULLs.
Note that the unique keys for DISTINCT and GROUP BY should not
be the same (as long as they are unique).
@@ -11896,7 +11897,7 @@ test_if_subkey(ORDER *order, TABLE *tabl
/*
- Check if GROUP BY/DISTINCT can be optimized away because the set is
+ Check if GROUP BY/DISTINCT can be optimized away because the set is
already known to be distinct.
SYNOPSIS
@@ -11904,7 +11905,7 @@ test_if_subkey(ORDER *order, TABLE *tabl
table The table to operate on.
find_func function to iterate over the list and search
for a field
-
+
DESCRIPTION
Used in removing the GROUP BY/DISTINCT of the following types of
statements:
@@ -11915,12 +11916,13 @@ test_if_subkey(ORDER *order, TABLE *tabl
then <any combination of a,b,c>,{whatever} is also distinct
This function checks if all the key parts of any of the unique keys
- of the table are referenced by a list : either the select list
+ of the table are referenced by a list : either the select list
through find_field_in_item_list or GROUP BY list through
find_field_in_order_list.
- If the above holds then we can safely remove the GROUP BY/DISTINCT,
+ If the above holds and the key parts cannot contain NULLs then we
+ can safely remove the GROUP BY/DISTINCT,
as no result set can be more distinct than an unique key.
-
+
RETURN VALUE
1 found
0 not found.
@@ -11943,7 +11945,8 @@ list_contains_unique_index(TABLE *table,
key_part < key_part_end;
key_part++)
{
- if (!find_func(key_part->field, data))
+ if (key_part->field->maybe_null() ||
+ !find_func(key_part->field, data))
break;
}
if (key_part == key_part_end)
| Thread |
|---|
| • bk commit into 5.0 tree (gkodinov:1.2397) | kgeorge | 1 Feb |