summaryrefslogtreecommitdiff
path: root/includes/db/DatabasePostgres.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-05-05 15:30:48 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-05-05 15:30:48 -0400
commit3d86add3dfa5e0b3ead9859593d4a52cf7555a34 (patch)
tree453d8bd3fda4dbb3020017ea1a469291da5cdc71 /includes/db/DatabasePostgres.php
parent064cec79ca4c8201de0d06bbca6cb7a5345d11be (diff)
parent2e44b49a2db3026050b136de9b00f749dd3ff939 (diff)
Merge branch 'archwiki'
Diffstat (limited to 'includes/db/DatabasePostgres.php')
-rw-r--r--includes/db/DatabasePostgres.php16
1 files changed, 9 insertions, 7 deletions
diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php
index aed35f10..0bd966ba 100644
--- a/includes/db/DatabasePostgres.php
+++ b/includes/db/DatabasePostgres.php
@@ -729,13 +729,15 @@ __INDEXATTR__;
* so causes a DB error. This wrapper checks which tables can be locked and adjusts it accordingly.
*/
function selectSQLText( $table, $vars, $conds = '', $fname = __METHOD__, $options = array(), $join_conds = array() ) {
- $forUpdateKey = array_search( 'FOR UPDATE', $options );
- if ( $forUpdateKey !== false && $join_conds ) {
- unset( $options[$forUpdateKey] );
-
- foreach ( $join_conds as $table => $join_cond ) {
- if ( 0 === preg_match( '/^(?:LEFT|RIGHT|FULL)(?: OUTER)? JOIN$/i', $join_cond[0] ) ) {
- $options['FOR UPDATE'][] = $table;
+ if ( is_array( $options ) ) {
+ $forUpdateKey = array_search( 'FOR UPDATE', $options );
+ if ( $forUpdateKey !== false && $join_conds ) {
+ unset( $options[$forUpdateKey] );
+
+ foreach ( $join_conds as $table_cond => $join_cond ) {
+ if ( 0 === preg_match( '/^(?:LEFT|RIGHT|FULL)(?: OUTER)? JOIN$/i', $join_cond[0] ) ) {
+ $options['FOR UPDATE'][] = $table_cond;
+ }
}
}
}