@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.

Remove unused *ParallelQueries() database connection methods

Summary:
`executeParallelQueries()` is never called as `supportsParallelQueries()` returns `false` both in `AphrontDatabaseConnection` and `AphrontMySQLDatabaseConnection`.
Thus remove this unused code which was intentionally meant for HHVM which does not support PHP>=7 anyway.

P.S. Dear Facebook, if you are using this, let us know. We don't want to hurt your legacy Phabricator installation.

Closes T15919

Test Plan: Grep for both functions.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15919

Differential Revision: https://we.phorge.it/D25789

-89
-4
src/infrastructure/storage/connection/AphrontDatabaseConnection.php
··· 63 63 return false; 64 64 } 65 65 66 - public function supportsParallelQueries() { 67 - return false; 68 - } 69 - 70 66 public function setReadOnly($read_only) { 71 67 $this->readOnly = $read_only; 72 68 return $this;
-73
src/infrastructure/storage/connection/mysql/AphrontMySQLDatabaseConnection.php
··· 145 145 mysql_free_result($result); 146 146 } 147 147 148 - public function supportsParallelQueries() { 149 - // fb_parallel_query() doesn't support results with different columns. 150 - return false; 151 - } 152 - 153 - /** 154 - * @phutil-external-symbol function fb_parallel_query 155 - */ 156 - public function executeParallelQueries( 157 - array $queries, 158 - array $conns = array()) { 159 - assert_instances_of($conns, __CLASS__); 160 - 161 - $map = array(); 162 - $is_write = false; 163 - foreach ($queries as $id => $query) { 164 - $is_write = $is_write || $this->checkWrite($query); 165 - $conn = idx($conns, $id, $this); 166 - 167 - $host = $conn->getConfiguration('host'); 168 - $port = 0; 169 - $match = null; 170 - if (preg_match('/(.+):(.+)/', $host, $match)) { 171 - list(, $host, $port) = $match; 172 - } 173 - 174 - $pass = $conn->getConfiguration('pass'); 175 - if ($pass instanceof PhutilOpaqueEnvelope) { 176 - $pass = $pass->openEnvelope(); 177 - } 178 - 179 - $map[$id] = array( 180 - 'sql' => $query, 181 - 'ip' => $host, 182 - 'port' => $port, 183 - 'username' => $conn->getConfiguration('user'), 184 - 'password' => $pass, 185 - 'db' => $conn->getConfiguration('database'), 186 - ); 187 - } 188 - 189 - $profiler = PhutilServiceProfiler::getInstance(); 190 - $call_id = $profiler->beginServiceCall( 191 - array( 192 - 'type' => 'multi-query', 193 - 'queries' => $queries, 194 - 'write' => $is_write, 195 - )); 196 - 197 - $map = fb_parallel_query($map); 198 - 199 - $profiler->endServiceCall($call_id, array()); 200 - 201 - $results = array(); 202 - $pos = 0; 203 - $err_pos = 0; 204 - foreach ($queries as $id => $query) { 205 - $errno = idx(idx($map, 'errno', array()), $err_pos); 206 - $err_pos++; 207 - if ($errno) { 208 - try { 209 - $this->throwQueryCodeException($errno, $map['error'][$id]); 210 - } catch (Exception $ex) { 211 - $results[$id] = $ex; 212 - } 213 - continue; 214 - } 215 - $results[$id] = $map['result'][$pos]; 216 - $pos++; 217 - } 218 - return $results; 219 - } 220 - 221 148 protected function fetchAssoc($result) { 222 149 return mysql_fetch_assoc($result); 223 150 }
-12
src/infrastructure/storage/future/QueryFuture.php
··· 56 56 } 57 57 58 58 if (!$this->conn->supportsAsyncQueries()) { 59 - if ($this->conn->supportsParallelQueries()) { 60 - $queries = array(); 61 - $conns = array(); 62 - foreach (self::$futures as $id => $future) { 63 - $queries[$id] = $future->query; 64 - $conns[$id] = $future->conn; 65 - } 66 - $results = $this->conn->executeParallelQueries($queries, $conns); 67 - $this->processResults($results); 68 - return true; 69 - } 70 - 71 59 $conns = array(); 72 60 $conn_queries = array(); 73 61 foreach (self::$futures as $id => $future) {