@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 the type of some values passed to MySQL

Summary: Ref T3377. MySQL ignores indexes if we hand it mismatched datatypes. This seems colossally dumb, but give it what it expects.

Test Plan: wat

Reviewers: wez, btrahan

Reviewed By: wez

CC: aran

Maniphest Tasks: T3377

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

+9 -6
+5 -2
src/applications/diffusion/query/DiffusionCommitQuery.php
··· 144 144 } 145 145 $sql[] = qsprintf( 146 146 $conn_r, 147 - '(repositoryID = %d AND commitIdentifier = %d)', 147 + '(repositoryID = %d AND commitIdentifier = %s)', 148 148 $repo->getID(), 149 - $ref['identifier']); 149 + // NOTE: Because the 'commitIdentifier' column is a string, MySQL 150 + // ignores the index if we hand it an integer. Hand it a string. 151 + // See T3377. 152 + (int)$ref['identifier']); 150 153 } else { 151 154 if (strlen($ref['identifier']) < $min_qualified) { 152 155 continue;
+3 -3
src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php
··· 233 233 } 234 234 235 235 $commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( 236 - 'repositoryID = %s AND commitIdentifier = %s', 236 + 'repositoryID = %d AND commitIdentifier = %s', 237 237 $repository->getID(), 238 238 $target); 239 239 ··· 254 254 $target) { 255 255 256 256 $commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( 257 - 'repositoryID = %s AND commitIdentifier = %s', 257 + 'repositoryID = %d AND commitIdentifier = %s', 258 258 $repository->getID(), 259 259 $target); 260 260 ··· 362 362 $branch) { 363 363 364 364 $commit = id(new PhabricatorRepositoryCommit())->loadOneWhere( 365 - 'repositoryID = %s AND commitIdentifier = %s', 365 + 'repositoryID = %d AND commitIdentifier = %s', 366 366 $repository->getID(), 367 367 $commit_identifier); 368 368
+1 -1
src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php
··· 498 498 $commit_data = queryfx_all( 499 499 $commit_table->establishConnection('w'), 500 500 'SELECT id, commitIdentifier FROM %T 501 - WHERE repositoryID = %d AND commitIdentifier in (%Ld)', 501 + WHERE repositoryID = %d AND commitIdentifier in (%Ls)', 502 502 $commit_table->getTableName(), 503 503 $repository->getID(), 504 504 $commits);