Skip to content

Queries on empty array causes TinyTds to throw #841

@joshleblanc

Description

@joshleblanc

Issue

Given the following code MyModel.where(id: []), TinyTds will raise the following error:

ActiveRecord::StatementInvalid (TinyTds::Error: The isnull function requires 2 argument(s).)

Expected behavior

The adapter should return an empty collection

Actual behavior

It throws

How to reproduce

  1. Query a table with an empty array

Details

  • Rails version: 6.0.3.2
  • SQL Server adapter version: 6.0.0
  • TinyTDS version: 2.1.3.pre

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions