[Bast-commits] r9041 - in SQL-Abstract/1.x/trunk: . lib/SQL t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Tue Mar 23 21:50:09 GMT 2010


Author: ribasushi
Date: 2010-03-23 21:50:09 +0000 (Tue, 23 Mar 2010)
New Revision: 9041

Modified:
   SQL-Abstract/1.x/trunk/Changes
   SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm
   SQL-Abstract/1.x/trunk/t/01generate.t
Log:
ILIKE is common enough to be in core

Modified: SQL-Abstract/1.x/trunk/Changes
===================================================================
--- SQL-Abstract/1.x/trunk/Changes	2010-03-23 21:00:18 UTC (rev 9040)
+++ SQL-Abstract/1.x/trunk/Changes	2010-03-23 21:50:09 UTC (rev 9041)
@@ -1,5 +1,7 @@
 Revision history for SQL::Abstract
 
+    - Add ILIKE to the core list of comparision ops
+
 revision 1.62  2010-03-15 11:06 (UTC)
 ----------------------------
     - Fixed open outer parens for a multi-line literal

Modified: SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm
===================================================================
--- SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm	2010-03-23 21:00:18 UTC (rev 9040)
+++ SQL-Abstract/1.x/trunk/lib/SQL/Abstract.pm	2010-03-23 21:50:09 UTC (rev 9041)
@@ -84,7 +84,7 @@
 
   # generic SQL comparison operators
   my $anchored_cmp_ops = join ('|', map { '^' . $_ . '$' } (
-    '(?:is \s+)? (?:not \s+)? like',
+    '(?:is \s+)? (?:not \s+)? i? like',
     'is',
     (map { quotemeta($_) } (qw/ < > != <> = <= >= /) ),
   ));

Modified: SQL-Abstract/1.x/trunk/t/01generate.t
===================================================================
--- SQL-Abstract/1.x/trunk/t/01generate.t	2010-03-23 21:00:18 UTC (rev 9040)
+++ SQL-Abstract/1.x/trunk/t/01generate.t	2010-03-23 21:50:09 UTC (rev 9041)
@@ -262,13 +262,13 @@
       #29            
       {              
               func   => 'select',
-              args   => ['jeff', '*', { name => {'like', '%smith%', -not_in => ['Nate','Jim','Bob','Sally']},
+              args   => ['jeff', '*', { name => {'ilike', '%smith%', -not_in => ['Nate','Jim','Bob','Sally']},
                                        -nest => [ -or => [ -and => [age => { -between => [20,30] }, age => {'!=', 25} ],
                                                                    yob => {'<', 1976} ] ] } ],
               stmt   => 'SELECT * FROM jeff WHERE ( ( ( ( ( ( ( age BETWEEN ? AND ? ) AND ( age != ? ) ) ) OR ( yob < ? ) ) ) )'
-                      . ' AND name NOT IN ( ?, ?, ?, ? ) AND name LIKE ? )',
+                      . ' AND name NOT IN ( ?, ?, ?, ? ) AND name ILIKE ? )',
               stmt_q => 'SELECT * FROM `jeff` WHERE ( ( ( ( ( ( ( `age` BETWEEN ? AND ? ) AND ( `age` != ? ) ) ) OR ( `yob` < ? ) ) ) )'
-                      . ' AND `name` NOT IN ( ?, ?, ?, ? ) AND `name` LIKE ? )',
+                      . ' AND `name` NOT IN ( ?, ?, ?, ? ) AND `name` ILIKE ? )',
               bind   => [qw(20 30 25 1976 Nate Jim Bob Sally %smith%)]
       },             
       #30            




More information about the Bast-commits mailing list