summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-09-03 21:31:08 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2002-09-03 21:31:08 +0300
commitaf6a7eebe4f0bcd246662e672827c7ad124f1806 (patch)
tree5411790687a150e37d38ad8e069d20de34dbe08c /sql/sql_select.cc
parent2c121b068c49bf33bd8a8f9eec3fa8e13de39d92 (diff)
downloadmariadb-git-af6a7eebe4f0bcd246662e672827c7ad124f1806.tar.gz
a small fix for a distinct query
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 11b89722017..6402e29a3ef 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -640,8 +640,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
DBUG_PRINT("info",("Creating tmp table"));
thd->proc_info="Creating tmp table";
- join.tmp_table_param.hidden_field_count=(all_fields.elements-
- fields.elements);
+ join.tmp_table_param.hidden_field_count=
+ (all_fields.elements > fields.elements) ? (all_fields.elements- fields.elements) : 0;
if (!(tmp_table =
create_tmp_table(thd,&join.tmp_table_param,all_fields,
((!simple_group && !procedure &&