Project

General

Profile

Actions

Bug #79993

closed

Too long primary index on sys_refindex

Added by Pascal Hinz over 7 years ago. Updated about 7 years ago.

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

100%

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

Description

Sometimes i get this error when i try to install TYPO3 8.6. My MySQL Server runs 5.6. The error appears randomly.

Database query failed!

Query:

CREATE TABLE `sys_refindex` (
        `hash` VARCHAR(32) DEFAULT '' NOT NULL, 
        `tablename` VARCHAR(255) DEFAULT '' NOT NULL, 
        `recuid` INT DEFAULT 0 NOT NULL, 
        `field` VARCHAR(64) DEFAULT '' NOT NULL, 
        `flexpointer` VARCHAR(255) DEFAULT '' NOT NULL, 
        `softref_key` VARCHAR(30) DEFAULT '' NOT NULL, 
        `softref_id` VARCHAR(40) DEFAULT '' NOT NULL, 
        `sorting` INT DEFAULT 0 NOT NULL, 
        `deleted` SMALLINT DEFAULT 0 NOT NULL, 
        `workspace` INT DEFAULT 0 NOT NULL, 
        `ref_table` VARCHAR(255) DEFAULT '' NOT NULL, 
        `ref_uid` INT DEFAULT 0 NOT NULL, 
        `ref_string` VARCHAR(1024) DEFAULT '' NOT NULL,

        INDEX `lookup_rec` (tablename, recuid), 
        INDEX `lookup_uid` (ref_table, ref_uid), 
        INDEX `lookup_string` (ref_string), 

        PRIMARY KEY(hash)
) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB

Error: Specified key was too long; max key length is 767 bytes

Its seems there are related Bugs to this ( https://forge.typo3.org/issues/79628 )
As workaround i modified the typo/sysext/core/ext_tables.sql :

#
# Table structure for table 'sys_refindex'
#
CREATE TABLE sys_refindex (
        hash varchar(32) DEFAULT '' NOT NULL,
        tablename varchar(255) DEFAULT '' NOT NULL,
        recuid int(11) DEFAULT '0' NOT NULL,
        field varchar(64) DEFAULT '' NOT NULL,
        flexpointer varchar(255) DEFAULT '' NOT NULL,
        softref_key varchar(30) DEFAULT '' NOT NULL,
        softref_id varchar(40) DEFAULT '' NOT NULL,
        sorting int(11) DEFAULT '0' NOT NULL,
        deleted tinyint(1) DEFAULT '0' NOT NULL,
        workspace int(11) DEFAULT '0' NOT NULL,
        ref_table varchar(255) DEFAULT '' NOT NULL,
        ref_uid int(11) DEFAULT '0' NOT NULL,
        ref_string varchar(1024) DEFAULT '' NOT NULL,

        PRIMARY KEY (hash),
        KEY lookup_rec (tablename(100),recuid),
        KEY lookup_uid (ref_table,ref_uid),
        KEY lookup_string (ref_string(100))
);

Now it works. Beware i'm not that MySQL expert. Different solutions where recommended by the TYPO3 Commuity Slack Chat (Thanks to Christian Kuhn and Pierrick Caillon).
So somebody has to confirm the changes, if they make sense.


Files

Bildschirmfoto 2017-02-24 um 10.21.01.png (199 KB) Bildschirmfoto 2017-02-24 um 10.21.01.png error screenshot Pascal Hinz, 2017-02-24 11:34

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #79628: Long primary index on be_session and fe_session tableClosed2017-02-04

Actions
Actions #1

Updated by Christian Kuhn over 7 years ago

  • Target version set to 8 LTS
  • Sprint Focus set to Stabilization Sprint
Actions #2

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/51828

Actions #3

Updated by Anonymous over 7 years ago

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

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF