From e8da51a5740e17a85278e225bc6428e55842b5a4 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 20 Jul 2009 02:20:15 +0000 Subject: [PATCH] Add standardSelectDistinct() function to help fork queries based on whether the order by items must appear in the select distinct list. See bug 18078. --- includes/db/Database.php | 8 ++++++++ includes/db/DatabaseMysql.php | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/includes/db/Database.php b/includes/db/Database.php index b05a6a99bf..c505161521 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -192,6 +192,14 @@ abstract class DatabaseBase { return true; } + /** + * Returns true if this database requires that SELECT DISTINCT queries require that all + ORDER BY expressions occur in the SELECT list per the SQL92 standard + */ + function standardSelectDistinct() { + return true; + } + /** * Returns true if this database can do a native search on IP columns * e.g. this works as expected: .. WHERE rc_ip = '127.42.12.102/32'; diff --git a/includes/db/DatabaseMysql.php b/includes/db/DatabaseMysql.php index 31de6309c7..e985854353 100644 --- a/includes/db/DatabaseMysql.php +++ b/includes/db/DatabaseMysql.php @@ -289,6 +289,10 @@ class DatabaseMysql extends DatabaseBase { return '[http://www.mysql.com/ MySQL]'; } + function standardSelectDistinct() { + return false; + } + /** * @return String: Database type for use in messages */ -- 2.20.1