diff options
author | Galina Shalygina <galina.shalygina@mariadb.com> | 2018-06-01 21:57:10 +0200 |
---|---|---|
committer | Galina Shalygina <galina.shalygina@mariadb.com> | 2018-06-01 21:57:10 +0200 |
commit | 6db465d7ce455cf75ec224108cbe61ca8be63d3d (patch) | |
tree | 9648ff1fc677eebb60b278c2e2c13131934ed2a0 /sql/sql_bitmap.h | |
parent | ffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (diff) | |
parent | 4a49f7f88cfa82ae6eb8e7b5a528e91416b33b52 (diff) | |
download | mariadb-git-shagalla-10.4.tar.gz |
Merge 10.3.7 into 10.4shagalla-10.4
Diffstat (limited to 'sql/sql_bitmap.h')
-rw-r--r-- | sql/sql_bitmap.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sql/sql_bitmap.h b/sql/sql_bitmap.h index 5a2caf89fe2..705a8d169e1 100644 --- a/sql/sql_bitmap.h +++ b/sql/sql_bitmap.h @@ -141,16 +141,16 @@ public: }; }; -/* An iterator to quickly walk over bits in unlonglong bitmap. */ +/* An iterator to quickly walk over bits in ulonglong bitmap. */ class Table_map_iterator { ulonglong bmp; uint no; public: Table_map_iterator(ulonglong t) : bmp(t), no(0) {} - int next_bit() + uint next_bit() { - static const char last_bit[16]= {32, 0, 1, 0, + static const uchar last_bit[16]= {32, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0}; @@ -162,10 +162,10 @@ public: if (!bmp) return BITMAP_END; } - bmp &= ~(1LL << bit); + bmp &= ~(1ULL << bit); return no + bit; } - int operator++(int) { return next_bit(); } + uint operator++(int) { return next_bit(); } enum { BITMAP_END= 64 }; }; @@ -201,7 +201,10 @@ public: bool is_subset(const Bitmap<64>& map2) const { return !(map & ~map2.map); } bool is_overlapping(const Bitmap<64>& map2) const { return (map & map2.map)!= 0; } bool operator==(const Bitmap<64>& map2) const { return map == map2.map; } - char *print(char *buf) const { longlong2str(map,buf,16); return buf; } + char *print(char *buf) const { + longlong2str(longlong(map), buf, 16); + return buf; + } ulonglong to_ulonglong() const { return map; } class Iterator : public Table_map_iterator { |