mariadb/storage/connect
Nikita Malyavin e25623e78a 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.
2021-01-08 16:04:29 +10:00
..
mysql-test/connect
.gitignore
ApacheInterface.java
array.cpp
array.h
blkfil.cpp
blkfil.h
block.h
catalog.h
checklvl.h
Client.java
CMakeLists.txt
cmgfam.cpp
cmgfam.h
cmgoconn.cpp
cmgoconn.h
colblk.cpp
colblk.h
connect.cc
connect.h
csort.cpp
csort.h
domdoc.cpp
domdoc.h
encas.h
engmsg.h
enids.h
filamap.cpp
filamap.h
filamdbf.cpp
filamdbf.h
filamfix.cpp
filamfix.h
filamgz.cpp
filamgz.h
filamtxt.cpp
filamtxt.h
filamvct.cpp
filamvct.h
filamzip.cpp
filamzip.h
filter.cpp
filter.h
fmdlex.c
frcas.h
frids.h
frmsg.h
frmsg1.h
frmsg2.h
global.h
ha_connect.cc
ha_connect.h
inihandl.cpp
inihandl.h
ioapi.c
ioapi.h
javaconn.cpp
javaconn.h
JavaWrappers.jar
jdbccat.h
JdbcInterface.java
jdbconn.cpp
jdbconn.h
jmgfam.cpp
jmgfam.h
jmgoconn.cpp
jmgoconn.h
json.cpp
json.h
jsonudf.cpp
jsonudf.h
libdoc.cpp
libdoc.h
macutil.cpp
macutil.h
maputil.cpp
maputil.h
MariadbInterface.java
messages.h
mini-global.h
mongo.cpp
mongo.h
Mongo2Interface.java
Mongo3Interface.java
msgid.h
mycat.cc
mycat.h
myconn.cpp
myconn.h
MysqlInterface.java
myutil.cpp
myutil.h
noconst.c
odbccat.h
odbconn.cpp
odbconn.h
OracleInterface.java
os.h
osutil.c
osutil.h
plgcnx.h
plgdbsem.h
plgdbutl.cpp
plgodbc.h
plgxml.cpp
plgxml.h
plugutil.cpp
PostgresqlInterface.java
preparse.h
rcmsg.c
rcmsg.h
reldef.cpp
reldef.h
resource.h
rest.def
restget.cpp
tabcmg.cpp
tabcmg.h
tabcol.cpp
tabcol.h
tabdos.cpp
tabdos.h
tabext.cpp
tabext.h
tabfix.cpp
tabfix.h
tabfmt.cpp
tabfmt.h
tabjdbc.cpp
tabjdbc.h
tabjmg.cpp
tabjmg.h
tabjson.cpp
tabjson.h
table.cpp
tabmac.cpp
tabmac.h
tabmul.cpp
tabmul.h
tabmysql.cpp
tabmysql.h
taboccur.cpp
taboccur.h
tabodbc.cpp
tabodbc.h
tabpivot.cpp
tabpivot.h
tabrest.cpp
tabrest.h
tabsys.cpp
tabsys.h
tabtbl.cpp
tabtbl.h
tabutil.cpp
tabutil.h
tabvct.cpp
tabvct.h
tabvir.cpp
tabvir.h
tabwmi.cpp
tabwmi.h
tabxcl.cpp
tabxcl.h
tabxml.cpp
tabxml.h
tabzip.cpp
tabzip.h
unzip.c
unzip.h
user_connect.cc
user_connect.h
valblk.cpp
valblk.h
value.cpp
value.h
xindex.cpp
xindex.h
xobject.cpp
xobject.h
xtable.h
zip.c
zip.h