Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1940 05/06/15 16:08:01 ramil@stripped +7 -0
a fix (bug #11091: union involving BIT: assertion failure).
sql/sql_select.cc
1.336 05/06/15 16:07:54 ramil@stripped +1 -5
a fix (bug #11091: union involving BIT: assertion failure).
total_uneven_bit_length removed.
sql/item.cc
1.137 05/06/15 16:07:53 ramil@stripped +3 -0
a fix (bug #11091: union involving BIT: assertion failure).
create Field_bit_as_char for MYSQL_TYPE_BIT.
sql/field.h
1.161 05/06/15 16:07:53 ramil@stripped +2 -1
a fix (bug #11091: union involving BIT: assertion failure).
max_length() now returns real length in bits.
mysql-test/t/type_bit_innodb.test
1.3 05/06/15 16:07:53 ramil@stripped +14 -0
a fix (bug #11091: union involving BIT: assertion failure).
mysql-test/t/type_bit.test
1.10 05/06/15 16:07:53 ramil@stripped +14 -0
a fix (bug #11091: union involving BIT: assertion failure).
mysql-test/r/type_bit_innodb.result
1.3 05/06/15 16:07:53 ramil@stripped +31 -0
a fix (bug #11091: union involving BIT: assertion failure).
mysql-test/r/type_bit.result
1.11 05/06/15 16:07:53 ramil@stripped +31 -0
a fix (bug #11091: union involving BIT: assertion failure).
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: ramil
# Host: gw.mysql.r18.ru
# Root: /usr/home/ram/work/5.0.b11091
--- 1.160/sql/field.h 2005-06-10 07:29:52 +05:00
+++ 1.161/sql/field.h 2005-06-15 16:07:53 +05:00
@@ -1284,7 +1284,7 @@
enum_field_types type() const { return FIELD_TYPE_BIT; }
enum ha_base_keytype key_type() const { return HA_KEYTYPE_BIT; }
uint32 key_length() const { return (uint32) field_length + (bit_len > 0); }
- uint32 max_length() { return (uint32) field_length + (bit_len > 0); }
+ uint32 max_length() { return (uint32) field_length * 8 + bit_len; }
uint size_of() const { return sizeof(*this); }
Item_result result_type () const { return INT_RESULT; }
void reset(void) { bzero(ptr, field_length); }
@@ -1327,6 +1327,7 @@
enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg);
enum ha_base_keytype key_type() const { return HA_KEYTYPE_BINARY; }
+ uint32 max_length() { return (uint32) create_length; }
uint size_of() const { return sizeof(*this); }
int store(const char *to, uint length, CHARSET_INFO *charset);
int store(double nr) { return Field_bit::store(nr); }
--- 1.136/sql/item.cc 2005-06-14 20:04:37 +05:00
+++ 1.137/sql/item.cc 2005-06-15 16:07:53 +05:00
@@ -3344,6 +3344,9 @@
case MYSQL_TYPE_YEAR:
return new Field_year((char*) 0, max_length, null_ptr, 0, Field::NONE,
name, table);
+ case MYSQL_TYPE_BIT:
+ return new Field_bit_as_char(NULL, max_length, null_ptr, 0, NULL, 0,
+ Field::NONE, name, table);
default:
/* This case should never be chosen */
DBUG_ASSERT(0);
--- 1.335/sql/sql_select.cc 2005-06-15 03:22:24 +05:00
+++ 1.336/sql/sql_select.cc 2005-06-15 16:07:54 +05:00
@@ -8030,7 +8030,6 @@
KEY_PART_INFO *key_part_info;
Item **copy_func;
MI_COLUMNDEF *recinfo;
- uint total_uneven_bit_length= 0;
DBUG_ENTER("create_tmp_table");
DBUG_PRINT("enter",("distinct: %d save_sum_fields: %d rows_limit: %lu group: %d",
(int) distinct, (int) save_sum_fields,
@@ -8234,8 +8233,6 @@
reclength+=new_field->pack_length();
if (!(new_field->flags & NOT_NULL_FLAG))
null_count++;
- if (new_field->type() == FIELD_TYPE_BIT)
- total_uneven_bit_length+= new_field->field_length & 7;
if (new_field->flags & BLOB_FLAG)
{
*blob_field++= (uint) (reg_field - table->field);
@@ -8285,8 +8282,7 @@
null_count++;
}
hidden_null_pack_length=(hidden_null_count+7)/8;
- null_pack_length= hidden_null_count +
- (null_count + total_uneven_bit_length + 7) / 8;
+ null_pack_length= hidden_null_count + (null_count + 7) / 8;
reclength+=null_pack_length;
if (!reclength)
reclength=1; // Dummy select
--- 1.10/mysql-test/r/type_bit.result 2005-05-18 17:30:05 +05:00
+++ 1.11/mysql-test/r/type_bit.result 2005-06-15 16:07:53 +05:00
@@ -466,3 +466,34 @@
a+0
255
drop table t1;
+create table t1 (a bit(7));
+insert into t1 values (120), (0), (111);
+select a+0 from t1 union select a+0 from t1;
+a+0
+120
+0
+111
+select a+0 from t1 union select NULL;
+a+0
+120
+0
+111
+NULL
+select NULL union select a+0 from t1;
+NULL
+NULL
+120
+0
+111
+create table t2 select a from t1 union select a from t1;
+select a+0 from t2;
+a+0
+120
+0
+111
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` bit(7) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
--- 1.9/mysql-test/t/type_bit.test 2005-05-18 17:30:05 +05:00
+++ 1.10/mysql-test/t/type_bit.test 2005-06-15 16:07:53 +05:00
@@ -171,3 +171,17 @@
insert into t1 values ('1111100000');
select a+0 from t1;
drop table t1;
+
+#
+# Bug #11091: problem with union
+#
+
+create table t1 (a bit(7));
+insert into t1 values (120), (0), (111);
+select a+0 from t1 union select a+0 from t1;
+select a+0 from t1 union select NULL;
+select NULL union select a+0 from t1;
+create table t2 select a from t1 union select a from t1;
+select a+0 from t2;
+show create table t2;
+drop table t1, t2;
--- 1.2/mysql-test/r/type_bit_innodb.result 2005-04-14 14:32:17 +05:00
+++ 1.3/mysql-test/r/type_bit_innodb.result 2005-06-15 16:07:53 +05:00
@@ -402,3 +402,34 @@
`b` bit(10) default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
+create table t1 (a bit(7)) engine=innodb;
+insert into t1 values (120), (0), (111);
+select a+0 from t1 union select a+0 from t1;
+a+0
+120
+0
+111
+select a+0 from t1 union select NULL;
+a+0
+120
+0
+111
+NULL
+select NULL union select a+0 from t1;
+NULL
+NULL
+120
+0
+111
+create table t2 select a from t1 union select a from t1;
+select a+0 from t2;
+a+0
+120
+0
+111
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` bit(7) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
--- 1.2/mysql-test/t/type_bit_innodb.test 2005-04-14 14:32:18 +05:00
+++ 1.3/mysql-test/t/type_bit_innodb.test 2005-06-15 16:07:53 +05:00
@@ -133,3 +133,17 @@
alter table t1 engine=innodb;
show create table t1;
drop table t1;
+
+#
+# Bug #11091: problem with union
+#
+
+create table t1 (a bit(7)) engine=innodb;
+insert into t1 values (120), (0), (111);
+select a+0 from t1 union select a+0 from t1;
+select a+0 from t1 union select NULL;
+select NULL union select a+0 from t1;
+create table t2 select a from t1 union select a from t1;
+select a+0 from t2;
+show create table t2;
+drop table t1, t2;
| Thread |
|---|
| • bk commit into 5.0 tree (ramil:1.1940) BUG#11091 | ramil | 15 Jun |