MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
  • MariaDB\ 71.8%
  • C++ 16.4%
  • C 10.4%
  • Shell 0.5%
  • Perl 0.4%
  • Other 0.3%
Find a file
Aleksey Midenkov b02dbe35f8 MDEV-25365 Server hangs or crashes in Query_cache::move_by_type upon FLUSH QUERY CACHE
Caused by Bug#988 in 702b5ad.

How it works

QUERY blocks has all its tables in the array coming after
Query_cache_block header. Each such table element
(Query_cache_block_table) is also an element of doubly-linked circular
list associated with TABLE block used to find all queries by a
table. TABLE block data() is actually Query_cache_table: identificator
for table elements by real name. Every element in the circular list
has `parent` set to such Query_cache_table, except the list root. The
list root is the only Query_cache_block_table element owned by a TABLE
block, all other elements are owned by QUERY blocks. Thus TABLE block
n_tables is always 1.

FREE blocks are transformed into gap pointed by `border`. All the
QUERY and TABLE blocks are moved in place of the gap providing free
space defragmentation. Moving is done by creating new block at the
location of the gap and then doing memmove() from an old block to new
block. This may involve blocks overlap when the distance between the
blocks is less than the block size.

What was broken

When the old and the new QUERY blocks overlap, pointer can be in range
of both of them and checking the range does not guarantee affiliation
of the pointer with the old block. Such intra-block checks added by
Bug#988 can wrongly work on an already updated pointer.

In the test case small gap allows both tables 16 and 17 to be in the
overlapping region of old and new blocks. Iteration 16 updated
`prev->next` on the normal manner and the `prev` was table 17.
Iteration 17 sees this `next` as a pointer coming from an old block
though really it is already for a new block (as small gap shift allows
table 16 to be in both blocks), and it shifts it to the wrong
location. That have broken TABLE block circular chain.

How it was fixed

