diff options
author | unknown <serg@serg.mylan> | 2005-06-01 18:33:16 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-06-01 18:33:16 +0200 |
commit | 04ed9f0204c1d21d4ebac0ad612f9b5aaf27effa (patch) | |
tree | 0d95c67643faba800e847955562fe895c8af7b6f /sql/sql_bitmap.h | |
parent | 92f7de69f280ce49a2b09835718188cd102c2575 (diff) | |
download | mariadb-git-04ed9f0204c1d21d4ebac0ad612f9b5aaf27effa.tar.gz |
more than 64 indexes per table. bugfixes. bug#10995
Diffstat (limited to 'sql/sql_bitmap.h')
-rw-r--r-- | sql/sql_bitmap.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index 2fd603d9381..958268fc314 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -28,7 +28,7 @@ template <uint default_width> class Bitmap uchar buffer[(default_width+7)/8]; public: Bitmap() { init(); } - Bitmap(Bitmap& from) { *this=from; } + Bitmap(const Bitmap& from) { *this=from; } explicit Bitmap(uint prefix_to_set) { init(prefix_to_set); } void init() { bitmap_init(&map, buffer, default_width, 0); } void init(uint prefix_to_set) { init(); set_prefix(prefix_to_set); } @@ -61,18 +61,17 @@ public: my_bool operator==(const Bitmap& map2) const { return bitmap_cmp(&map, &map2.map); } char *print(char *buf) const { - char *s=buf; int i; - for (i=sizeof(buffer)-1; i>=0 ; i--) + char *s=buf; + const uchar *e=buffer, *b=e+sizeof(buffer)-1; + while (!*b && b>e) + b--; + if ((*s=_dig_vec_upper[*b >> 4]) != '0') + s++; + *s++=_dig_vec_upper[*b & 15]; + while (--b>=e) { - if ((*s=_dig_vec_upper[buffer[i] >> 4]) != '0') - break; - if ((*s=_dig_vec_upper[buffer[i] & 15]) != '0') - break; - } - for (s++, i-- ; i>=0 ; i--) - { - *s++=_dig_vec_upper[buffer[i] >> 4]; - *s++=_dig_vec_upper[buffer[i] & 15]; + *s++=_dig_vec_upper[*b >> 4]; + *s++=_dig_vec_upper[*b & 15]; } *s=0; return buf; |