summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-02-05 01:08:08 +0300
committerKonstantin Osipov <kostja@sun.com>2010-02-05 01:08:08 +0300
commite7b332ba83f7ecd5dbc518df5d5f4c84fc542552 (patch)
treea1d34e4650281143b62067088c8965f2cceacb2d /sql/sql_select.cc
parent00dc9a6e70512905ef441274b0574fd2503f15b1 (diff)
parent08bcd2d8f67dcacd36abd2592fa2a59321abe7c2 (diff)
downloadmariadb-git-e7b332ba83f7ecd5dbc518df5d5f4c84fc542552.tar.gz
Merge next-mr -> next-4284.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index fd2e7ca911d..c412cf5124f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -10631,6 +10631,7 @@ TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list)
share->blob_field= blob_field;
share->fields= field_count;
share->blob_ptr_size= portable_sizeof_char_ptr;
+ share->db_low_byte_first=1; // True for HEAP and MyISAM
setup_tmp_table_column_bitmaps(table, bitmaps);
/* Create all fields and calculate the total length of record */
@@ -10695,6 +10696,18 @@ TABLE *create_virtual_tmp_table(THD *thd, List<Create_field> &field_list)
null_bit= 1;
}
}
+ if (cur_field->type() == MYSQL_TYPE_BIT &&
+ cur_field->key_type() == HA_KEYTYPE_BIT)
+ {
+ /* This is a Field_bit since key_type is HA_KEYTYPE_BIT */
+ static_cast<Field_bit*>(cur_field)->set_bit_ptr(null_pos, null_bit);
+ null_bit+= cur_field->field_length & 7;
+ if (null_bit > 7)
+ {
+ null_pos++;
+ null_bit-= 8;
+ }
+ }
cur_field->reset();
field_pos+= cur_field->pack_length();