select query uses more than MAX_JOIN_SIZE on mysql
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Unassigned | ||
1.6 |
Fix Released
|
Medium
|
Unassigned | ||
1.7 |
Fix Released
|
Medium
|
Unassigned | ||
1.8 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When I tried to use an Artefact (Files, Images and Video) within a special Group - in my case it case I tried to use Image - I get that error message in debugger:
+++
Failed to get a recordset: mysql error: [1104: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay] in EXECUTE(" SELECT a.id, a.artefacttype, a.mtime, f.size, a.title, a.description, a.locked, a.allowcomments, u.profileicon AS defaultprofileicon, COUNT(DISTINCT c.id) AS childcount, COUNT (DISTINCT aa.artefact) AS attachcount, COUNT(DISTINCT va.view) AS viewcount, COUNT(DISTINCT api.id) AS profileiconcount, r.can_edit, r.can_view, r.can_republish, a.author FROM "ep_artefact" a LEFT OUTER JOIN "ep_artefact_
+++
When trying to open the Files Folder at the Group Site the following error message is printed
"A nonrecoverable error occured. This probably means you have encountered a bug in the system"
+++
I checked other groups. There all artefacts work. So it seems to be a special problem connected to that group. This is the main group where my students get their Inputs and works.
I tried to figure out that error statement. But I am no SQL expert and so I hope someone can give me help.
A more long term solution would be to reduce the number of joins made.
Changed in mahara: | |
milestone: | 1.7.0 → 1.8.0 |
Changed in mahara: | |
milestone: | 1.8rc1 → 1.8.0 |
Changed in mahara: | |
milestone: | 1.8.0 → 1.8.1 |
no longer affects: | mahara/1.9 |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Solution would be to add SET SQL_BIG_SELECTS=1
This can be done in lib/dml.php round line 1478 (master)