[Rt-commit] rt branch, 4.2/oracle-upgrade-empty-clob, created. rt-4.2.7-7-g98666ee

Alex Vandiver alexmv at bestpractical.com
Mon Sep 15 15:46:05 EDT 2014


The branch, 4.2/oracle-upgrade-empty-clob has been created
        at  98666ee07158f7b3f4fc70cc0726fb851d1506b1 (commit)

- Log -----------------------------------------------------------------
commit 98666ee07158f7b3f4fc70cc0726fb851d1506b1
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Sep 15 15:37:54 2014 -0400

    Fix the 4.2.7 upgrade to run on Oracle (and copy to 4.2.8)
    
    The "Content" column of the Attributes table is a CLOB column on Oracle;
    this makes it impossible to use the '=' operator on it.  Instead, check
    the length of the contents, which works across databases and column
    types.
    
    The upgrade step is copied to 4.2.8, though only enabled on Oracle, to
    catch those users who upgraded to 4.2.6 and for whom the upgrade step
    errored out.  For Oracle users who upgrade from before 4.2.6 up to
    4.2.8, the 4.2.8 step will be a no-op.

diff --git a/etc/upgrade/4.2.7/content b/etc/upgrade/4.2.7/content
index 78a21a4..e94aa33 100644
--- a/etc/upgrade/4.2.7/content
+++ b/etc/upgrade/4.2.7/content
@@ -9,7 +9,7 @@ our @Initial = (
         RT->DatabaseHandle->dbh->do(<<EOSQL);
             DELETE FROM Attributes
              WHERE (Name = 'LinkValueTo' OR Name = 'IncludeContentForValue')
-               AND (Content = '' OR Content IS NULL);
+               AND (LENGTH(Content) = 0 OR Content IS NULL);
 EOSQL
     },
 );
diff --git a/etc/upgrade/4.2.8/content b/etc/upgrade/4.2.8/content
new file mode 100644
index 0000000..0b643bd
--- /dev/null
+++ b/etc/upgrade/4.2.8/content
@@ -0,0 +1,16 @@
+use strict;
+use warnings;
+
+our @Initial = (
+    sub {
+        # This upgrade step is identical to the 4.2.7 upgrade, but only
+        # runs on Oracle because 4.2.7 was originally released with
+        # flawed SQL which did not run on Oracle.
+        return unless RT->Config->Get('DatabaseType') eq 'Oracle';
+        RT->DatabaseHandle->dbh->do(<<EOSQL);
+            DELETE FROM Attributes
+             WHERE (Name = 'LinkValueTo' OR Name = 'IncludeContentForValue')
+               AND (LENGTH(Content) = 0 OR Content IS NULL);
+EOSQL
+    },
+);

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


More information about the rt-commit mailing list