Commit a8ca722a authored by unknown's avatar unknown

Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.1-maint

into  mysql.com:/home/ram/work/b28631/b28631.5.1


sql/field.h:
  Auto merged
parents a7490c4d 4dcf55f2
...@@ -619,3 +619,29 @@ bit_field int_field ...@@ -619,3 +619,29 @@ bit_field int_field
handler t1 close; handler t1 close;
drop table t1; drop table t1;
End of 5.0 tests End of 5.0 tests
create table t1(a bit(7));
insert into t1 values(0x40);
alter table t1 modify column a bit(8);
select hex(a) from t1;
hex(a)
40
insert into t1 values(0x80);
select hex(a) from t1;
hex(a)
40
80
create index a on t1(a);
insert into t1 values(0x81);
select hex(a) from t1;
hex(a)
40
80
81
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bit(8) DEFAULT NULL,
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
End of 5.1 tests
...@@ -273,3 +273,20 @@ handler t1 close; ...@@ -273,3 +273,20 @@ handler t1 close;
drop table t1; drop table t1;
--echo End of 5.0 tests --echo End of 5.0 tests
#
# Bug #28631: problem after alter
#
create table t1(a bit(7));
insert into t1 values(0x40);
alter table t1 modify column a bit(8);
select hex(a) from t1;
insert into t1 values(0x80);
select hex(a) from t1;
create index a on t1(a);
insert into t1 values(0x81);
select hex(a) from t1;
show create table t1;
drop table t1;
--echo End of 5.1 tests
...@@ -8239,6 +8239,13 @@ Field *Field_bit::new_key_field(MEM_ROOT *root, ...@@ -8239,6 +8239,13 @@ Field *Field_bit::new_key_field(MEM_ROOT *root,
} }
uint Field_bit::is_equal(create_field *new_field)
{
return (new_field->sql_type == real_type() &&
new_field->length == max_display_length());
}
int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs) int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs)
{ {
ASSERT_COLUMN_MARKED_FOR_WRITE; ASSERT_COLUMN_MARKED_FOR_WRITE;
......
...@@ -1552,6 +1552,7 @@ public: ...@@ -1552,6 +1552,7 @@ public:
bit_ptr == ((Field_bit *)field)->bit_ptr && bit_ptr == ((Field_bit *)field)->bit_ptr &&
bit_ofs == ((Field_bit *)field)->bit_ofs); bit_ofs == ((Field_bit *)field)->bit_ofs);
} }
uint is_equal(create_field *new_field);
void move_field_offset(my_ptrdiff_t ptr_diff) void move_field_offset(my_ptrdiff_t ptr_diff)
{ {
Field::move_field_offset(ptr_diff); Field::move_field_offset(ptr_diff);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment