summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-06-26 05:38:19 +0300
committerunknown <monty@mashka.mysql.fi>2003-06-26 05:38:19 +0300
commita3beaaa3af7af26aabadda6836618d32d6c90e51 (patch)
treeaf26f54d96f10ded8e53e3634bc9beecf75bd15e /sql/item_strfunc.cc
parent3d5f6a8867c848459191ba320b573bd832e51d5a (diff)
downloadmariadb-git-a3beaaa3af7af26aabadda6836618d32d6c90e51.tar.gz
LEFT JOIN optimization: Change LEFT JOIN to normal join if possible
mysql-test/r/select.result: Added test for LEFT JOIN optimization mysql-test/t/select.test: Added test for LEFT JOIN optimization sql/item.h: LEFT JOIN optimization sql/item_cmpfunc.cc: LEFT JOIN optimization sql/item_cmpfunc.h: LEFT JOIN optimization sql/item_func.cc: LEFT JOIN optimization sql/item_func.h: LEFT JOIN optimization sql/item_strfunc.cc: LEFT JOIN optimization sql/sql_base.cc: Heart of LEFT JOIN optimization
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 208be1ecd7f..20496a47671 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -606,9 +606,10 @@ void Item_func_concat_ws::fix_length_and_dec()
max_length=MAX_BLOB_WIDTH;
maybe_null=1;
}
- used_tables_cache|=separator->used_tables();
- const_item_cache&=separator->const_item();
- with_sum_func= with_sum_func || separator->with_sum_func;
+ used_tables_cache|= separator->used_tables();
+ not_null_tables_cache&= separator->not_null_tables();
+ const_item_cache&= separator->const_item();
+ with_sum_func= with_sum_func || separator->with_sum_func;
}
void Item_func_concat_ws::update_used_tables()
@@ -1509,8 +1510,9 @@ void Item_func_elt::fix_length_and_dec()
}
maybe_null=1; // NULL if wrong first arg
with_sum_func= with_sum_func || item->with_sum_func;
- used_tables_cache|=item->used_tables();
- const_item_cache&=item->const_item();
+ used_tables_cache|= item->used_tables();
+ not_null_tables_cache&= item->not_null_tables();
+ const_item_cache&= item->const_item();
}
@@ -1591,8 +1593,9 @@ void Item_func_make_set::fix_length_and_dec()
max_length=arg_count-1;
for (uint i=1 ; i < arg_count ; i++)
max_length+=args[i]->max_length;
- used_tables_cache|=item->used_tables();
- const_item_cache&=item->const_item();
+ used_tables_cache|= item->used_tables();
+ not_null_tables_cache&= item->not_null_tables();
+ const_item_cache&= item->const_item();
with_sum_func= with_sum_func || item->with_sum_func;
}