Bug #80096
closed[BUGFIX] ConnectionMigrator resets changedColumns
100%
Description
Currently the ConnectionMigrator install methods resets changedColumns if the flag $createOnly is true.
However if indexes are added or change it must be ensured to that columns changes on the table are executed before -
or the creation of indexes might fail with SQL errors due to missing column updates.
Updated by Thomas Hohn over 7 years ago
Bugreport:
Johannes Kasberger [2:14 PM]
I’m currently trying to run the upgrade wizards for a site running on 6.2 (using the current master) and I get the following 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```
The issues is:
The field "sha1" of table "sys_file" was a tinytext in 6.2 and is a CHAR in master. and the key changed from "KEY sha1 (sha1(40))" to "KEY sha1 (sha1)".
TYPO3 tries to first change the key and fails here because of wrong type. try to do the type change from tinytext to char first, then try if the key change goes through.
This is due to the fact the the Upgrade Wizard only performs creates.
Updated by Thomas Hohn over 7 years ago
Reported by Josef Glatz:
TYPO3 7.6
CREATE TABLE sys_refindex (
...
ref_string varchar(240) DEFAULT '' NOT NULL,
...
KEY lookup_string (ref_string)
);
TYPO 8.7
CREATE TABLE sys_refindex (
...
ref_string varchar(1024) DEFAULT '' NOT NULL,
...
KEY lookup_string (ref_string(255))
);
Upgrade fails with:
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
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51928
Updated by Thomas Hohn over 7 years ago
So this is how the two indexes look - and apperantly doctrine is under the impression that its not the same indexes:
'lookup_string' =>
object(Doctrine\DBAL\Schema\Index)[4574]
protected '_columns' =>
array (size=1)
'ref_string' =>
object(Doctrine\DBAL\Schema\Identifier)[4591]
...
protected '_isUnique' => boolean false
protected '_isPrimary' => boolean false
protected '_flags' =>
array (size=0)
empty
private 'options' =>
array (size=0)
empty
protected '_name' => string 'lookup_string' (length=13)
protected '_namespace' => null
protected '_quoted' => boolean false
'lookup_string' =>
object(Doctrine\DBAL\Schema\Index)[5342]
protected '_columns' =>
array (size=1)
'ref_string(255)' =>
object(Doctrine\DBAL\Schema\Identifier)[5343]
...
protected '_isUnique' => boolean false
protected '_isPrimary' => boolean false
protected '_flags' =>
array (size=0)
empty
private 'options' =>
array (size=0)
empty
protected '_name' => string 'lookup_string' (length=13)
protected '_namespace' => null
protected '_quoted' => boolean true
So somehow doctrine treats this as an add index
Updated by Thomas Hohn over 7 years ago
I guess if you take the old definition of the tables before 8.7 dev and changes checkForUpdate always to return true - i can reproduce the error every time..
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51928
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51928
Updated by Gerrit Code Review over 7 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51928
Updated by Gerrit Code Review over 7 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51928
Updated by Gerrit Code Review over 7 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51928
Updated by Gerrit Code Review over 7 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51928
Updated by Morton Jonuschat over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 1f4d64f1815367a0d897fa82f28615b77e9195b2.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed