[Rt-commit] rt branch, 4.0/case-insensitive-null, created. rt-4.0.8-17-g6d9a25d

? sunnavy sunnavy at bestpractical.com
Wed Oct 31 12:11:46 EDT 2012


The branch, 4.0/case-insensitive-null has been created
        at  6d9a25d3c8c9d3dfc0df241579e7e4eca406265a (commit)

- Log -----------------------------------------------------------------
commit 6ec04b549b4716b192c4b11490567204e16a872b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 1 00:01:13 2012 +0800

    make "NULL" case insensitive in sql

diff --git a/lib/RT/SQL.pm b/lib/RT/SQL.pm
index 22def26..15ee50b 100644
--- a/lib/RT/SQL.pm
+++ b/lib/RT/SQL.pm
@@ -69,7 +69,7 @@ my @tokens = qw[VALUE AGGREGATOR OPERATOR OPEN_PAREN CLOSE_PAREN KEYWORD];
 use Regexp::Common qw /delimited/;
 my $re_aggreg      = qr[(?i:AND|OR)];
 my $re_delim       = qr[$RE{delimited}{-delim=>qq{\'\"}}];
-my $re_value       = qr[[+-]?\d+|NULL|$re_delim];
+my $re_value       = qr[[+-]?\d+|(?i:NULL)|$re_delim];
 my $re_keyword     = qr[[{}\w\.]+|$re_delim];
 my $re_op          = qr[=|!=|>=|<=|>|<|(?i:IS NOT)|(?i:IS)|(?i:NOT LIKE)|(?i:LIKE)|(?i:NOT STARTSWITH)|(?i:STARTSWITH)|(?i:NOT ENDSWITH)|(?i:ENDSWITH)]; # long to short
 my $re_open_paren  = qr[\(];

commit 6d9a25d3c8c9d3dfc0df241579e7e4eca406265a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Nov 1 00:10:44 2012 +0800

    test for lower cased null

diff --git a/t/ticket/search.t b/t/ticket/search.t
index fd0a7e0..1eee12b 100644
--- a/t/ticket/search.t
+++ b/t/ticket/search.t
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodata => 1, tests => 43;
+use RT::Test nodata => 1, tests => 44;
 
 # setup the queue
 
@@ -276,3 +276,7 @@ $tix = RT::Tickets->new(RT->SystemUser);
 $tix->FromSQL("CF.SearchTest = 'foo1' OR CF.SearchTest = 'foo3' OR CF.SearchTest2 = 'bar1' OR CF.SearchTest2 = 'bar2'");
 is($tix->Count, 3, "is cf1 or is cf1 or is cf2 or is cf2");
 
+# tests with lower cased NULL
+$tix = RT::Tickets->new(RT->SystemUser);
+$tix->FromSQL('Requestor.Name IS null');
+is($tix->Count, 1, "t6 doesn't have a Requestor");

-----------------------------------------------------------------------


More information about the Rt-commit mailing list