From e5d60351884b93c81f501f1da056bdccfd2d19d1 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Thu, 30 Oct 2003 21:04:09 +0100 Subject: [PATCH] post-merge fixes --- mysql-test/t/fulltext.test | 4 ++-- mysys/my_bitmap.c | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 80655f28d00..37913d2d747 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -131,9 +131,9 @@ select * from t2 having MATCH inhalt AGAINST ('foobar'); # check of fulltext errors # ---error 1280 +--error 1281 CREATE TABLE t3 (t int(11),i text,fulltext tix (t,i)); ---error 1280 +--error 1281 CREATE TABLE t3 (t int(11),i text, j varchar(200) CHARACTER SET latin2, fulltext tix (i,j)); diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index ba4bbde4e3e..336bf27d559 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -26,6 +26,8 @@ must be within bitmap size * bitmap_set_prefix() is an exception - one can use ~0 to set all bits * when both arguments are bitmaps, they must be of the same size + * bitmap_intersect() is an exception :) + (for for Bitmap::intersect(ulonglong map2buff)) TODO: Make assembler THREAD safe versions of these using test-and-set instructions @@ -244,17 +246,24 @@ my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2) void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2) { uchar *to=map->bitmap, *from=map2->bitmap, *end; + uint len=map->bitmap_size, len2=map2->bitmap; - DBUG_ASSERT(map->bitmap && map2->bitmap && - map->bitmap_size==map2->bitmap_size); + DBUG_ASSERT(map->bitmap && map2->bitmap); bitmap_lock(map); bitmap_lock(map2); - end= to+map->bitmap_size; + end= to+min(len,len2); while (to < end) *to++ &= *from++; + if (len2 < len) + { + end+=len-len2; + while (to < end) + *to++=0; + } + bitmap_unlock(map2); bitmap_unlock(map); }