Index: trunk/phase3/includes/api/ApiQueryBase.php |
— | — | @@ -251,11 +251,19 @@ |
252 | 252 | * @return ResultWrapper |
253 | 253 | */ |
254 | 254 | protected function select( $method, $extraQuery = array() ) { |
| 255 | + $tables = $this->tables; |
| 256 | + $fields = $this->fields; |
| 257 | + $where = $this->where; |
| 258 | + $options = $this->options; |
| 259 | + $join_conds = $this->join_conds; |
| 260 | + |
255 | 261 | // Merge $this->tables with $extraQuery['tables'], $this->fields with $extraQuery['fields'], etc. |
256 | 262 | foreach ( array( 'tables', 'fields', 'where', 'options', 'join_conds' ) as $var ) { |
257 | | - $$var = array_merge( $this->{$var}, isset( $extraQuery[$var] ) ? (array)$extraQuery[$var] : array() ); |
| 263 | + if ( isset( $extraQuery[$var] ) ) { |
| 264 | + $$var = array_merge( $$var, (array)$extraQuery[$var] ); |
| 265 | + } |
258 | 266 | } |
259 | | - |
| 267 | + |
260 | 268 | // getDB has its own profileDBIn/Out calls |
261 | 269 | $db = $this->getDB(); |
262 | 270 | |