From 11f3a8cfca83dd3b12a0add8df094c20e6a095c5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 10 Jan 2017 11:53:14 -0800 Subject: [PATCH] Force 'changes' to a string in hunk migration Summary: Fixes T12090. In obscure situations lost to the mists of time, the `changes` column could be `null`. Force a string cast so the migration finishes, even though these changesets are likely meaningless. Test Plan: I did a force-reapply as a sanity check: ``` $ ./bin/storage upgrade -f --apply phabricator:20161213.diff.01.hunks.php ``` That went cleanly; it would only have caught dramatic errors, but I didn't completely butcher things. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12090 Differential Revision: https://secure.phabricator.com/D17168 --- resources/sql/autopatches/20161213.diff.01.hunks.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/sql/autopatches/20161213.diff.01.hunks.php b/resources/sql/autopatches/20161213.diff.01.hunks.php index c6394defce..574adb3b4f 100644 --- a/resources/sql/autopatches/20161213.diff.01.hunks.php +++ b/resources/sql/autopatches/20161213.diff.01.hunks.php @@ -28,7 +28,8 @@ foreach (new LiskRawMigrationIterator($conn, $src_table) as $row) { DifferentialModernHunk::DATATYPE_TEXT, 'utf8', DifferentialModernHunk::DATAFORMAT_RAW, - $row['changes'], + // In rare cases, this could be NULL. See T12090. + (string)$row['changes'], $row['dateCreated'], $row['dateModified']); }