Commit 592d8f8d authored by ramil@mysql.com's avatar ramil@mysql.com

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

into mysql.com:/usr/home/ram/work/5.0.b10539
parents 417447ae 44a20071
......@@ -458,3 +458,11 @@ select h from t1;
h
a
drop table t1;
create table t1 (a bit(8)) engine=heap;
insert into t1 values ('1111100000');
Warnings:
Warning 1264 Out of range value adjusted for column 'a' at row 1
select a+0 from t1;
a+0
255
drop table t1;
......@@ -162,3 +162,12 @@ create table t1 (a int, b time, c tinyint, d bool, e char(10), f bit(1),
insert into t1 set a=1;
select h from t1;
drop table t1;
#
# Bug #10539
#
create table t1 (a bit(8)) engine=heap;
insert into t1 values ('1111100000');
select a+0 from t1;
drop table t1;
......@@ -7835,7 +7835,7 @@ int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs)
int Field_bit::store(double nr)
{
return (Field_bit::store((longlong) nr));
return store((longlong) nr);
}
......@@ -8018,7 +8018,8 @@ int Field_bit_as_char::store(const char *from, uint length, CHARSET_INFO *cs)
(delta == 0 && bits && (uint) (uchar) *from >= (uint) (1 << bits)))
{
memset(ptr, 0xff, field_length);
*ptr&= ((1 << bits) - 1); /* set first byte */
if (bits)
*ptr&= ((1 << bits) - 1); /* set first byte */
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1);
return 1;
}
......
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