mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #39144
[Bug 1238373] Re: Mahara sites that have been around since before 1.2 have unique indexes where they should have unique keys
** Also affects: mahara/17.04
Importance: Low
Assignee: Aaron Wells (u-aaronw)
Status: Confirmed
** Changed in: mahara/17.04
Milestone: 16.10.1 => 17.04.0
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1238373
Title:
Mahara sites that have been around since before 1.2 have unique
indexes where they should have unique keys
Status in Mahara:
Confirmed
Status in Mahara 17.04 series:
Confirmed
Bug description:
See https://bugs.launchpad.net/mahara/+bug/1238363
In the run-up to 1.2.0, we changed the XMLDB library so that it
created proper unique keys. Prior to that, whenever you told it to
create a unique key, it actually created a unique index.
Normally this doesn't cause any noticeable difference in behavior. But
in bug 1238363 it caused upgrade to crash, because the drop_key()
method didn't find the key that was expected. Instead, there was an
index.
Potential fixes for this may include:
1. Investigate the difference between a unique key and unique index in
MySQL and Postgres to make sure that they really are 100% identical in
behavior
2. A one-off upgrade in lib/db/upgrade.php that finds all the "legacy"
indexes and drops them and recreates them as keys. However, since
sites that have been around since 1.2 tend to be rather large, this
might be a slow process.
3. Make drop_key() more robust, so that if there is no key by that
name on that table, it just looks for an index by that name on that
table. This has the potential to be an unexpected side effect and thus
cause problems of its own, but I think it'd be pretty rare for someone
to create a key and an index with the same name, on the same table. It
could also print a debug() message when silently doing this
substitution.
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1238373/+subscriptions
References