* This better alignes with IDBAccessObject docs and
still locks out INSERTs
Change-Id: Ib8713938e0afa14bee6f90bc51d6331eaf356447
: wfGetDB( DB_SLAVE );
$options = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING )
- ? array( 'FOR UPDATE' )
+ ? array( 'LOCK IN SHARE MODE' )
: array();
- $id = $db->selectField( 'user', 'user_id', array( 'user_name' => $s ), __METHOD__, $options );
- if ( $id === false ) {
- $id = 0;
- }
+ $id = $db->selectField( 'user',
+ 'user_id', array( 'user_name' => $s ), __METHOD__, $options );
- return $id;
+ return (int)$id;
}
/**