summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorPatrick Crews <patrick.crews@sun.com>2008-12-09 10:08:52 -0500
committerPatrick Crews <patrick.crews@sun.com>2008-12-09 10:08:52 -0500
commitc69ca8476cf5229775ae5ca6abc88a14179d08b2 (patch)
tree65849c33eddb9de85b76f5fbca9d6bfac0c3f93f /sql/sql_select.cc
parent67fc961e6f2e64caab54380b71ea9b4d63bec514 (diff)
parentc5c64a30d44f720ff3c9a6bfcdbf11a0bcc70797 (diff)
downloadmariadb-git-c69ca8476cf5229775ae5ca6abc88a14179d08b2.tar.gz
merge
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 2ac33c4e07f..b080fff8725 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -13233,6 +13233,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
length=0;
for (i=0 ; i < table_count ; i++)
{
+ bool have_bit_fields= FALSE;
uint null_fields=0,used_fields;
Field **f_ptr,*field;
@@ -13247,13 +13248,16 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count)
length+=field->fill_cache_field(copy);
if (copy->blob_field)
(*blob_ptr++)=copy;
- if (field->maybe_null())
+ if (field->real_maybe_null())
null_fields++;
+ if (field->type() == MYSQL_TYPE_BIT &&
+ ((Field_bit*)field)->bit_len)
+ have_bit_fields= TRUE;
copy++;
}
}
/* Copy null bits from table */
- if (null_fields && tables[i].table->s->null_fields)
+ if (null_fields || have_bit_fields)
{ /* must copy null bits */
copy->str=(char*) tables[i].table->null_flags;
copy->length= tables[i].table->s->null_bytes;