Changed update and insert query behavior