Skip to content

A multi-statement query with SET ... in a prior statement fails to escape as expected #26

@mdierolf

Description

@mdierolf

I have created PR #25, which adds a test to the test suite that demonstrates a case where the format functions fails to expand the SET statement in an otherwise valid multi-statement query

Summary:
Adds a failing test case demonstrating an issue where an object passed to SET ? in a previous statement in a multi-statement query is incorrectly formatted (resulting in an unintended [object Object] string), rather than being expanded properly into key-value pairs.

The failing code:
format("SET @foo = 1; INSERT INTO bar SET ?", [{ foo: 'bar' }]);

Expected:
SET @foo = 1; INSERT INTO bar SET foo = 'bar'

Result:
SET @foo = 1; INSERT INTO bar SET '[object Object]'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions