}
if ( $isWrite ) {
+ if ( $this->getLBInfo( 'replica' ) === true ) {
+ throw new DBError(
+ $this,
+ 'Write operations are not allowed on replica database connections.'
+ );
+ }
# In theory, non-persistent writes are allowed in read-only mode, but due to things
# like https://bugs.mysql.com/bug.php?id=33669 that might not work anyway...
$reason = $this->getReadOnlyReason();