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

[BUG] Syntax error in query? #1150

Closed
kurogeek opened this issue May 5, 2023 · 5 comments
Closed

[BUG] Syntax error in query? #1150

kurogeek opened this issue May 5, 2023 · 5 comments
Labels
bug Something isn't working v14

Comments

@kurogeek
Copy link
Contributor

kurogeek commented May 5, 2023

When I go to the endpoint /helpdesk/contacts/contact_name, I got an error below.

image

Then I tied to use that query statement on my mysql-client using the statement below. And I got the error below.

Problematic statement
SELECT `_assign`,`status`,`priority`,`subject`,`ticket_type`,`creation`,`modified`,`name`,`_seen`,* FROM `tabHD Ticket` WHERE `contact`=%(param1)s ORDER BY `modified` DESC,`modified` DESC LIMIT 3 {'param1': 'Frappe Helpdesk Team'} ;

The error
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '* FROM `tabHD Ticket` WHERE `contact`=%(param1)s ORDER BY `modified` DESC,`mo...' at line 1

Then I tried to rewrite the statement to:
SELECT `_assign`,`status`,`priority`,`subject`,`ticket_type`,`creation`,`modified`,`name`,`_seen` FROM `tabHD Ticket` WHERE `contact`='Frappe Helpdesk Team' ORDER BY `modified` DESC,`modified` DESC LIMIT 3 ;
And this seem to be working.

So, is this query statement a legitimate sql statement? or am I missing something such as Maria DB version?

If this is a bug, I can help you fix it.

@ssiyad
Copy link
Contributor

ssiyad commented May 5, 2023

I am not able to reproduce this exact issue. But I found something else and might be related - #1151

@ssiyad
Copy link
Contributor

ssiyad commented May 5, 2023

For context, my MariaDB version is 10.9.4

@ssiyad
Copy link
Contributor

ssiyad commented May 5, 2023

@kurogeek What version is your Frappe Framework?

@kurogeek
Copy link
Contributor Author

kurogeek commented May 5, 2023

I was testing on frappe 14.35.0

@ssiyad
Copy link
Contributor

ssiyad commented May 5, 2023

Fixed in #1152

@ssiyad ssiyad closed this as completed May 5, 2023
@ssiyad ssiyad added bug Something isn't working v14 labels May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v14
Projects
None yet
Development

No branches or pull requests

2 participants