Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Kanban module throws SQL error #1658

Closed
BullDoggen opened this issue Jan 21, 2022 · 7 comments
Closed

Kanban module throws SQL error #1658

BullDoggen opened this issue Jan 21, 2022 · 7 comments

Comments

@BullDoggen
Copy link

Just got FreeScout installed with some modules and when I try to open Manage for Kanban it throws and error page and writes to log:

SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "union" LINE 1: ...atus" asc, "last_reply_at" desc limit 11 offset 0 union sele... ^ (SQL: select "conversations".* from "conversations" where "state" = 2 and "mailbox_id" = 1 and "status" in (1, 2) and "status" = 2 order by "status" asc, "last_reply_at" desc limit 11 offset 0 union select "conversations".* from "conversations" where "state" = 2 and "mailbox_id" = 1 and "status" in (1, 2, 3) and "status" = 3 order by "status" asc, "last_reply_at" desc limit 11 offset 0)

I think that the error is the 2 order by's, which is incorrect. How to solve this?

@freescout-helpdesk
Copy link
Owner

What DB are you using?

@BullDoggen
Copy link
Author

It should be MySQL, but I can't confirm this 100% since I can't reach our admin currently and I don't have access to the servers. I can verify this later.

@BullDoggen
Copy link
Author

Nope, it is running on postgreSQL

@freescout-helpdesk
Copy link
Owner

OK. We'll try to adjust the request for postgreSQL.

@freescout-helpdesk
Copy link
Owner

What are your PHP and PostgreSQL versions?

@freescout-helpdesk
Copy link
Owner

freescout-helpdesk commented Jan 21, 2022

By some reason php-pgsql driver does not wrap selects into parentheses like this: (select...) union (select...)

PHP pdo driver for MySQL does it:
2022-01-21_21-38-19

@freescout-helpdesk
Copy link
Owner

Kanban Module v.1.0.2 is compatible with PostgreSQL now. We had to discard unions. This may make performance of Kanban boards very low on PostgreSQL.

If someone knows how to make unions work on PostgreSQL please let us know.

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

No branches or pull requests

2 participants