Issue Bug Closed

#89874Can't updata database structure on MariaDB 10.0 and TYPO3 9.5 (can't rename index)

Tymoteusz Motylewski 12/06/19, 10:51 updated 06/07/24, 22:56

Description

I just have an issue when upgrading TYPO3 from 8.7 to 9.5.11 on Mariadb v10.0. It fails on trying to rename db index on sys_file_metadata table:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INDEX pid TO `parent`' at line 1

The sql query is

ALTER TABLE sys_file_metadata RENAME INDEX pid TO `parent` 

It seems that mariadb 10 doesn’t support index rename
https://stackoverflow.com/questions/19797105/does-mariadb-support-renaming-an-index (edited)
So basically we either have to fix the logic of index rename or bump db server requirements.
Or maybe its’ possible to figure out some detection of the mysql/mariadb type?

https://github.com/doctrine/migrations/issues/196

This issue might be related to
https://review.typo3.org/c/Packages/TYPO3.CMS/+/62063

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Tymoteusz Motylewski changed description 12/06/19, 11:04

  2. Tymoteusz Motylewski commented 12/06/19, 11:16

    The workaround is it set server version manually in Localconfiguration.php

    $GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['serverVersion'] = 5.6;
  3. Christian Eßl changed category 03/11/20, 21:27

  4. Stefan Bürk commented and changed status New Closed assigned to Stefan Bürk 06/07/24, 22:56

    This is fixed in `doctrine/dbal` since doctrine/dbal `2.6.0` [1]2.

    Not sure about the correct TYPO3 version, but at least for TYPO3 v11+
    we have a dbal version shipped containing the corresponding fix. Older
    version do not get an update anymore (in the community version).

    Must be patched / raised to a high enough dbal version by yourself for
    such old versions. Or upgrade to a new TYPO3 version.

    [1] https://github.com/doctrine/dbal/pull/742
    2 https://github.com/doctrine/dbal/commit/19f5a1396846a35889720949fb07a885f1d30ced

    Note: In newer TYPO3 version the version check has also been changed and fixed on the
    TYPO3 side already to report MariaDB correctly – and due to other changes in MariaDB 10.x.

    Closing this issue now.