summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2005-02-02 00:22:19 +0200
committerunknown <heikki@hundin.mysql.fi>2005-02-02 00:22:19 +0200
commita1b7bbd74cb720dd353b51958e6e3401b3653ce8 (patch)
treee05618801c06fd989969163775cf43a32daf1906 /sql/sql_base.cc
parent5df7e7bd716fcfec9140d4fde37c1f6f802f8bad (diff)
parent514b2364b4156e23fb15f4506a50877011b9c7ef (diff)
downloadmariadb-git-a1b7bbd74cb720dd353b51958e6e3401b3653ce8.tar.gz
Merge heikki@bk-internal.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/heikki/mysql-4.1 sql/sql_class.h: Auto merged
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 7d26996856d..7434897ab90 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -2405,6 +2405,20 @@ int 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++))
{