Skip to content

Cannot override rejectOnEmpty #9613

@LordJimBeam

Description

@LordJimBeam

What are you doing?

If I set rejectOnEmpty to true during initialization I cannot override it in a query anymore. I would guess the error is https://github.com/sequelize/sequelize/blob/master/lib/model.js#L1681

const sequelize = new Sequelize({
  define: {
    rejectOnEmpty: true
  }
});

model.findAll({
  rejectOnEmpty: false
});

What do you expect to happen?

findAll resolves with []

What is actually happening?

findAll rejects with SequelizeEmptyResultError

Dialect: mysql (tested only mysql but suppose other dialects are affected too)
Dialect version: mysql2@1.5.3
Database version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1
Sequelize version: sequelize@4.38.0
Tested with latest release: Yes, latest release is 4.38.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugDEPRECATED: replace with the "bug" issue type

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions