summaryrefslogtreecommitdiff
path: root/mysys/my_bitmap.c
diff options
context:
space:
mode:
authoringo@mysql.com <>2005-07-19 14:13:56 +0200
committeringo@mysql.com <>2005-07-19 14:13:56 +0200
commitec15dda2bfa246d71a257da2d25c3d398b4d4cc4 (patch)
tree003d6387fee9d1df4a7d4fbe316c3c68765105d4 /mysys/my_bitmap.c
parentd1bc1b7c0e317f73e309697f8e7baebb77b4ca59 (diff)
downloadmariadb-git-ec15dda2bfa246d71a257da2d25c3d398b4d4cc4.tar.gz
Bug#10932 - Building server with key limit of 128, makes test cases fail
This patch allows to configure MyISAM for 128 indexes per table. The main problem is the key_map, wich is implemented as an ulonglong. To get rid of the limit and keep the efficient and flexible implementation, the highest bit is now used for all upper keys. This means that the lower keys can be disabled and enabled individually as usual and the high keys can only be disabled and enabled as a block. That way the existing test suite is still applicable, while more keys work, though slightly less efficient. To really get more than 64 keys, some defines need to be changed. Another patch will address this.
Diffstat (limited to 'mysys/my_bitmap.c')
-rw-r--r--mysys/my_bitmap.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c
index c70c0fa0754..4a917fc8287 100644
--- a/mysys/my_bitmap.c
+++ b/mysys/my_bitmap.c
@@ -339,6 +339,37 @@ void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2)
}
+/*
+ Set/clear all bits above a bit.
+
+ SYNOPSIS
+ bitmap_set_above()
+ map RETURN The bitmap to change.
+ from_byte The bitmap buffer byte offset to start with.
+ use_bit The bit value (1/0) to use for all upper bits.
+
+ NOTE
+ You can only set/clear full bytes.
+ The function is meant for the situation that you copy a smaller bitmap
+ to a bigger bitmap. Bitmap lengths are always multiple of eigth (the
+ size of a byte). Using 'from_byte' saves multiplication and division
+ by eight during parameter passing.
+
+ RETURN
+ void
+*/
+
+void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit)
+{
+ uchar use_byte= use_bit ? 0xff : 0;
+ uchar *to= map->bitmap + from_byte;
+ uchar *end= map->bitmap + map->bitmap_size;
+
+ while (to < end)
+ *to++= use_byte;
+}
+
+
void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2)
{
uchar *to=map->bitmap, *from=map2->bitmap, *end;