r13987 - in /trunk/libclass-dbi-plugin-abstractcount-perl: AbstractCount.pm Changes META.yml debian/changelog t/03sql.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Fri Feb 1 17:12:15 UTC 2008


Author: gregoa-guest
Date: Fri Feb  1 17:12:14 2008
New Revision: 13987

URL: http://svn.debian.org/wsvn/?sc=1&rev=13987
Log:
New upstream release.

Modified:
    trunk/libclass-dbi-plugin-abstractcount-perl/AbstractCount.pm
    trunk/libclass-dbi-plugin-abstractcount-perl/Changes
    trunk/libclass-dbi-plugin-abstractcount-perl/META.yml
    trunk/libclass-dbi-plugin-abstractcount-perl/debian/changelog
    trunk/libclass-dbi-plugin-abstractcount-perl/t/03sql.t

Modified: trunk/libclass-dbi-plugin-abstractcount-perl/AbstractCount.pm
URL: http://svn.debian.org/wsvn/trunk/libclass-dbi-plugin-abstractcount-perl/AbstractCount.pm?rev=13987&op=diff
==============================================================================
--- trunk/libclass-dbi-plugin-abstractcount-perl/AbstractCount.pm (original)
+++ trunk/libclass-dbi-plugin-abstractcount-perl/AbstractCount.pm Fri Feb  1 17:12:14 2008
@@ -5,7 +5,7 @@
 use base 'Class::DBI::Plugin';
 use SQL::Abstract;
 
-our $VERSION = '0.06';
+our $VERSION = '0.07';
 
 sub init
 {
@@ -44,15 +44,22 @@
   }
 
   COLUMN: for my $column ( keys %where ) {
+    # Column names are (of course) OK
     next COLUMN if exists $columns{ $column };
+
+    # Accessor names are OK, but replace them with corresponding column name
     $where{ $accessors{ $column }} = delete $where{ $column }, next COLUMN
       if exists $accessors{ $column };
 
+    # SQL::Abstract keywords are OK
+    next COLUMN
+      if $column =~ /^-(?:and|or|nest|(?:(not_)?(?:like|between)))$/;
+
     # Check for functions
-    if ( index( $column, '(' )
-      && index( $column, ')' ))
+    if ( index( $column, '(' ) > 0
+      && index( $column, ')' ) > 1 )
     {
-      my @tokens = ( $column =~ /(\w+(?:\s*\(\s*)?|\W+)/g );
+      my @tokens = ( $column =~ /(-?\w+(?:\s*\(\s*)?|\W+)/g );
       TOKEN: for my $token ( @tokens ) {
         if ( $token !~ /\W/ ) { # must be column or accessor name
           next TOKEN if exists $columns{ $token };

Modified: trunk/libclass-dbi-plugin-abstractcount-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libclass-dbi-plugin-abstractcount-perl/Changes?rev=13987&op=diff
==============================================================================
--- trunk/libclass-dbi-plugin-abstractcount-perl/Changes (original)
+++ trunk/libclass-dbi-plugin-abstractcount-perl/Changes Fri Feb  1 17:12:14 2008
@@ -1,5 +1,9 @@
 Revision history for Perl extension Class::DBI::Plugin::AbstractCount.
 
+0.07  Wed Jun 14 11:04:00 2006
+	- fixed check for SQL-functions
+	- added support for SQL::Abstract keywords (-and, -or, etc.)
+	- added two more tests (to check keyword issue)
 0.06  Mon Aug 22 16:54:00 2005
 	- fixed function-call-on-column-in-where-clause issue
 	- added eight more tests (to check function call issue)

Modified: trunk/libclass-dbi-plugin-abstractcount-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libclass-dbi-plugin-abstractcount-perl/META.yml?rev=13987&op=diff
==============================================================================
--- trunk/libclass-dbi-plugin-abstractcount-perl/META.yml (original)
+++ trunk/libclass-dbi-plugin-abstractcount-perl/META.yml Fri Feb  1 17:12:14 2008
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Class-DBI-Plugin-AbstractCount
-version:      0.06
+version:      0.07
 version_from: AbstractCount.pm
 installdirs:  site
 requires:
@@ -10,4 +10,4 @@
     SQL::Abstract:                 1.1
 
 distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+generated_by: ExtUtils::MakeMaker version 6.30

Modified: trunk/libclass-dbi-plugin-abstractcount-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libclass-dbi-plugin-abstractcount-perl/debian/changelog?rev=13987&op=diff
==============================================================================
--- trunk/libclass-dbi-plugin-abstractcount-perl/debian/changelog (original)
+++ trunk/libclass-dbi-plugin-abstractcount-perl/debian/changelog Fri Feb  1 17:12:14 2008
@@ -1,5 +1,6 @@
-libclass-dbi-plugin-abstractcount-perl (0.06-2) UNRELEASED; urgency=low
+libclass-dbi-plugin-abstractcount-perl (0.07-1) UNRELEASED; urgency=low
 
+  [ Damyan Ivanov ]
   * Take over for the Debian Perl Group on maintainer's
     request
     http://lists.debian.org/debian-perl/2008/01/msg00262.html
@@ -11,7 +12,10 @@
     <ben at decadentplace.org.uk> moved to Uploaders.
   * Add debian/watch.
 
- -- Damyan Ivanov <dmn at debian.org>  Sat, 26 Jan 2008 10:10:46 +0200
+  [ gregor herrmann ]
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Fri, 01 Feb 2008 18:11:04 +0100
 
 libclass-dbi-plugin-abstractcount-perl (0.06-1) unstable; urgency=low
 

Modified: trunk/libclass-dbi-plugin-abstractcount-perl/t/03sql.t
URL: http://svn.debian.org/wsvn/trunk/libclass-dbi-plugin-abstractcount-perl/t/03sql.t?rev=13987&op=diff
==============================================================================
--- trunk/libclass-dbi-plugin-abstractcount-perl/t/03sql.t (original)
+++ trunk/libclass-dbi-plugin-abstractcount-perl/t/03sql.t Fri Feb  1 17:12:14 2008
@@ -2,7 +2,7 @@
 # vim:set tabstop=2 shiftwidth=2 expandtab syn=perl:
 use strict;
 
-use Test::More tests => 18;
+use Test::More tests => 20;
 
 $main::sql = "";
 
@@ -168,4 +168,24 @@
                           , 'Adrian Belew'
                           ], 'bind param list 9' );
 
+# Test complex where-clause
+( @bind_params ) = __PACKAGE__->count_search_where(
+  -and => [ artist => 'System Of A Down'
+          , -nest  => [ -and => [ title   => { like => '%ize' }
+                                , release => 2005
+                                ]
+                      , -and => [ title   => { like => '%ize' }
+                                , release => 2006
+                                ]
+                      ]
+          ] );
+like( $main::sql, qr/SELECT COUNT\(\*\)\nFROM __TABLE__\nWHERE \( \( \( artist = \? \) AND \( \( \( \( \( title LIKE \? \) AND \( release = \? \) \) \) OR \( \( \( title LIKE \? \) AND \( release = \? \) \) \) \) \) \) \)\n/i
+  , 'sql statement 10'
+  );
+is_deeply( \@bind_params, [ 'System Of A Down'
+                          , '%ize'
+                          , 2005
+                          , '%ize'
+                          , 2006
+                          ], 'bind param list 10' );
 __END__




More information about the Pkg-perl-cvs-commits mailing list