Skip to content

[MySQL] Pdb incorrectly escapes queries with backslash #96

@tnovo

Description

@tnovo

When performing a query to the database (using mysql backend):

Query q = select(all())
                .from(table("table"))
                .where(eq("id", k("my\id"));

engine.query(q);

pdb incorrectly escapes the query to

SELECT * FROM `table` WHERE `id` = 'my\id' ;

where it should be (notice the double \ )

SELECT * FROM `table` WHERE `id` = 'my\\id' ;

this is independent of the data in the table itself.

This behaviour does not appear in prepared statements because the escaping is delegated to the driver

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