Project

General

Profile

Actions

Bug #88176

closed

DBAL Unique Key containing more than 3 columns not working

Added by Gabriel Kaufmann / Typoworx NewMedia over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Must have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2019-04-18
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
mysql dbal unique-key
Complexity:
Is Regression:
Sprint Focus:

Description

I tried to define ext_tables.sql structure and a table that has unique-key consisting of multiple fields.

This is working as expected with max. 3 fields added:

UNIQUE unique_asset (parent_table, parent_id, parent_field)

I required to add another one - which fails after testing sql-inserts

UNIQUE unique_asset (parent_table, parent_id, parent_field,parent_field_index)

TYPO3 Install-Tool reports to successfully create database-structure. After a while I noticed that I got SQL-Exceptions like this for duplicate-entries:

Duplicate entry 'tx_mytablename_domain_model_pro-114-instructions' for key 'unique_asset'

I noticed the last index-field obviously is missing there! It should have been a numeric index.
In PhpMyAdmin I've noticed the recent added index-field 'parent_field_index' is really missing/not created at all!

I've deleted and recreated the index manually on phpmyadmin and it works:

ALTER TABLE `tx_mytablename_domain_model_pro` ADD UNIQUE unique_asset (parent_table, parent_id, parent_field,parent_field_inde);

So it looks like there somewhere is a hard-coded limit either in TYPO-Core or in Doctrine/DBAL? I would at least have expected TYPO3-Install tool to throw a hint on this, but it's completly ignoring the 4th index-field and reporting success everywhere - except on duplicate-entries raising SQL-Exception obviously.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #89306: postgres Analyze Database Structure and Upgrade Wizzard fails to read indicies and primary keysClosed2019-09-30

Actions
Actions

Also available in: Atom PDF