Bad data in the DB can cause the schema correction SQL to throw a fatal error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Aaron Wells | ||
1.8 |
Fix Released
|
Medium
|
Aaron Wells |
Bug Description
Looking at this forum post https:/
It occurs to me that there's a problem in our schema correction code. We're adding foreign keys to existing tables, but we didn't first check to see whether the tables have data that will fit that foreign key. If they have bad data, then this upgrade script will error out and prevent them from upgrading. And since these missing schema elements are not vital, we don't want their failure to block upgrade.
We should have put a "catch (SQLException $e)" block around each attempt to add a foreign key, unique index, and/or primary key, or another other schema element that will fail if their data isn't clean. :-P
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
https:/ /reviews. mahara. org/#/c/ 2833/