-
Bug
-
Resolution: Fixed
-
Major
-
2.6.3, 2.7.2
-
Oracle
-
MOODLE_26_STABLE, MOODLE_27_STABLE
-
MOODLE_26_STABLE, MOODLE_27_STABLE
-
MDL-47466-master -
Only happens in installations with the Oracle database
In a course with more than 1000 groups you get a dmlreadexception ('Error reading from database') when trying to see a calendar. It's even worse if you have the calendar block or the upcoming events block because you can't access the course page (the activities or resources are still accessible directly from the navigation block).
The problem comes from the function calendar_get_events() that construct a sql with the IN clause for the groups. When the limit of Oracle 1000 expressions in a list is reached we get the error.
FULL STEPS
- In a Moodle installation with Oracle as a database
- Create a course
- Go to Users > Groups and create more than 1000 grups. I used a txt file with 1001 and the import option.
- Go to the calendar for that course
You expected to see the calendar but actually you get the error:
Error reading from database
More information about this error
Debug info: ORA-01795: maximum number of expressions in a list is 1000
SELECT * FROM m_event WHERE (timestart >= 1409522400 OR timestart + timeduration > 1409522400) AND timestart <= 1412114399 AND ( (userid = 4 AND courseid = 0 AND groupid = 0) OR groupid IN (/** a list of more than 1000 ids **/) OR (groupid = 0 AND courseid IN (16042,1))) AND visible = 1 ORDER BY timestart
[array (
)]
Error code: dmlreadexception
Stack trace:
line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 271 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
line 1122 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
line 1257 of /lib/dml/moodle_database.php: call to oci_native_moodle_database->get_records_sql()
line 790 of /calendar/lib.php: call to moodle_database->get_records_select()
line 261 of /calendar/lib.php: call to calendar_get_events()
line 185 of /calendar/renderer.php: call to calendar_get_mini()
line 2772 of /calendar/lib.php: call to core_calendar_renderer->fake_block_threemonths()
line 122 of /calendar/view.php: call to calendar_information->add_sidecalendar_blocks()
- Testing discovered
-
MDL-48081 Progress indicators with large datasets on groups imports
- Closed