bug#16125 - ndb bitfield of exact 32 bits, incorrect assertion (i.e. only...

bug#16125 - ndb bitfield of exact 32 bits, incorrect assertion (i.e. only noticable in debug compiled)
parent eaa777ee
...@@ -208,3 +208,9 @@ b bit(9), ...@@ -208,3 +208,9 @@ b bit(9),
key(b) key(b)
) engine=ndbcluster; ) engine=ndbcluster;
ERROR HY000: Can't create table './test/t1.frm' (errno: 743) ERROR HY000: Can't create table './test/t1.frm' (errno: 743)
create table t1 (
pk1 int primary key,
b bit(32) not null
) engine=ndbcluster;
insert into t1 values (1,1);
drop table t1;
...@@ -112,3 +112,11 @@ create table t1 ( ...@@ -112,3 +112,11 @@ create table t1 (
key(b) key(b)
) engine=ndbcluster; ) engine=ndbcluster;
# bug#16125
create table t1 (
pk1 int primary key,
b bit(32) not null
) engine=ndbcluster;
insert into t1 values (1,1);
drop table t1;
...@@ -814,7 +814,7 @@ inline void ...@@ -814,7 +814,7 @@ inline void
BitmaskImpl::getField(unsigned size, const Uint32 src[], BitmaskImpl::getField(unsigned size, const Uint32 src[],
unsigned pos, unsigned len, Uint32 dst[]) unsigned pos, unsigned len, Uint32 dst[])
{ {
assert(pos + len < (size << 5)); assert(pos + len <= (size << 5));
src += (pos >> 5); src += (pos >> 5);
Uint32 offset = pos & 31; Uint32 offset = pos & 31;
...@@ -833,7 +833,7 @@ inline void ...@@ -833,7 +833,7 @@ inline void
BitmaskImpl::setField(unsigned size, Uint32 dst[], BitmaskImpl::setField(unsigned size, Uint32 dst[],
unsigned pos, unsigned len, const Uint32 src[]) unsigned pos, unsigned len, const Uint32 src[])
{ {
assert(pos + len < (size << 5)); assert(pos + len <= (size << 5));
dst += (pos >> 5); dst += (pos >> 5);
Uint32 offset = pos & 31; Uint32 offset = pos & 31;
......
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