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 476b24d084 MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result
SELECT DISTINCT did not work with expressions with sum functions.
Distinct was only done on the values stored in the intermediate temporary
tables, which only stored the value of each sum function.

In other words:
SELECT DISTINCT sum(a),sum(b),avg(c) ... worked.
SELECT DISTINCT sum(a),sum(b) > 2,sum(c)+sum(d) would not work.

The later query would do ONLY apply distinct on the sum(a) part.

Reviewer: Sergei Petrunia <sergey@mariadb.com>


This was fixed by extending remove_dup_with_hash_index() and
remove_dup_with_compare() to take into account the columns in the result
list that where not stored in the temporary table.

Note that in many cases the above dup removal functions are not used as
the optimizer may be able to either remove duplicates early or it will
discover that duplicate remove is not needed. The later happens for
example if the group by fields is part of the result.

Other things:
- Backported from 11.0 the change of Sort_param.tmp_buffer from char* to
  String.
- Changed Type_handler::make_sort_key() to take String as a parameter
  instead of Sort_param. This was done to allow make_sort_key() functions
  to be reused by distinct elimination functions.
  This makes Type_handler_string_result::make_sort_key() similar to code
  in 11.0
- Simplied error handling in remove_dup_with_compare() to remove code
  duplication.
2023-02-17 16:08:50 +02:00
BUILD Merge 10.3 into 10.4 2022-12-13 11:37:33 +02:00
client MDBF-534: Coverity scan: fix client folder 2023-02-17 13:43:43 +00:00
cmake Merge branch '10.3' into 10.4 2023-01-28 18:22:55 +01:00
dbug Minimize unsafe C functions usage - replace strcat() and strcpy() (and strncat() and strncpy()) with custom safe_strcat() and safe_strcpy() functions 2023-01-20 15:18:52 +02:00
debian Merge 10.3 into 10.4 2023-01-03 16:10:02 +02:00
Docs Merge 10.3 into 10.4 2022-09-23 13:47:15 +03:00
extra Add more workaround atop existing WolfSSL 5.5.4 workaround to compile ASAN on buildbot 2023-02-08 11:32:06 +01:00
include include/ssl_compat.h: fix build with libressl >= 3.5.0 2023-02-17 11:24:53 +00:00
libmariadb@d204e83104 New CC 3.1 2023-01-16 14:59:59 +01:00
libmysqld Merge 10.3 into 10.4 2022-12-13 11:37:33 +02:00
libservices Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
man Merge 10.3 into 10.4 2022-11-08 16:04:01 +02:00
mysql-test MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result 2023-02-17 16:08:50 +02:00
mysys MDEV-30556 UPPER() returns an empty string for U+0251 in Unicode-5.2.0+ collations for utf8 2023-02-03 18:18:32 +04:00
mysys_ssl Apply clang-tidy to remove empty constructors / destructors 2023-02-09 16:09:08 +02:00
pcre Merge branch '10.2' into 10.3 2021-07-29 13:51:02 +02:00
plugin Apply clang-tidy to remove empty constructors / destructors 2023-02-09 16:09:08 +02:00
randgen/conf Group commit for maria engine. 2010-02-12 15:12:28 +02:00
scripts Update 10.3 HELP tables 2023-01-24 11:28:19 +11:00
sql MDEV-20057 Distinct SUM on CROSS JOIN and grouped returns wrong result 2023-02-17 16:08:50 +02:00
sql-bench Merge 10.2 into 10.3 2020-07-02 06:17:51 +03:00
sql-common MDEV-11853: semisync thread can be killed after sync binlog but before ACK in the sync state 2022-04-22 12:59:54 -06:00
storage MDEV-30615 Can't read from I_S.INNODB_SYS_INDEXES when having a discarded tablesace 2023-02-16 16:04:46 +05:30
strings MDEV-30556 UPPER() returns an empty string for U+0251 in Unicode-5.2.0+ collations for utf8 2023-02-03 18:18:32 +04:00
support-files MDEV-29814: galera_var_notify_ssl_ipv6 causes testing system to hang 2022-12-10 01:11:55 +01:00
tests Merge 10.3 into 10.4 2022-10-25 10:04:37 +03:00
unittest MDEV-27670 Assertion `(cs->state & 0x20000) == 0' failed in my_strnncollsp_nchars_generic_8bit 2022-11-22 14:03:23 +04:00
vio Merge branch '10.3' into 10.4 2022-10-26 14:55:47 +02:00
win MDEV-30624 HeidiSQL 12.3 2023-02-09 11:28:55 +01:00
wsrep-lib@275a0af8c5 MDEV-30419 Fix unhandled exception thrown from wsrep-lib 2023-01-19 14:55:50 +02:00
zlib zlib: remove redundant and generated files 2022-07-26 16:46:27 +02:00
.clang-format .clang-format - do not sort include files. 2019-12-03 22:22:23 +01:00
.gitattributes MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
.gitignore Merge branch '10.3' into 10.4 2022-05-08 23:03:08 +02:00
.gitlab-ci.yml Backport GitLab CI to earlier branches 2023-02-15 08:51:49 +00:00
.gitmodules Merge 10.3 into 10.4 2023-01-03 16:10:02 +02:00
appveyor.yml Fix typo in appveyor.yml 2022-07-04 19:24:58 +02:00
BUILD-CMAKE Minor spelling fixes in code comments, docs and output 2018-01-12 16:49:02 +02:00
CMakeLists.txt MDEV-29613 Improve WITH_DBUG_TRACE=OFF 2022-09-23 13:40:42 +03:00
config.h.cmake Merge 10.3 into 10.4 2022-10-11 15:18:49 +03:00
configure.cmake Remove HAVE_SNPRINTF 2022-10-05 10:09:49 +03: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 CREDITS: re-instate Tencent Cloud 2023-01-25 16:44:26 +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 Merge 10.3 into 10.4 2021-06-21 12:38:25 +03:00
THIRDPARTY Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
VERSION bump the VERSION 2023-02-06 09:34:19 -05:00

Code status:

  • 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