summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorgluh@gluh.mysql.r18.ru <>2005-02-03 20:46:53 +0300
committergluh@gluh.mysql.r18.ru <>2005-02-03 20:46:53 +0300
commitbe5532d36a109dabf9f078ff116ed726f16747f4 (patch)
tree449ba6d5e40350e2924e3d7afc7a607c3c55cd5a /sql/sql_base.cc
parentdd1dba19f067939b834a35274ae2a851c03217f9 (diff)
parenta4a34a87c8793f699b237c0125843e70284657d0 (diff)
downloadmariadb-git-be5532d36a109dabf9f078ff116ed726f16747f4.tar.gz
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into gluh.mysql.r18.ru:/home/gluh/MySQL/mysql-5.0
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 539744998ff..9827e6d3f0c 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2776,6 +2776,20 @@ bool setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
thd->allow_sum_func= allow_sum_func;
thd->where="field list";
+ /*
+ To prevent fail on forward lookup we fill it with zerows,
+ then if we got pointer on zero after find_item_in_list we will know
+ that it is forward lookup.
+
+ There is other way to solve problem: fill array with pointers to list,
+ but it will be slower.
+
+ TODO: remove it when (if) we made one list for allfields and
+ ref_pointer_array
+ */
+ if (ref_pointer_array)
+ bzero(ref_pointer_array, sizeof(Item *) * fields.elements);
+
Item **ref= ref_pointer_array;
while ((item= it++))
{