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
Neeraj Bisht 0e787b245b Bug#11751794 MYSQL GIVES THE WRONG RESULT WITH SOME SPECIAL USAGE
Consider the following query:

SELECT f_1,..,f_m, AGGREGATE_FN(C)
FROM t1
WHERE ...
GROUP BY ...

Loose index scan ("Using index for group-by") can be used for
this query if there is an index 'i' covering all fields in the
select list, and the GROUP BY clause makes up a prefix f1,...,fn
of 'i'. Furthermore, according to rule NGA2 of
get_best_group_min_max(), the WHERE clause must contain a
conjunction of equality predicates for all fields fn+1,...,fm.

The problem in this bug was that a query with WHERE clause that
broke NGA2 was not detected and therefore used loose index scan.
This lead to wrong result. The query had an index
covering (c1,c2) and had:
  "WHERE (c1 = 1 AND c2 = 'a') OR (c1 = 2 AND c2 = 'b')
   GROUP BY c1"
or 
  "WHERE (c1 = 1 ) OR (c1 = 2 AND c2 = 'b')
   GROUP BY c1"


This WHERE clause cannot be transformed to a conjunction of
equality predicates.

The solution is to introduce another rule, NGA3, that complements
NGA2. NGA3 says that if a gap field (field between those
listed in GROUP BY and C in the index) has a predicate, then
there can only be one range in the query. This requirement is
more strict than it has to be in theory. BUG 15947433 will deal
with that.
2013-01-16 15:03:42 +05:30
.bzr-mysql
BitKeeper
BUILD Updated/added copyright headers 2011-06-30 17:37:13 +02:00
client BUG#11757250: REPLACE(...) INSIDE A STORED PROCEDURE. 2013-01-12 11:13:37 +05:30
cmd-line-utils Fixes required to build on AIX 2012-01-11 18:40:29 +01:00
config/ac-macros Bug#15883127: PORT FIX FOR BUG #13904906 TO MYSQL 5.1 2012-11-21 19:12:20 +05:30
dbug Merge 2010-12-29 00:47:05 +01:00
Docs INSTALL-BINARY placeholder: change invalid URLs (request from Kristofer) 2012-07-31 20:41:46 +02:00
extra Bug#15965288: BUFFER OVERFLOW IN YASSL FUNCTION 2012-12-13 10:17:26 +05:30
include BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO 2013-01-14 14:59:48 +05:30
libmysql Bug#14840488 VALGRIND ERRORS IN MYSQL_CLIENT_TEST 2012-11-01 17:23:06 +01:00
libmysql_r
libmysqld Merge unpushed changes from 5.1.64-release 2012-07-12 10:00:14 +02:00
man Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mysql-test Bug#11760726: LEFT JOIN OPTIMIZED INTO JOIN LEADS TO 2013-01-10 16:17:13 +05:30
mysys Bug#16066243 PB2 FAILURES I_MAIN.BUG15912213 AND 2013-01-07 16:16:08 +05:30
netware
plugin Updated/added copyright headers 2011-07-03 17:47:37 +02:00
regex BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO 2013-01-14 14:59:48 +05:30
scripts Bug#16046140 BIN/MYSQLD_SAFE: TEST: ARGUMENT EXPECTED 2012-12-27 17:33:34 +05:30
server-tools Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql Bug#11751794 MYSQL GIVES THE WRONG RESULT WITH SOME SPECIAL USAGE 2013-01-16 15:03:42 +05:30
sql-bench Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sql-common Bug #13708485: malformed resultset packet crashes client 2012-06-28 18:38:55 +03:00
storage Bug#11758009 - UNION EXECUTION ORDER WRONG ? 2013-01-15 14:24:35 +05:30
strings BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO 2013-01-14 14:59:48 +05:30
support-files Spec file change to work around cast ulonglong -> int. 2012-09-11 12:47:32 +02:00
tests Bug#14840488 VALGRIND ERRORS IN MYSQL_CLIENT_TEST 2012-11-01 17:23:06 +01:00
unittest Updated/added copyright headers 2012-02-15 17:21:38 +01:00
vio Bug #13115401: -SSL-KEY VALUE IS NOT VALIDATED AND IT ALLOWS INSECURE 2012-08-11 15:43:04 +05:30
win Updated/added copyright headers 2011-07-03 17:47:37 +02:00
zlib
.bzrignore Bug#12361113: CRASH WHEN "LOAD INDEX INTO CACHE" WITH TOO 2011-12-12 14:07:02 +01:00
.cvsignore
CMakeLists.txt Bug #14035452 - MODULARIZE MYSQL_CLIENT_TEST 2012-07-19 12:57:36 +02:00
configure.in Raise version number after cloning 5.1.68 2013-01-08 12:42:36 +01:00
COPYING
INSTALL-SOURCE
INSTALL-WIN-SOURCE
Makefile.am Reverting broken configure/make stuff 2012-07-19 15:55:41 +02:00
README Updated README and client executables copyright year to 2013 2013-01-01 03:33:40 +01:00

MySQL Server 5.1

This is a release of MySQL, a dual-license SQL database server.
For the avoidance of doubt, this particular copy of the software 
is released under the version 2 of the GNU General Public License. 
MySQL is brought to you by Oracle.

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

License information can be found in the COPYING file.

MySQL FOSS License Exception
We want free and open source software applications under certain
licenses to be able to use specified GPL-licensed MySQL client
libraries despite the fact that not all such FOSS licenses are
compatible with version 2 of the GNU General Public License.  
Therefore there are special exceptions to the terms and conditions 
of the GPLv2 as applied to these client libraries, which are 
identified and described in more detail in the FOSS License 
Exception at 
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.

This distribution may include materials developed by third
parties. For license and attribution notices for these
materials, please refer to the documentation that accompanies
this distribution (see the "Licenses for Third-Party Components"
appendix) or view the online documentation at 
<http://dev.mysql.com/doc/>.

GPLv2 Disclaimer
For the avoidance of doubt, except that if any license choice
other than GPL or LGPL is available it will apply instead, 
Oracle elects to use only the General Public License version 2 
(GPLv2) at this time for any software where a choice of GPL 
license versions is made available with the language indicating 
that GPLv2 or any later version may be used, or where a choice 
of which version of the GPL is applied is otherwise unspecified.

For further information about MySQL or additional documentation, 
see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http://dev.mysql.com/doc

Some Reference Manual sections of special interest:
- If you are migrating from an older version of MySQL, please 
  read the "Upgrading from..." section.
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installing and Upgrading
  chapter.
- For the new features/bugfix history, see the MySQL Change History 
  appendix.

You can browse the MySQL Reference Manual online or download it 
in any of several formats at the URL given earlier in this file.
Source distributions include a local copy of the manual in the
Docs directory.