On Sun, 13 Jan 2013, Hannes Magnusson wrote:

> > @@ -909,13 +939,33 @@ int mongo_cursor__do_query(zval *this_ptr, zval *return_value TSRMLS_DC) {
> >  		mongo_deregister_callback_from_connection(cursor->connection, cursor);
> >  	}
> >  
> > +	/* If the static property "slaveOkay" is set, we need to switch to a
> > +	 * MONGO_RP_SECONDARY_PREFERRED as well, but only if read preferences
> > +	 * aren't already set. */
> > +	if (cursor->read_pref.type == MONGO_RP_PRIMARY) {
> > +		zval *zslaveokay;
> > +
> > +		zslaveokay = zend_read_static_property(mongo_ce_Cursor, "slaveOkay", strlen("slaveOkay"), NOISY TSRMLS_CC);
> > +		cursor->read_pref.type = Z_BVAL_P(zslaveokay) ? MONGO_RP_SECONDARY_PREFERRED : MONGO_RP_PRIMARY;
> > +	}
> 
> MongoCursor::$slaveOkay = true;
> $cursor->slaveOkay(false);
> iterator_to_array($cursor);
> 
> This will be a slaveOkay query afaict?

Fixed (will push after the info() change).