Skip to content

Incorrect translate array parameter in where statement "IN" #256

Description

@podolinek

Nette database 2.4.9 translates query code

$database->query("SELECT * FROM table WHERE ? <= date_to AND ? >= date_from AND type_id IN (?)",
"2020-04-01 00:00:00", "2020-04-02 00:00:00", [1,2]);

into query

SELECT * FROM table WHERE
'2020-04-01 00:00:00' <= date_to AND '2020-04-02 00:00:00' >= date_from AND 
type_id IN ((1) AND (2))

Query with placed IN at beginning is ok.

$database->query("SELECT * FROM table WHERE type_id IN (?) AND ? <= date_to AND ? >= date_from",
[1,2], "2020-04-01 00:00:00", "2020-04-02 00:00:00");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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