summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <sergefp@pylon.mylan>2007-09-14 15:05:20 +0400
committerunknown <sergefp@pylon.mylan>2007-09-14 15:05:20 +0400
commitfd3d146fe458d7390c3b26767cad2788cb0cb253 (patch)
treeedff7c120f5fcac9c1f7e6543b21d512dbed012d /sql/item_sum.cc
parent98d79d93c925a88c9c6dcba613e54682d54b17a1 (diff)
parent2ab4e3d1177e856738fc928c4b790651cd3dd6dd (diff)
downloadmariadb-git-fd3d146fe458d7390c3b26767cad2788cb0cb253.tar.gz
Merge mysql.com:/home/psergey/mysql-5.0-bug30324
into mysql.com:/home/psergey/mysql-5.1-bug27927 mysql-test/r/type_bit.result: Auto merged mysql-test/t/type_bit.test: Auto merged sql/item_sum.cc: Auto merged
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 8fe843a2a2d..2684cce16ac 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -2483,6 +2483,23 @@ bool Item_sum_count_distinct::setup(THD *thd)
count_field_types(select_lex, tmp_table_param, list, 0);
tmp_table_param->force_copy_fields= force_copy_fields;
DBUG_ASSERT(table == 0);
+ /*
+ Make create_tmp_table() convert BIT columns to BIGINT.
+ This is needed because BIT fields store parts of their data in table's
+ null bits, and we don't have methods to compare two table records, which
+ is needed by Unique which is used when HEAP table is used.
+ */
+ {
+ List_iterator_fast<Item> li(list);
+ Item *item;
+ while ((item= li++))
+ {
+ if (item->type() == Item::FIELD_ITEM &&
+ ((Item_field*)item)->field->type() == FIELD_TYPE_BIT)
+ item->marker=4;
+ }
+ }
+
if (!(table= create_tmp_table(thd, tmp_table_param, list, (ORDER*) 0, 1,
0,
(select_lex->options | thd->options),