Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9
-
Fix Version/s: 1.9.2
-
Component/s: Administration
-
Labels:None
-
Database:Oracle
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
Under Oracle, SQL statements like "SELECT fields1, fields2" with no "FROM table" are invalid and produce a "FROM keyword not found where expected" error. This is most obvious when the cron task performs its stats collection. The solution is to select from the dummy 'DUAL' table in statements affected.
Attached is my workaround patch I'm using for the moment, which is probably only useful to locate the problematic statements until an official solution is implemented. Perhaps a function like the one below could be added to dmllib to get around this in a compatible manner?
function sql_null_from() {
global $CFG;
switch ($CFG->dbfamily) {
case 'oracle':
return 'FROM DUAL';
default:
return '';
}
}
Wow Jonathon, well spotted! B-)
I'll try to fix this tomorrow (by implementing the function and using it where necessary!
Thanks for the report (grrr... that's because my dev oracle installation hasn't stats enabled... grrr) !
Ciao