Skip to content

test: add reproduction test for multi-statement query placeholder expansion#25

Draft
mdierolf wants to merge 1 commit into
mysqljs:mainfrom
mdierolf:test/allow_set_before_set
Draft

test: add reproduction test for multi-statement query placeholder expansion#25
mdierolf wants to merge 1 commit into
mysqljs:mainfrom
mdierolf:test/allow_set_before_set

Conversation

@mdierolf
Copy link
Copy Markdown

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]'

…ansion

Adds a failing test case demonstrating an issue where an object passed
to `SET ?` in a secondary 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant