Skip to content

Bug in MSSQL driver (more than 2000 approvals) #190

Description

@JohnieBraaf

Hi,

Sadly I've stubled upon another (critical) bug. This time in the part that fetches the available approvals.
https://github.com/javrasya/django-river/blob/master/river/driver/mssql_driver.py#L20-L32

A list of approvals is fetched and then used as a filter on the id array for the TransactionApproval model.
When the list of id's is larger than 2000, SQL server runs into a limitation:

  • ('42000', '[42000] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The incoming request has too many parameters. The server supports a maximum of 2100 parameters. Reduce the number of parameters and resend the request. (8003) (SQLExecDirectW)')

My observation is that this part of the framework is quite inefficient, as I only want the approvals related to a single object and yet it is fetching all approvals and the again uses this to fire an additional parameterized query.

Is there a reasoning behind this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions