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
# 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/ < > != <> = <= >= /) ),
));
#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