[Rt-commit] rt branch, 4.4/update-tests-for-null-order-in-pg, created. rt-4.4.4-514-g602d451fdf

? sunnavy sunnavy at bestpractical.com
Fri Jun 4 17:41:07 EDT 2021


The branch, 4.4/update-tests-for-null-order-in-pg has been created
        at  602d451fdffd1c5a2e44992e2c3df229dab2fa6e (commit)

- Log -----------------------------------------------------------------
commit 602d451fdffd1c5a2e44992e2c3df229dab2fa6e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Jun 5 05:38:11 2021 +0800

    Update tests for Pg as NULL values are sorted differently
    
    Unlike other db types, Pg regards NULL as the biggest value.

diff --git a/t/ticket/sort-by-user.t b/t/ticket/sort-by-user.t
index bde06d2ef3..6c6ea27f4a 100644
--- a/t/ticket/sort-by-user.t
+++ b/t/ticket/sort-by-user.t
@@ -142,8 +142,11 @@ ok( $ret, "Added CF value 'Foo' to users[0]: $msg" );
 ( $ret, $msg ) = $users[1]->AddCustomFieldValue( Field => $cf, Value => 'Foo' );
 ok( $ret, "Added CF value 'Bar' to users[1]: $msg" );
 
+# In Pg, null values sort as if larger than any non-null value by default
+my $null_subject = RT->Config->Get('DatabaseType') eq 'Pg' ? 'zzz' : '-';
+
 @data = (
-    { Subject => '-' },
+    { Subject => $null_subject },
     { Subject => 'Z', Owner => $uids[1] },
     { Subject => 'A', Owner => $uids[0] },
 );
@@ -164,7 +167,7 @@ ok( $ret, "Created custom role: $msg" );
 ok( $ret, "Added CR to queue: $msg" );
 
 @data = (
-    { Subject => '-' },
+    { Subject => $null_subject },
     { Subject => 'Z', $cr->GroupType => $uids[1] },
     { Subject => 'A', $cr->GroupType => $uids[0] },
 );

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


More information about the rt-commit mailing list