New reserved keywords in mysql8 cause SQL errors
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Cecilia Vela Gurovic |
Bug Description
I'm running PHP7.2 on Ubuntu 16.04 with MYSQL8 in Firefox.
There's an SQL error for the groups report that occurs when running mysql. If you go to http://
[WAR] a6 (lib/dml.php:517) Failed to get a recordset: mysqli error: [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
FROM "group"
WHERE deleted = 0
GROUP ' at line 1] in EXECUTE("
SELECT grouptype, COUNT(id) AS groups
FROM "group"
WHERE deleted = 0
GROUP BY grouptype
ORDER BY groups DESC")Command was:
SELECT grouptype, COUNT(id) AS groups
FROM "group"
WHERE deleted = 0
GROUP BY grouptype
ORDER BY groups DESC
Changed in mahara: | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Cecilia Vela Gurovic (ceciliavg) |
milestone: | none → 18.10.0 |
Changed in mahara: | |
milestone: | 18.10.0 → 18.10rc2 |
summary: |
- 18.10 RC2: Reports page causes error in mysql8 + New reserved keywords in mysql8 cause SQL errors |
Changed in mahara: | |
status: | In Progress → Fix Committed |
milestone: | 18.10rc2 → 18.10.0 |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
we are using the word 'groups' as a column name for a sql query but it is a keyword since MySQL 8.0.2
https:/ /dev.mysql. com/doc/ refman/ 8.0/en/ keywords. html
it should be wrapped in ""