From 4ceb257849cca35b781cf4a3e8a65811efa878d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Apr 2003 20:40:41 +0300 Subject: 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 --- Docs/internals.texi | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'Docs/internals.texi') 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) IN (SELECT FROM t @@ -712,8 +719,11 @@ a) IN (SELECT FROM t will be represented as (SELECT 1 FROM t - WHERE and - Item_ref()=)>) + WHERE + and + (Item_ref()=)> or + is null) + HAVING Item_is_not_null_test()) b) IN (SELECT FROM t @@ -721,7 +731,6 @@ b) IN (SELECT FROM t ORDER BY 1) will be represented as - (SELECT as ref_null_helper FROM t HAVING AND Item_ref() = ref_null_helper) -- cgit v1.2.1