MINOR: groupby works for SQLite too

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97985 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andreas Piening 2010-02-02 02:58:18 +00:00 committed by Sam Minnee
parent cce52a59d2
commit 15e98877f5

View File

@ -2569,7 +2569,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
if($join) { if($join) {
$query->from[] = $join; $query->from[] = $join;
if(DB::getConn() instanceof MySQLDatabase) { if(DB::getConn() instanceof MySQLDatabase || DB::getConn() instanceof SQLite3Database) {
// TODO: This needs to be resolved for all databases // TODO: This needs to be resolved for all databases
$query->groupby[] = reset($query->from) . ".\"ID\""; $query->groupby[] = reset($query->from) . ".\"ID\"";
/* this needs to be fixed - this doesn't work when you add additional fields from other tables into the mix. /* this needs to be fixed - this doesn't work when you add additional fields from other tables into the mix.