diff --git a/resources/sql/autopatches/20140517.dxbinarycache.sql b/resources/sql/autopatches/20140517.dxbinarycache.sql new file mode 100644 index 0000000000..acf7162b65 --- /dev/null +++ b/resources/sql/autopatches/20140517.dxbinarycache.sql @@ -0,0 +1,4 @@ +TRUNCATE {$NAMESPACE}_differential.differential_changeset_parse_cache; + +ALTER TABLE {$NAMESPACE}_differential.differential_changeset_parse_cache + CHANGE cache cache LONGTEXT COLLATE latin1_bin NOT NULL; diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php index 637b3ac363..c437ee43f2 100644 --- a/src/applications/differential/parser/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/DifferentialChangesetParser.php @@ -352,22 +352,19 @@ final class DifferentialChangesetParser { return; } - try { - $changeset = new DifferentialChangeset(); - $conn_w = $changeset->establishConnection('w'); + $changeset = new DifferentialChangeset(); + $conn_w = $changeset->establishConnection('w'); - $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); + $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); queryfx( $conn_w, - 'INSERT INTO %T (id, cache, dateCreated) VALUES (%d, %s, %d) + 'INSERT INTO %T (id, cache, dateCreated) VALUES (%d, %B, %d) ON DUPLICATE KEY UPDATE cache = VALUES(cache)', DifferentialChangeset::TABLE_CACHE, $render_cache_key, $cache, time()); - } catch (AphrontQueryException $ex) { - // TODO: uhoh - } + unset($unguarded); } private function markGenerated($new_corpus_block = '') {