mariadb/include
Jon Olav Hauglid ba5b97343c Bug #11752069 (former bug 43152)
Assertion `bitmap_is_set_all(&table->s->all_set)' failed in
handler::ha_reset

This assertion could be triggered if two connections simultaneously
executed two bitmap test functions on the same bitmap. For example,
the assertion could be triggered if one connection executed UPDATE
while a second connection executed SELECT on the same table.

Even if bitmap test functions have read-only semantics and have
const bitmaps as parameter, several of them modified the internal
state of the bitmap. With interleaved execution of two such functions
it was possible for one function to modify the state of the same
bitmap that the other function had just modified. This lead to an
inconsistent state and could trigger the assert.

Internally the bitmap uses 32 bit words for storage. Since bitmaps
can contain any number of bits, the last word in the bitmap may
not be fully used. A 32 bit mask is maintained where a bit is set
if the corresponding bit in the last bitmap word is unused.
The problem was that several test functions applied this mask to
the last word. Sometimes the mask was negated and used to zero out
the remainder of the last word and sometimes the mask was used as-is
to fill the remainder of the last word with 1's. This meant that if
a function first used the negated mask and another function then
used the mask as-is (or vice-versa), the first function would then
get the wrong result.

This patch fixes the problem by changing the implementation of
9 bitmap functions that modified the bitmap state even if the 
bitmap was declared const. These functions now preserve the
internal state of the bitmap. This makes it possible for
two connections to concurrently execute two of these functions
on the same bitmap without issues.

The patch also removes dead testing code from my_bitmap.c.
These tests have already been moved to unittest/mysys/bitmap-t.c.
Existing test coverage of my_bitmap has been extended.

No MTR test case added as this would require adding several sync
points to the bitmap functions. The patch has been tested with
a non-deterministic test case posted on the bug report.
2011-02-16 16:26:19 +01:00
..
mysql Bug #42144: plugin_load fails 2010-08-04 15:58:09 +03:00
.cvsignore
base64.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
config-netware.h BUG#58246: INSTALL PLUGIN not secure & crashable 2010-12-01 13:54:50 +01:00
config-win.h merge to 5.1. 2011-02-02 19:05:28 +02:00
decimal.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
errmsg.h Bug#27430 "Crash in subquery code when in PS and table DDL changed after 2008-05-20 20:36:26 +04:00
ft_global.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
hash.h merging with mysql-5.0-bugteam 2009-06-19 17:58:46 +05:30
heap.h Added support for 'internal temporary tables' in HEAP tables. 2007-07-25 01:58:12 +03:00
help_end.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
help_start.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
keycache.h Bug#17332 - changing key_buffer_size on a running server 2009-09-07 18:35:37 +02:00
m_ctype.h BUG#58246: INSTALL PLUGIN not secure & crashable 2010-12-01 13:54:50 +01:00
m_string.h Bug#57994: Compiler flag change build error : my_redel.c 2010-11-20 12:29:51 -02:00
Makefile.am Merge 2010-12-29 00:47:05 +01:00
my_aes.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
my_alarm.h Bug#54667: Unnecessary signal handler redefinition 2010-07-01 12:02:00 +04:00
my_alloc.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_attribute.h Bug#25118 ATTRIBUTE_FORMAT_FPTR undeclared in m_ctype.h 2007-04-12 00:43:25 +02:00
my_base.h merge 5.0-bugteam to 5.1-bugteam 2009-07-24 12:15:06 +05:30
my_bit.h Bug #11752069 (former bug 43152) 2011-02-16 16:26:19 +01:00
my_bitmap.h Bug #11752069 (former bug 43152) 2011-02-16 16:26:19 +01:00
my_compiler.h Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure 2010-11-10 19:14:47 -02:00
my_dbug.h Bug #58426 Crashing tests not failing as they are supposed to on Solaris 10 debug 2010-12-13 17:13:01 +01:00
my_dir.h Many files: 2006-12-23 20:17:15 +01:00
my_getopt.h Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:16:43 -03:00
my_global.h BUG#58246: INSTALL PLUGIN not secure & crashable 2010-12-01 13:54:50 +01:00
my_handler.h Merge 2010-12-29 00:47:05 +01:00
my_libwrap.h Many files: 2006-12-23 20:17:15 +01:00
my_list.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_md5.h Bug #42434: license of mysys MD5 implementation is not GPL-compatible 2009-03-09 20:57:03 +02:00
my_net.h Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_no_pthread.h Bug #45058 init_available_charsets uses double checked locking 2009-12-12 19:11:25 +01:00
my_nosys.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_pthread.h Updating header copyright/README in source for 2011 2011-01-25 15:42:40 +01:00
my_stacktrace.h Bug#51817: incorrect assumption: thd->query at 0x2ab2a8360360 is an invalid pointer 2010-11-26 19:59:10 -02:00
my_sys.h Updating header copyright/README in source for 2011 2011-01-25 15:42:40 +01:00
my_time.h merge to 5.1. 2011-02-02 19:05:28 +02:00
my_tree.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_trie.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_uctype.h Many files: 2006-12-31 02:29:11 +01:00
my_user.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_vle.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_xml.h WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
myisam.h Bug#54457: Test suite broken for 32-bit build 2010-06-28 16:20:28 -03:00
myisammrg.h Bug#45800 crash when replacing into a merge table and there is a duplicate 2009-07-30 16:04:41 +05:30
myisampack.h Many files: 2006-12-23 20:17:15 +01:00
mysql.h Fixed bug #47485 - mysql_store_result returns a not NULL result set 2010-09-07 14:18:01 +07:00
mysql.h.pp Fixed bug #47485 - mysql_store_result returns a not NULL result set 2010-09-07 14:18:01 +07:00
mysql_com.h Merge 2010-12-29 00:47:05 +01:00
mysql_embed.h Bug#57210: remove pstack 2010-11-09 12:45:13 -02:00
mysql_time.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
mysql_version.h.in Bug #15327: configure: --with-tcp-port option being partially ignored 2007-09-13 16:19:46 +02:00
mysys_err.h Fix for bug#48451: my_seek and my_tell ignore MY_WME flag 2010-12-09 12:59:12 +03:00
queues.h Bug #31890 Partitions: ORDER BY DESC in InnoDB not working. 2007-11-14 22:20:31 +04:00
rijndael.h my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
sha1.h Bug #56428: Replace copyright notice removed from SHA1 code (.h) 2010-10-05 17:05:37 +03:00
sql_common.h Merge mysql.com:/home/hf/work/25097/my50-25097 2008-02-27 13:00:59 +04:00
sslopt-case.h Many files: 2006-12-23 20:17:15 +01:00
sslopt-longopts.h Bug#42733: Type-punning warnings when compiling MySQL -- 2010-06-10 17:16:43 -03:00
sslopt-vars.h Many files: 2006-12-23 20:17:15 +01:00
t_ctype.h Many files: 2006-12-23 20:17:15 +01:00
thr_alarm.h fixes for build failures due to my yesterday's changeset forbidding 2008-02-19 18:45:11 +01:00
thr_lock.h Bug#44164: TL_WRITE has no description in lock_descriptions[] 2009-04-14 14:05:32 +02:00
typelib.h Merge bk-internal.mysql.com:/home/bk/mysql-5.1-engines 2007-04-27 19:09:39 +02:00
violite.h Bug#47571 : idle named pipe connection is unkillable 2009-11-20 13:09:50 +01:00