Page 1 of 1

Unable to perform sql

Posted: Mon Dec 09, 2019 2:43 pm
by alfiosantoro
Hi, when I try to merge two tickets created by email, this error is returned:

SELECT COUNT(*) as `cnt`, (CASE WHEN `staffid` = 0 THEN 0 ELSE 1 END) AS `staffcnt` FROM `hesk_replies` WHERE `replyto`=35 GROUP BY `staffcnt` ASC

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ASC' at line 1

What can this problem be due to?

Thank you,

A. Santoro

Re: Unable to perform sql

Posted: Mon Dec 09, 2019 3:54 pm
by Klemen
Could you let me know what version of Hesk and MySQL you are using (check in Hesk admin panel on Settings page)?

Re: Unable to perform sql

Posted: Tue Dec 17, 2019 11:27 am
by alfiosantoro
Hi,

thank you for the support.

HESK version: 2.8.4 - HESK is up to date
PHP version: 7.3.7 (MySQLi)
MySQL version: 8.0.18
/hesk_settings.inc.php Exists, Writable
/attachments Exists, Writable
/cache Exists, Writable

Re: Unable to perform sql

Posted: Tue Dec 17, 2019 12:22 pm
by Klemen
It appears MySQL 8 introduced some backward-incompatible changes when sorting group by clauses. Thank you for bringing this to my attention.

I will look into it more deeply in the following weeks and update you when I have a solution.

Re: Unable to perform sql

Posted: Tue Dec 17, 2019 8:25 pm
by Klemen
Please try this and see if it fixes your problem:
1. download this archive
2. upload the "admin_functions.inc.php" to your Hesk "inc" folder (overwrite the existing file)

Re: Unable to perform sql

Posted: Wed Dec 18, 2019 2:43 pm
by alfiosantoro
Hi Klemen,

replacing the file you provided to me now everything works!

Thanks for your help, greetings,

Alfio