The fix modifies intra-block checks to work only in the forward
direction. F.ex., current table jx references intra-block by `next`
another table jy in later iteration (jx < jy) and we shift this `next`
pointer. Then by normal code (pre-Bug#988) we update `next->prev`. At
iteration jy we skip intra-block check for `prev` as it is in the past
iteration and was updated by iteration jx. The same happens for the
opposite direction, there is no semantic difference between `next` and
`prev` pointers.
2026-03-19 00:10:14 +03:00
.github Merge 10.6 into 10.9 2023-05-19 15:11:06 +03:00
BUILD Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
client MDEV-38778 mariadbcheck --silent 2026-02-22 15:45:17 +01:00
cmake MDEV-38671: Default to large innodb_buffer_pool_size_max (except on AIX) 2026-03-02 11:30:56 +02:00
dbug Merge 10.6 into 10.8 2023-02-10 13:43:53 +02:00
debian MDEV-39031 remove Docs/README-wsrep 2026-03-11 08:40:53 +02:00
Docs MDEV-39031 remove Docs/README-wsrep 2026-03-11 08:40:53 +02:00
extra MDEV-28619 Server crash and UBSAN null-pointer-use in Window_funcs_sort::setup 2026-03-12 14:05:17 +03:00
include MDEV-38671: Default to large innodb_buffer_pool_size_max (except on AIX) 2026-03-02 11:30:56 +02:00
libmariadb@9e2b0370de MDEV-28619 Server crash and UBSAN null-pointer-use in Window_funcs_sort::setup 2026-03-12 14:05:17 +03:00
libmysqld Merge 10.6 into 10.11 2026-03-11 09:06:05 +02:00
libservices Merge 10.6 into 10.11 2024-02-08 15:04:46 +02:00
man MDEV-37908: Replace KB links with MariaDB Documentation links 2026-01-08 14:54:47 +11:00
mysql-test MDEV-25365 Server hangs or crashes in Query_cache::move_by_type upon FLUSH QUERY CACHE 2026-03-19 00:10:14 +03:00
mysys MDEV-38696 Fix infinite loop in my_copy() function 2026-03-12 13:57:59 +05:30
mysys_ssl MDEV-35838 libressl support differences in CRYPTO_set_mem_functions 2025-01-14 12:13:22 +11:00
plugin Merge branch '10.6' into 10.11 2026-01-28 14:22:20 +01:00
randgen/conf Group commit for maria engine. 2010-02-12 15:12:28 +02:00
scripts MDEV-37979 sys.ps_setup_save does not restore SQL_LOG_BIN after error, causes replication discrepancy 2026-01-14 19:44:30 +01:00
sql MDEV-25365 Server hangs or crashes in Query_cache::move_by_type upon FLUSH QUERY CACHE 2026-03-19 00:10:14 +03:00
sql-bench MDEV-36362 MariaDB crashes when parsing fuzzer generated PARTITION 2026-03-12 14:01:32 +03:00
sql-common MDEV-38006 Inconsistent behaviors when casting into time 2026-01-14 19:44:54 +01:00
storage MDEV-38968 Redundant FILE_CHECKPOINT writes 2026-03-11 12:20:08 +02:00
strings Merge 10.6 into 10.11 2026-03-06 12:07:53 +02:00
support-files MDEV-38313 Add WantedBy=sockets.target to systemd socket definations 2026-01-07 14:58:09 +11:00
tests Merge 10.6 into 10.11 2026-03-11 09:06:05 +02:00
tpool MDEV-37728: Fix shutdown deadlock between thr_timer_end and set_period 2025-09-24 22:25:59 +02:00
unittest Improve crc32 test data 2025-10-02 15:44:34 +03:00
vio Merge branch '10.6' into 10.11 2025-05-26 16:59:32 +02:00
win new HeidiSQL 2026-01-20 12:32:00 +01:00
wsrep-lib@7010f0ab58 MDEV-31517 Wrong variable name in the configuration leads Galera to 2025-12-01 12:37:56 +02:00
zlib Merge branch 'merge-zlib' (1.3.1) into 10.4 2024-04-26 13:50:03 +02:00
.clang-format Remove duplicate key "Language" from .clang-format 2024-04-17 16:52:37 +02:00
.gitattributes Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
.gitignore Merge 10.6 into 10.11 2025-05-21 07:36:35 +03:00
.gitlab-ci.yml Merge branch '10.6' into 10.11 2024-07-22 15:14:50 +02:00
.gitmodules Merge remote-tracking branch '10.4' into 10.5 2023-03-31 21:32:41 +02:00
appveyor.yml Fix appveyor config 2025-04-18 19:53:55 +02:00
BUILD-CMAKE Minor spelling fixes in code comments, docs and output 2018-01-12 16:49:02 +02:00
CMakeLists.txt MDEV-39031 remove Docs/README-wsrep 2026-03-11 08:40:53 +02:00
config.h.cmake MDEV-38671: Default to large innodb_buffer_pool_size_max (except on AIX) 2026-03-02 11:30:56 +02:00
configure.cmake Merge branch '10.6' into 10.11 2024-10-29 15:24:38 +01:00
CONTRIBUTING.md MDEV-38673: Focus the pick-a-task wording in CONTRIBUTING.md 2026-03-04 14:53:03 +02:00
COPYING Update FSF Address 2019-05-11 21:29:06 +03:00
CREDITS MDEV-37908: Replace KB links with MariaDB Documentation links 2026-01-08 14:54:47 +11:00
INSTALL-SOURCE Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
INSTALL-WIN-SOURCE Update AskMonty and Atlassian references to MariaDB 2016-03-08 15:24:01 +02:00
KNOWN_BUGS.txt Changed some MySQL names in messages to MariaDB 2018-12-09 20:49:05 +02:00
README.md Update README for branch choice 2024-05-29 13:49:32 +01:00
THIRDPARTY Merge branch '10.6' into 10.11 2024-02-01 18:36:14 +01:00
VERSION bump the VERSION 2026-02-04 17:05:53 -05:00

Code status:

  • Appveyor CI status ci.appveyor.com

MariaDB: The innovative open source database

MariaDB was designed as a drop-in replacement of MySQL(R) with more features, new storage engines, fewer bugs, and better performance.

MariaDB is brought to you by the MariaDB Foundation and the MariaDB Corporation. Please read the CREDITS file for details about the MariaDB Foundation, and who is developing MariaDB.

MariaDB is developed by many of the original developers of MySQL who now work for the MariaDB Corporation, the MariaDB Foundation and by many people in the community.

MySQL, which is the base of MariaDB, is a product and trademark of Oracle Corporation, Inc. For a list of developers and other contributors, see the Credits appendix. You can also run 'SHOW authors' to get a list of active contributors.

A description of the MariaDB project and a manual can be found at:

https://mariadb.org

https://mariadb.com/kb/en/

https://mariadb.com/kb/en/mariadb-vs-mysql-features/

https://mariadb.com/kb/en/mariadb-versus-mysql-compatibility/

https://mariadb.com/kb/en/new-and-old-releases/

Getting the code, building it and testing it

Refer to the following guide: https://mariadb.org/get-involved/getting-started-for-developers/get-code-build-test/ which outlines how to build the source code correctly and run the MariaDB testing framework, as well as which branch to target for your contributions.

Help

More help is available from the Maria Discuss mailing list https://lists.mariadb.org/postorius/lists/discuss.lists.mariadb.org/ and MariaDB's Zulip instance, https://mariadb.zulipchat.com/

Licensing


MariaDB is specifically available only under version 2 of the GNU General Public License (GPLv2). (I.e. Without the "any later version" clause.) This is inherited from MySQL. Please see the README file in the MySQL distribution for more information.

License information can be found in the COPYING file. Third party license information can be found in the THIRDPARTY file.


Bug Reports

Bug and/or error reports regarding MariaDB should be submitted at: https://jira.mariadb.org

For reporting security vulnerabilities see: https://mariadb.org/about/security-policy/

The code for MariaDB, including all revision history, can be found at: https://github.com/MariaDB/server