Bug #11091 union involving BIT: assertion failure in Item::tmp_table_field_from_field_type
Submitted: 4 Jun 2005 4:40 Modified: 7 Jul 2005 16:36
Reporter: Timothy Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.6 OS:Any (any)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[4 Jun 2005 4:40] Timothy Smith
Description:
create table badbit (b bit);

-- This crashes the server
select b from badbit union select b from badbit;

It seems that Item_result Field::result_merge_type(enum_field_types field_type) is returning a bogus value for the BIT type; and it is hitting the default case in the
switch at sql/item.cc:3354 (in current bk), inside Field *Item::tmp_table_field_from_field_type(TABLE *table)

How to repeat:

See Description.

Suggested fix:

Maybe need to fix the field_types_result_type array?  Or the field_type2index() function?
[15 Jun 2005 11:07] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26018
[30 Jun 2005 9:33] Ramil Kalimullin
fixed in 5.0.9
[7 Jul 2005 16:36] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Bugfix documented in 5.0.9 change history; closed.