summaryrefslogtreecommitdiff
path: root/Docs/internals.texi
diff options
context:
space:
mode:
authorunknown <bell@laptop.sanja.is.com.ua>2003-04-28 20:40:41 +0300
committerunknown <bell@laptop.sanja.is.com.ua>2003-04-28 20:40:41 +0300
commit4ceb257849cca35b781cf4a3e8a65811efa878d7 (patch)
treefd3657117a94d5d4655d94ba6d433f956b2b1a3a /Docs/internals.texi
parentc9a7f29bc6c46e0ccb3f1cd3b3327bb6f0028a48 (diff)
downloadmariadb-git-4ceb257849cca35b781cf4a3e8a65811efa878d7.tar.gz
Documentation fixed according bug 185 fixing patch (1.1551 03/04/23 00:
Docs/internals.texi: Documentation fixed according bug 185 fixing patch (1.1551 03/04/23 00:01:19) BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'Docs/internals.texi')
-rw-r--r--Docs/internals.texi17
1 files changed, 13 insertions, 4 deletions
diff --git a/Docs/internals.texi b/Docs/internals.texi
index c8cf335e2f4..9f9b08b96c3 100644
--- a/Docs/internals.texi
+++ b/Docs/internals.texi
@@ -649,7 +649,7 @@ Item_in_subselect inherit mechanism of getting value from
Item_exists_subselect.
@item
Select_transformer stores reference to left expression in its
- conditions: (in WHERE in case 'a' and in a HAVING in case 'b')
+ conditions: (in WHERE & HAVING in case 'a' and in a HAVING in case 'b')
@item
Item from item list of this select (t2.a) can be referred with special
reference (Item_ref_null_helper or Item_asterisk_remover).
@@ -704,6 +704,13 @@ ORDER BY without LIMIT here.
If IN subselect union condition of every select in UNION will be changed
personally.
+If condition should be added to WHERE clause it will be presented as
+"(item OR item IS NULL)" and Item_is_not_null_test(item) will be added
+to HAVING clause. Item_is_not_null_test register NULL value as
+Item_ref_null_helper does it and return FALSE if argument is NULL.
+With above trick we will register NULL value of Item even in case
+of index optimization of WHERE clause (case 'a' of following example).
+
Following is examples of IN transformations:
@example
a) <left_expression> IN (SELECT <item> FROM t
@@ -712,8 +719,11 @@ a) <left_expression> IN (SELECT <item> FROM t
will be represented as
(SELECT 1 FROM t
- WHERE <where_exp> and
- Item_ref(<cached_left_expression>)=<Item_asterisk_remover(<Item>)>)
+ WHERE
+ <where_exp> and
+ (Item_ref(<cached_left_expression>)=<Item_asterisk_remover(<Item>)> or
+ <Item> is null)
+ HAVING Item_is_not_null_test(<Item>))
b) <left_expression> IN (SELECT <item> FROM t
@@ -721,7 +731,6 @@ b) <left_expression> IN (SELECT <item> FROM t
ORDER BY 1)
will be represented as
-
(SELECT <item> as ref_null_helper FROM t
HAVING <having_exp> AND
Item_ref(<cached_left_expression>) = ref_null_helper)