SQL vs MySQL on group table update
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
High
|
Unassigned | ||
20.10 |
Fix Released
|
High
|
Unassigned | ||
21.04 |
Fix Released
|
High
|
Unassigned | ||
21.10 |
Fix Released
|
High
|
Unassigned | ||
22.04 |
Fix Released
|
High
|
Unassigned |
Bug Description
I was switching DBs for ES7 testing on a smaller dataset. The smaller db is on MySQL. During the site upgrade I got this:
```
[DBG] 66 (lib/dml.php:180) mysqli error: [1093: You can't specify target table 'group' for update in FROM clause] in EXECUTE("
UPDATE "group" SET submittableto = 1 WHERE id IN (
UPDATE "group" SET submittableto = 1 WHERE id IN (
)
```
This is related to this review: https:/
Bob spotted that MySQL has some weird behaviour when it comes to reading and writing to the same table. This method gets around that though;
UPDATE {group}
SET submittableto = 1
WHERE id IN ((
) AS foo
));");