[Rt-commit] rt branch, 4.2/oracle-upgrade-empty-clob, created. rt-4.2.7-7-g78d5994
Alex Vandiver
alexmv at bestpractical.com
Wed Oct 1 15:42:22 EDT 2014
The branch, 4.2/oracle-upgrade-empty-clob has been created
at 78d5994edab8d8f3386728c682001dd495798e5f (commit)
- Log -----------------------------------------------------------------
commit 78d5994edab8d8f3386728c682001dd495798e5f
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.
Fixes I#30391.
diff --git a/etc/upgrade/4.2.7/content b/etc/upgrade/4.2.7/content
index 78a21a4..e828cc7 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..64b61de
--- /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