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.
Find a file
Rucha Deodhar 7865c8c9a2 Crash in INSERT...SELECT..RETURNING with subquery
Underlying causes of all bugs mentioned below are same. This patch fixes
all of them:
1) MDEV-25028: ASAN use-after-poison in
base_list_iterator::next or Assertion `sl->join == 0' upon
INSERT .. RETURNING via PS
2) MDEV-25187: Assertion `inited == NONE || table->open_by_handler'
failed or Direct leak in init_dynamic_array2 upon INSERT .. RETURNING
and memory leak in init_dynamic_array2
3) MDEV-28740: crash in INSERT RETURNING subquery in prepared statements
4) MDEV-27165: crash in base_list_iterator::next
5) MDEV-29686: Assertion `slave == 0' failed in
st_select_lex_node::attach_single

Analysis:
consider this statement:
INSERT(1)...SELECT(2)...(SELECT(3)...) RETURNING (SELECT(4)...)

When RETURNING is encountered, add_slave() changes how selects are linked.
It makes the builtin_select(1) slave of SELECT(2). This causes
losing of already existing slave(3) (which is nested select of SELECT of
INSERT...SELECT). When really, builtin_select (1) shouldn't be slave to
SELECT(2) because it is not nested within it. Also, push_select() to use
correct context also changed how select are linked.
During reinit_stmt_before_use(), we expect the selects to
be cleaned-up and have join=0. Since these selects are not linked correctly,
clean-up doesn't happen correctly so join is not NULL. Hence the crash.

Fix:
IF we are parsing RETURNING, make is_parsing_returning= true for
current select. get rid of add_slave(). In place of push_select(), used
push_context() to have correct context (the context of builtin_select)
to resolve items in item_list. And add these items to item_list of
builtin_select.
2022-10-03 18:07:41 +05:30
.github
BUILD Merge branch '10.4' into 10.5 2022-08-10 12:24:31 +02:00
client Merge branch '10.4' into 10.5 2022-10-02 14:38:13 +02:00
cmake Merge 10.4 into 10.5 2022-09-20 13:17:02 +03:00
dbug Merge branch '10.4' into 10.5 2022-08-10 12:24:31 +02:00
debian Merge 10.3 into 10.4 2022-09-13 16:36:38 +03:00
Docs Merge 10.4 into 10.5 2022-09-26 13:34:38 +03:00
extra MDEV-29613 Improve WITH_DBUG_TRACE=OFF 2022-09-23 13:40:42 +03:00
include Merge branch '10.4' into 10.5 2022-10-02 14:38:13 +02:00
libmariadb@7fdb3eab66 CC 3.1 update 2022-07-29 13:39:12 +02:00
libmysqld
libservices
man Merge branch '10.4' into 10.5 2022-08-04 08:30:03 +02:00
mysql-test Crash in INSERT...SELECT..RETURNING with subquery 2022-10-03 18:07:41 +05:30
mysys Merge 10.4 into 10.5 2022-09-26 13:34:38 +03:00
mysys_ssl
plugin Merge branch '10.4' into 10.5 2022-10-02 14:38:13 +02:00
randgen/conf
scripts Update 10.5 HELP contents 2022-09-19 16:57:22 +10:00
sql Crash in INSERT...SELECT..RETURNING with subquery 2022-10-03 18:07:41 +05:30
sql-bench
sql-common
storage Merge branch '10.4' into 10.5 2022-10-02 14:38:13 +02:00
strings
support-files
tests
tpool MDEV-29367 Refactor tpool::cache 2022-08-24 13:36:49 +02:00
unittest
vio
win
wsrep-lib@8bfce04189
zlib
.clang-format
.gitattributes
.gitignore
.gitmodules
appveyor.yml
BUILD-CMAKE
CMakeLists.txt Merge 10.4 into 10.5 2022-09-26 13:34:38 +03:00
config.h.cmake Merge branch 10.4 into 10.5 2022-08-31 11:06:14 +10:00
configure.cmake
CONTRIBUTING.md
COPYING
CREDITS
INSTALL-SOURCE
INSTALL-WIN-SOURCE
KNOWN_BUGS.txt
README.md
THIRDPARTY
VERSION bump the VERSION 2022-08-14 22:53:37 -04:00

Code status:

  • Appveyor CI status ci.appveyor.com

MariaDB: The open source relational 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/

Help

More help is available from the Maria Discuss mailing list https://launchpad.net/~maria-discuss, MariaDB's Zulip instance, https://mariadb.zulipchat.com/

Live QA for beginner contributors

MariaDB has a dedicated time each week when we answer new contributor questions live on Zulip. From 8:00 to 10:00 UTC on Mondays, and 10:00 to 12:00 UTC on Thursdays, anyone can ask any questions theyd like, and a live developer will be available to assist.

New contributors can ask questions any time, but we will provide immediate feedback during that interval.

Licensing


NOTE:

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