From: Peter Rabbitson Date: Wed, 18 Dec 2013 13:25:05 +0000 (+0100) Subject: Make it clearer in examples that bool takes expressions X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23401b818b099397e04df91b43340ecd59e8f92b;p=scpubgit%2FQ-Branch.git Make it clearer in examples that bool takes expressions timbunce++ --- diff --git a/Changes b/Changes index cbe7d4b..3e8ae4b 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,7 @@ Revision history for SQL::Abstract - Fix false negative comparison of ORDER BY ASC - More improvements of incorrect parsing (literal at end of list elt) - Fix typos in POD and comments (RT#87776) + - Augment -not_bool example with nesting (RT#89601) revision 1.74 2013-06-04 ---------------------------- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index f325978..d017b85 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -2310,15 +2310,19 @@ then you should use the and/or operators:- my %where = ( -and => [ -bool => 'one', - -bool => 'two', - -bool => 'three', - -not_bool => 'four', + -not_bool => { two=> { -rlike => 'bar' } }, + -not_bool => { three => [ { '=', 2 }, { '>', 5 } ] }, ], ); Would give you: - WHERE one AND two AND three AND NOT four + WHERE + one + AND + (NOT two RLIKE ?) + AND + (NOT ( three = ? OR three > ? )) =head2 Nested conditions, -and/-or prefixes