Project

General

Profile

Actions

Bug #79993

closed

Too long primary index on sys_refindex

Added by Pascal Hinz about 7 years ago. Updated over 6 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

Also available in: Atom PDF