[Rt-commit] rt branch, 4.4/columns-as-values-in-ticket-search, updated. rt-4.4.4-10-gdc3459510

? sunnavy sunnavy at bestpractical.com
Thu Jun 13 17:07:25 EDT 2019


The branch, 4.4/columns-as-values-in-ticket-search has been updated
       via  dc3459510fd9584fa102db2f4551167ae8f125c4 (commit)
      from  7f090c7154b484f6a24127a7f008502032cf1ac9 (commit)

Summary of changes:
 lib/RT/SearchBuilder.pm | 4 ++++
 1 file changed, 4 insertions(+)

- Log -----------------------------------------------------------------
commit dc3459510fd9584fa102db2f4551167ae8f125c4
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Jun 14 04:34:29 2019 +0800

    Cast columns when they are used to compare cf values for Pg
    
    This is to support comparing cf values(which are stored as varchar/text)
    with columns of other types like Owner.  Without this, Pg will error
    out:
    
        operator does not exist: character varying <> integer

diff --git a/lib/RT/SearchBuilder.pm b/lib/RT/SearchBuilder.pm
index 72afc64e9..1311b7f25 100644
--- a/lib/RT/SearchBuilder.pm
+++ b/lib/RT/SearchBuilder.pm
@@ -554,6 +554,10 @@ sub _LimitCustomField {
         my $type = $cf->Type;
 
         if ( !$args{QUOTEVALUE} ) {
+            if ( RT->Config->Get('DatabaseType') eq 'Pg' ) {
+                $value = "CAST($value as varchar)";
+            }
+
             if ( $type eq 'Date' ) {
                 $value = "SUBSTR($value, 1,  10)";
             }

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


More information about the rt-commit mailing list