From: Greg Sabino Mullane Date: Mon, 20 Jul 2009 02:20:15 +0000 (+0000) Subject: Add standardSelectDistinct() function to help fork queries based on whether the order... X-Git-Tag: 1.31.0-rc.0~40812 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=e8da51a5740e17a85278e225bc6428e55842b5a4;p=lhc%2Fweb%2Fwiklou.git Add standardSelectDistinct() function to help fork queries based on whether the order by items must appear in the select distinct list. See bug 18078. --- 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 */