summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <ram@gw.mysql.r18.ru>2004-02-02 19:32:49 +0400
committerunknown <ram@gw.mysql.r18.ru>2004-02-02 19:32:49 +0400
commit8131ccaf8007d23d452dde6d0dc210cc57c7f661 (patch)
treedc5eef882fd39a11d9580d641066b9226d77d9cc /sql
parentabc17f8f3c132971a04cc76543d3c0ef23386b79 (diff)
downloadmariadb-git-8131ccaf8007d23d452dde6d0dc210cc57c7f661.tar.gz
Added a comment for NULL range creation.
Diffstat (limited to 'sql')
-rw-r--r--sql/opt_range.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 9f56064cfb1..2ebc60ca711 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2516,6 +2516,12 @@ QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, TABLE_REF *ref)
if (quick->ranges.push_back(range))
goto err;
+ /*
+ Add a NULL range if REF_OR_NULL optimization is used.
+ For example:
+ if we have "WHERE A=2 OR A IS NULL" we created the (A=2) range above
+ and have ref->null_ref_key set. Will create a new NULL range here.
+ */
if (ref->null_ref_key)
{
QUICK_RANGE *null_range;
@@ -2526,7 +2532,6 @@ QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, TABLE_REF *ref)
EQ_RANGE)))
goto err;
*ref->null_ref_key= 0; // Clear null byte
- /* Do we need to do something with key_parts here? Looks like we don't */
if (quick->ranges.push_back(null_range))
goto err;
}