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
Monty 031f11717d Fix all warnings given by UBSAN
The easiest way to compile and test the server with UBSAN is to run:
./BUILD/compile-pentium64-ubsan
and then run mysql-test-run.
After this commit, one should be able to run this without any UBSAN
warnings. There is still a few compiler warnings that should be fixed
at some point, but these do not expose any real bugs.

The 'special' cases where we disable, suppress or circumvent UBSAN are:
- ref10 source (as here we intentionally do some shifts that UBSAN
  complains about.
- x86 version of optimized int#korr() methods. UBSAN do not like unaligned
  memory access of integers.  Fixed by using byte_order_generic.h when
  compiling with UBSAN
- We use smaller thread stack with ASAN and UBSAN, which forced me to
  disable a few tests that prints the thread stack size.
- Verifying class types does not work for shared libraries. I added
  suppression in mysql-test-run.pl for this case.
- Added '#ifdef WITH_UBSAN' when using integer arithmetic where it is
  safe to have overflows (two cases, in item_func.cc).

Things fixed:
- Don't left shift signed values
  (byte_order_generic.h, mysqltest.c, item_sum.cc and many more)
- Don't assign not non existing values to enum variables.
- Ensure that bool and enum values are properly initialized in
  constructors.  This was needed as UBSAN checks that these types has
  correct values when one copies an object.
  (gcalc_tools.h, ha_partition.cc, item_sum.cc, partition_element.h ...)
- Ensure we do not called handler functions on unallocated objects or
  deleted objects.
  (events.cc, sql_acl.cc).
- Fixed bugs in Item_sp::Item_sp() where we did not call constructor
  on Query_arena object.
- Fixed several cast of objects to an incompatible class!
  (Item.cc, Item_buff.cc, item_timefunc.cc, opt_subselect.cc, sql_acl.cc,
   sql_select.cc ...)
- Ensure we do not do integer arithmetic that causes over or underflows.
  This includes also ++ and -- of integers.
  (Item_func.cc, Item_strfunc.cc, item_timefunc.cc, sql_base.cc ...)
- Added JSON_VALUE_UNITIALIZED to json_value_types and ensure that
  value_type is initialized to this instead of to -1, which is not a valid
  enum value for json_value_types.
- Ensure we do not call memcpy() when second argument could be null.
- Fixed that Item_func_str::make_empty_result() creates an empty string
  instead of a null string (safer as it ensures we do not do arithmetic
  on null strings).

Other things:

- Changed struct st_position to an OBJECT and added an initialization
  function to it to ensure that we do not copy or use uninitialized
  members. The change to a class was also motived that we used "struct
  st_position" and POSITION randomly trough the code which was
  confusing.
- Notably big rewrite in sql_acl.cc to avoid using deleted objects.
- Changed in sql_partition to use '^' instead of '-'. This is safe as
  the operator is either 0 or 0x8000000000000000ULL.
- Added check for select_nr < INT_MAX in JOIN::build_explain() to
  avoid bug when get_select() could return NULL.
- Reordered elements in POSITION for better alignment.
- Changed sql_test.cc::print_plan() to use pointers instead of objects.
- Fixed bug in find_set() where could could execute '1 << -1'.
- Added variable have_sanitizer, used by mtr.  (This variable was before
  only in 10.5 and up).  It can now have one of two values:
  ASAN or UBSAN.
- Moved ~Archive_share() from ha_archive.cc to ha_archive.h and marked
  it virtual. This was an effort to get UBSAN to work with loaded storage
  engines. I kept the change as the new place is better.
- Added in CONNECT engine COLBLK::SetName(), to get around a wrong cast
  in tabutil.cpp.
- Added HAVE_REPLICATION around usage of rgi_slave, to get embedded
  server to compile with UBSAN. (Patch from Marko).
- Added #ifdef for powerpc64 to avoid a bug in old gcc versions related
  to integer arithmetic.

Changes that should not be needed but had to be done to suppress warnings
from UBSAN:

- Added static_cast<<uint16_t>> around shift to get rid of a LOT of
  compiler warnings when using UBSAN.
- Had to change some '/' of 2 base integers to shift to get rid of
  some compile time warnings.

Reviewed by:
- Json changes: Alexey Botchkov
- Charset changes in ctype-uca.c: Alexander Barkov
- InnoDB changes & Embedded server: Marko Mäkelä
- sql_acl.cc changes: Vicențiu Ciorbaru
- build_explain() changes: Sergey Petrunia
2021-04-20 12:30:09 +03:00
BUILD Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
client Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
cmake Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
dbug Merge 10.2 into 10.3 2020-07-02 06:17:51 +03:00
debian Merge 10.3 into 10.4 2021-04-14 10:33:59 +03:00
Docs Merge branch '10.3' into 10.4 2019-06-14 22:10:50 +02:00
extra Merge 10.3 into 10.4 2021-04-14 10:33:59 +03:00
include Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
libmariadb@fc431a035a update libmariadb 2021-03-19 12:05:36 +01:00
libmysqld Merge branch 'bb-10.3-release' into bb-10.4-release 2021-02-12 17:44:22 +01:00
libservices Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
man Merge branch 'bb-10.3-release' into bb-10.4-release 2021-02-12 17:44:22 +01:00
mysql-test Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
mysys Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
mysys_ssl Merge 10.3 into 10.4 2020-10-22 13:27:18 +03:00
pcre Merge branch '10.2' into 10.3 2020-05-04 16:47:11 +02:00
plugin Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
randgen/conf Group commit for maria engine. 2010-02-12 15:12:28 +02:00
scripts Merge 10.3 into 10.4 2021-04-14 10:33:59 +03:00
sql Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
sql-bench Merge 10.2 into 10.3 2020-07-02 06:17:51 +03:00
sql-common Merge branch '10.3' into 10.4 2020-09-28 17:55:39 +05:30
storage Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
strings Fix all warnings given by UBSAN 2021-04-20 12:30:09 +03:00
support-files Merge 10.3 into 10.4 2021-03-31 09:47:14 +03:00
tests Merge 10.3 into 10.4 2021-03-31 09:47:14 +03:00
unittest Merge branch 'bb-10.3-release' into bb-10.4-release 2021-02-12 17:44:22 +01:00
vio Merge 10.3 into 10.4 2021-03-27 17:12:28 +02:00
win Merge branch '10.3' into 10.4 2021-02-23 09:25:57 +01:00
wsrep-lib@a93955ddee Update wsrep-lib 2021-01-08 08:44:18 +02:00
zlib Merge branch '10.3' into 10.4 2020-12-25 09:13:28 +01:00
.clang-format .clang-format - do not sort include files. 2019-12-03 22:22:23 +01:00
.gitattributes Merge branch '10.0' into 10.1 2018-05-05 14:01:59 +02:00
.gitignore MDEV-13467: Feature request: Support for ST_Distance_Sphere() 2021-03-27 10:42:39 +01:00
.gitmodules Fix github urls of submodules 2019-07-02 17:25:36 +04:00
.travis.compiler.sh travis: use galera-4 in 10.4 branch (#1226) 2019-03-14 08:20:32 +02:00
.travis.yml Merge 10.3 into 10.4 2020-09-03 15:53:38 +03:00
appveyor.yml appveyor: config backport from 10.2 2020-04-13 13:49:41 +03:00
BUILD-CMAKE Minor spelling fixes in code comments, docs and output 2018-01-12 16:49:02 +02:00
CMakeLists.txt Merge 10.3 into 10.4 2021-04-14 10:33:59 +03:00
config.h.cmake Merge 10.3 into 10.4 2021-03-27 17:12:28 +02:00
configure.cmake Merge 10.3 into 10.4 2021-03-27 17:12:28 +02:00
CONTRIBUTING.md Add CONTRIBUTING file and modify README file about live QA regarding new contributors 2018-12-04 23:15:33 +04:00
COPYING Update FSF Address 2019-05-11 21:29:06 +03:00
CREDITS Update sponsors 2021-03-12 07:02:29 +11:00
EXCEPTIONS-CLIENT MDEV-5645 MariaDB-5.5.35 - references are made to an "EXCEPTIONS-CLIENT" file but it does not exist 2014-05-31 13:18:56 +02: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 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
THIRDPARTY Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
VERSION bump the VERSION 2021-02-22 10:04:25 -05:00

Code status:

  • Travis CI status travis-ci.org (10.4 branch)
  • Appveyor CI status ci.appveyor.com

MariaDB: drop-in replacement for MySQL

MariaDB is 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.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/library/new-and-old-releases/

https://mariadb.org/

As MariaDB is a full replacement of MySQL, the MySQL manual at http://dev.mysql.com/doc is generally applicable.

Help

More help is available from the Maria Discuss mailing list https://launchpad.net/~maria-discuss and the #maria IRC channel on Freenode.

Live QA for beginner contributors

MariaDB has a dedicated time each week when we answer new contributor questions live on Zulip and IRC. 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/

Bugs in the MySQL code can also be submitted at: https://bugs.mysql.com

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