diff options
author | Nikita Malyavin <nikitamalyavin@gmail.com> | 2020-12-29 13:38:16 +1000 |
---|---|---|
committer | Nikita Malyavin <nikitamalyavin@gmail.com> | 2021-01-27 00:50:55 +1000 |
commit | 21809f9a450df1bc44cef36377f96b516ac4a9ae (patch) | |
tree | 0a41aaf587677a1f5319c02ab9e6cec5b1e1f397 /storage/mroonga | |
parent | c207f04eccf2a1f35e6bac2b8146f6c5e0643857 (diff) | |
download | mariadb-git-21809f9a450df1bc44cef36377f96b516ac4a9ae.tar.gz |
MDEV-17556 Assertion `bitmap_is_set_all(&table->s->all_set)' failed
The assertion failed in handler::ha_reset upon SELECT under
READ UNCOMMITTED from table with index on virtual column.
This was the debug-only failure, though the problem is mush wider:
* MY_BITMAP is a structure containing my_bitmap_map, the latter is a raw
bitmap.
* read_set, write_set and vcol_set of TABLE are the pointers to MY_BITMAP
* The rest of MY_BITMAPs are stored in TABLE and TABLE_SHARE
* The pointers to the stored MY_BITMAPs, like orig_read_set etc, and
sometimes all_set and tmp_set, are assigned to the pointers.
* Sometimes tmp_use_all_columns is used to substitute the raw bitmap
directly with all_set.bitmap
* Sometimes even bitmaps are directly modified, like in
TABLE::update_virtual_field(): bitmap_clear_all(&tmp_set) is called.
The last three bullets in the list, when used together (which is mostly
always) make the program flow cumbersome and impossible to follow,
notwithstanding the errors they cause, like this MDEV-17556, where tmp_set
pointer was assigned to read_set, write_set and vcol_set, then its bitmap
was substituted with all_set.bitmap by dbug_tmp_use_all_columns() call,
and then bitmap_clear_all(&tmp_set) was applied to all this.
To untangle this knot, the rule should be applied:
* Never substitute bitmaps! This patch is about this.
orig_*, all_set bitmaps are never substituted already.
This patch changes the following function prototypes:
* tmp_use_all_columns, dbug_tmp_use_all_columns
to accept MY_BITMAP** and to return MY_BITMAP * instead of my_bitmap_map*
* tmp_restore_column_map, dbug_tmp_restore_column_maps to accept
MY_BITMAP* instead of my_bitmap_map*
These functions now will substitute read_set/write_set/vcol_set directly,
and won't touch underlying bitmaps.
Diffstat (limited to 'storage/mroonga')
-rw-r--r-- | storage/mroonga/lib/mrn_debug_column_access.cpp | 4 | ||||
-rw-r--r-- | storage/mroonga/lib/mrn_debug_column_access.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/storage/mroonga/lib/mrn_debug_column_access.cpp b/storage/mroonga/lib/mrn_debug_column_access.cpp index 778300a33d6..5e875953b57 100644 --- a/storage/mroonga/lib/mrn_debug_column_access.cpp +++ b/storage/mroonga/lib/mrn_debug_column_access.cpp @@ -24,13 +24,13 @@ namespace mrn { : table_(table), bitmap_(bitmap) { #ifdef DBUG_ASSERT_EXISTS - map_ = dbug_tmp_use_all_columns(table_, bitmap_); + map_ = dbug_tmp_use_all_columns(table_, &bitmap_); #endif } DebugColumnAccess::~DebugColumnAccess() { #ifdef DBUG_ASSERT_EXISTS - dbug_tmp_restore_column_map(bitmap_, map_); + dbug_tmp_restore_column_map(&bitmap_, map_); #endif } } diff --git a/storage/mroonga/lib/mrn_debug_column_access.hpp b/storage/mroonga/lib/mrn_debug_column_access.hpp index 7c2fd60344e..77fe05f383c 100644 --- a/storage/mroonga/lib/mrn_debug_column_access.hpp +++ b/storage/mroonga/lib/mrn_debug_column_access.hpp @@ -27,7 +27,7 @@ namespace mrn { TABLE *table_; MY_BITMAP *bitmap_; #ifdef DBUG_ASSERT_EXISTS - my_bitmap_map *map_; + MY_BITMAP *map_; #endif public: DebugColumnAccess(TABLE *table, MY_BITMAP *bitmap); |