@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix binary/utf8 issues with Differential changeset parse cache

Summary:
Fixes T4898. After we increased the strictness of the `%s` conversion, most `serialize()` output is rejected from the cache.

Drop the cache, change the column type to latin1_bin, and then use `%B` to mark the data as binary during query construction.

Test Plan: Viewed Differential, saw cache fills.

Reviewers: btrahan, spicyj

Reviewed By: spicyj

Subscribers: epriestley

Maniphest Tasks: T4898

Differential Revision: https://secure.phabricator.com/D9171

+9 -8
+4
resources/sql/autopatches/20140517.dxbinarycache.sql
··· 1 + TRUNCATE {$NAMESPACE}_differential.differential_changeset_parse_cache; 2 + 3 + ALTER TABLE {$NAMESPACE}_differential.differential_changeset_parse_cache 4 + CHANGE cache cache LONGTEXT COLLATE latin1_bin NOT NULL;
+5 -8
src/applications/differential/parser/DifferentialChangesetParser.php
··· 352 352 return; 353 353 } 354 354 355 - try { 356 - $changeset = new DifferentialChangeset(); 357 - $conn_w = $changeset->establishConnection('w'); 355 + $changeset = new DifferentialChangeset(); 356 + $conn_w = $changeset->establishConnection('w'); 358 357 359 - $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 358 + $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 360 359 queryfx( 361 360 $conn_w, 362 - 'INSERT INTO %T (id, cache, dateCreated) VALUES (%d, %s, %d) 361 + 'INSERT INTO %T (id, cache, dateCreated) VALUES (%d, %B, %d) 363 362 ON DUPLICATE KEY UPDATE cache = VALUES(cache)', 364 363 DifferentialChangeset::TABLE_CACHE, 365 364 $render_cache_key, 366 365 $cache, 367 366 time()); 368 - } catch (AphrontQueryException $ex) { 369 - // TODO: uhoh 370 - } 367 + unset($unguarded); 371 368 } 372 369 373 370 private function markGenerated($new_corpus_block = '') {