51877[BUGFIX] Upgrade Wizard must only add PK indexes
Commit message
Review
-
Code review CR 0
-
Verified V 0
Issues 1
Files 3
Review log 2124
-
Thomas Hohn uploaded patch set 1 02/27/17, 19:44
-
TYPO3com voted on patch set 1 V -1 02/27/17, 19:55 Completed build in 11m 06s on Mon, 27 Feb, 08:55 PM Test Summary: 1 of 56297 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8707
-
Thomas Hohn commented on patch set 1 02/27/17, 19:58
Unless this is the right approach there is no reason to fix the test that fails.. -
Markus Klein commented on patch set 1 02/27/17, 21:24
InitialDatabaseSchemaUpdate.php:211this block seems a leftover -
Markus Klein commented on patch set 1 02/27/17, 21:27
I agree with the approach and would adjust the tests -
TYPO3com commented on patch set 1 02/27/17, 21:35 Completed build in 2h 02m 19s on Mon, 27 Feb, 10:35 PM Test Summary: 1 of 56297 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8707
-
Thomas Hohn uploaded patch set 2 02/28/17, 05:48
-
TYPO3com voted on patch set 2 V +1 02/28/17, 05:58 Completed build in 09m 30s on Tue, 28 Feb, 06:58 AM Test Summary: 56297 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8719
-
Morton Jonuschat commented on patch set 2 02/28/17, 06:34
What are the steps to reproduce, the issue doesn't contain a bugreport and I wonder what those other changes might be as it can't be missing fields. -
Morton Jonuschat commented on patch set 2 CR -1 02/28/17, 06:46
Downvoting until I understand the reasoning / bug that should be fixed. This opens the door to get the database into an inconsistent state, for example due to unique constraints missing, at least for some time during the upgrade process. -
Thomas Hohn commented on patch set 2 02/28/17, 07:03
Bug-report added -
Morton Jonuschat commented on patch set 2 02/28/17, 07:19
Thanks for the update, I think this fails early due to the partial mysql index being removed but even without that it would probably fail due to an index named sha1 already existing. This might not be the right approach, need to investigate further. -
Thomas Hohn commented on patch set 2 02/28/17, 07:33
The problem is index creation on columns that needs to be modified before creating the index. -
Morton Jonuschat commented on patch set 2 02/28/17, 08:03
The bugreport states that the index is changed from sha1(40) to sha1. So the index - with the same name - already exists, only the definition changed. Which is why I think theres more to it than just the fields need to be changed first. Especially since there's exactly one case when this holds true, when the MySQL prefix length information is in play and fields on MySQL change from or to TEXT/BLOB type. -
Thomas Hohn commented on patch set 2 02/28/17, 08:14
Might be - but adding an index on a existing column "with-out" the proper restriction will also always fail - which was why my suggest was to let indexes be created by the Dataanalyser instead. -
Johannes Kasberger commented on patch set 2 V -1 02/28/17, 08:38
I tried to run the upgrade wizards with this patch applied and it reports the same error: Update failed! SQL-ERROR: BLOB/TEXT column 'sha1' used in key specification without a key length SQL-ERROR: Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys). After the error the "Update database schema: Modify tables and fields" wizard is marked as done and offers to continue with the remaining wizards. Reporting an failed update error and still continue afterwards does not seem correct. -
Thomas Hohn commented on patch set 2 02/28/17, 08:44
With the patch it should no report the change on the index - will have a look at it since it seemed to work for me -
Thomas Hohn commented on patch set 2 02/28/17, 11:03
Will you look further into the issue Morton? -
Markus Klein commented on patch set 2 02/28/17, 12:10
To clarify a few things: The index is still shown, since it is listed as changedIndex (not as addedIndex). Moreover we touch a general problem here. It is impossible to always create correct list for DB migrations for any possible SQL change, unless we add a reasoning engine, that realizes that an index can't be updated in certain reasons, but must be removed, field types need to be updated and new index must be added. In general we probably need to reconsider the whole DB migration handling. Creating a diff by comparing SQL definitions is obviously not enough. -
Thomas Hohn commented on patch set 2 02/28/17, 12:42
So Markus what do you suggest - avoid creating indexes except PK indexes no matter what as now - or ? -
Markus Klein commented on patch set 2 02/28/17, 13:56
I suggest to move the discussion to a higher level in cordev channel on slack. I honestly see no sane way to solve the problem in a generic manner with the current approach how update wizards work. The goal must rather be to specify the SQL change in migration files per update wizard and those are executed per wizard. So for the problem at hand the wizard could drop the index, change the DB field, do the migration and add the new index. The right order of the actions always depends strongly on the update to perform. -
Morton Jonuschat commented on patch set 2 CR -2 03/01/17, 07:40
Blocking for now, please see issue for details. @Johannes - can you update the issue (or leave a comment here in gerrit) to provide more details how to reproduce this. The only way I found was to start the upgrade process with an unhealthy database. -
Markus Klein commented on patch set 2 03/01/17, 09:19
@Morton: will check the ticket on behalf of Johannes -
Morton Jonuschat abandoned the change 03/03/17, 03:25