[Bast-commits] r5778 - DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat

robkinyon at dev.catalyst.perl.org robkinyon at dev.catalyst.perl.org
Thu Mar 19 20:52:54 GMT 2009


Author: robkinyon
Date: 2009-03-19 20:52:54 +0000 (Thu, 19 Mar 2009)
New Revision: 5778

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Retrieve.pm
Log:
Commit another fix for arcanez to test

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Retrieve.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Retrieve.pm	2009-03-19 20:49:39 UTC (rev 5777)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/CDBICompat/Retrieve.pm	2009-03-19 20:52:54 UTC (rev 5778)
@@ -50,15 +50,24 @@
 
   $cond =~ s/^\s*WHERE//i;
 
-  if( $cond =~ s/\bLIMIT (\d+)\s*$//i ) {
-      push @rest, { rows => $1 };
+  # Need to parse the SQL clauses after WHERE in reverse
+  # order of appearance.
+
+  my %attrs;
+
+  if( $cond =~ s/\bLIMIT\s+(\d+)\s*$//i ) {
+      $attrs{rows} = $1;
   }
 
-  if ( $cond =~ s/\bORDER\s+BY\s+(.*)$//i ) {
-    push @rest, { order_by => $1 };
+  if ( $cond =~ s/\bORDER\s+BY\s+(.*)\s*$//i ) {
+      $attrs{order_by} = $1;
   }
 
-  return $class->search_literal($cond, @rest);
+  if( $cond =~ s/\bGROUP\s+BY\s+(.*)\s*$//i ) {
+      $attrs{group_by} = $1;
+  }
+
+  return $class->search_literal($cond, ( %attrs || () ) );
 }
 
 sub construct {




More information about the Bast-commits mailing list