Project

General

Profile

Actions

Bug #80096

closed

[BUGFIX] ConnectionMigrator resets changedColumns

Added by Thomas Hohn about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
-
Target version:
Start date:
2017-03-02
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Stabilization Sprint

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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #80043: Upgrade Wizard must only add PK indexesClosedThomas Hohn2017-02-27

Actions
Actions #1

Updated by Thomas Hohn about 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.

Actions #2

Updated by Thomas Hohn about 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

Actions #3

Updated by Thomas Hohn about 7 years ago

  • Description updated (diff)
Actions #4

Updated by Gerrit Code Review about 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

Actions #5

Updated by Thomas Hohn about 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

Actions #6

Updated by Thomas Hohn about 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..

Actions #7

Updated by Gerrit Code Review about 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

Actions #8

Updated by Gerrit Code Review about 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

Actions #9

Updated by Gerrit Code Review about 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

Actions #10

Updated by Gerrit Code Review about 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

Actions #11

Updated by Gerrit Code Review about 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

Actions #12

Updated by Gerrit Code Review about 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

Actions #13

Updated by Morton Jonuschat about 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #14

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF