Skip to content

Fix error: UNION types text and bigint cannot be matched - #1

Closed
mdudak wants to merge 3 commits into
artkonekt:masterfrom
mdudak:master
Closed

Fix error: UNION types text and bigint cannot be matched#1
mdudak wants to merge 3 commits into
artkonekt:masterfrom
mdudak:master

Conversation

@mdudak

@mdudak mdudak commented Oct 28, 2025

Copy link
Copy Markdown

No description provided.

@mdudak

mdudak commented Oct 29, 2025

Copy link
Copy Markdown
Author

I'm testing it with postgresql and I'm getting error UNION types text and bigint cannot be matched when selecting multiple fields. Casting null to bigint for id and timestamp for order works.

However, it breaks custom ordering, if not all of the order columns are timestamps, resulting in error: COALESCE types text and timestamp without time zone cannot be matched.

That means, only timestamp columns may be used in orderBy, as it is in example.

@fulopattila122

Copy link
Copy Markdown
Contributor

Thanks for the PR. This is a long-standing issue that I'd be very happy to solve.
The changes however break existing functionality, even with MySQL, see the test run: https://github.com/artkonekt/search/actions/runs/18887802272

@mdudak

mdudak commented Oct 29, 2025

Copy link
Copy Markdown
Author

Oh yes, I got it. It's a bit more tricky to make it working for all database systems.

@mdudak mdudak closed this Oct 29, 2025
@fulopattila122

Copy link
Copy Markdown
Contributor

Yes, it's tricky, unfortunately. But I'd be interested in which exact scenario the code in this PR solved?

@fulopattila122 fulopattila122 self-assigned this Oct 29, 2025
@fulopattila122 fulopattila122 added the enhancement New feature or request label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants