MySQL 8 keywords and reserved words compatibility
I found quite unpleasant thing with MySQL 8 compatibility. There appeared the "Keywords and Reserved Words" mechanism. https://dev.mysql.com/doc/refman/8.0/en/keywords.html
Now some part of Hubzilla SQL code where name of tables or/and field are matches with such reserved words produces an errors like
2018-09-25T20:45:58Z:LOG_ERR:1d0e049086:dba_driver.php:459:db_logger: dba_pdo: ERROR: SELECT id, hash, gname FROM groups WHERE deleted = 0 AND uid = 2 ORDER BY gname ASC
SQLSTATE[42000]: Syntax error or access violation: 1064 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 'groups WHERE deleted = 0 AND uid = 2 ORDER BY gname ASC' at line 1
2
MySQL documentation recommend to use backticks ` to quote such words or do not use them as fields and/or tables names. Because of Hubzilla supports PgSQL we can not use backticks in SQL code (or it can be removed before SQL will be directed to PgSQL).
So we need to have a workaround for this issue.