Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix: Use explicit expression in where condition #25

Conversation

glasses618
Copy link
Contributor

@glasses618 glasses618 commented Aug 18, 2024

In MySQL 8.0 and later, using user variables in the WHERE condition may raise the error Truncated incorrect DOUBLE value: 'id1,id2' when @ids contains more than one ID.

The exact reason for this behavior is unclear, but using an explicit expression can resolve the issue. For example, the following approaches work fine:

((@ids := CONCAT_WS(',', #{id_column}, @ids)) IS NOT NULL)

or

COALESCE(@ids := CONCAT_WS(',', #{id_column}, @ids))

or

!ISNULL(@ids := CONCAT_WS(',', #{id_column}, @ids))

@khiav223577
Copy link
Owner

Thanks. LGTM!

@khiav223577 khiav223577 merged commit 5a63dc7 into khiav223577:master Sep 9, 2024
24 checks passed
@khiav223577
Copy link
Owner

Just release v1.1.5

See the CHANGELOG for more details.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants