Cms: MySQL 8.0.21: column names uppercase, leading to 'Undefined index: constraint_name'

Created on 14 Jul 2020  路  4Comments  路  Source: craftcms/cms

Description

This seems to be a Yii issue, but I'm adding an issue here in case that helps the fix be included in Craft sooner once it's available. (Or even perhaps be worked around in the meantime if you think that's appropriate.)

https://github.com/yiisoft/yii2/issues/18171

After updating to MySQL 8.0.21, the following is raised:

PHP Notice 'yii\base\ErrorException' with message 'Undefined index: constraint_name'
in /path/to/vendor/yiisoft/yii2/db/mysql/Schema.php:394

As I understand it, MySQL now returns the field names in uppercase, meaning the lowercase array indexes used in Yii's Schema.php don't work.

This is a temporary workaround I'm using locally for development.

Additional info

  • Craft version: 3.4.27
  • PHP version: 7.4.8
  • Database driver & version: MySQL 8.0.21
bug environmental critical

Most helpful comment

Craft 3.4.28 is out now with this fix.

All 4 comments

I'm seeing the same thing after migrating a site to another server.

PHP Notice 'yii\base\ErrorException' with message 'Undefined index: constraint_name'
 in /home/forge/galileo.123innovation.co.uk/vendor/yiisoft/yii2/db/mysql/Schema.php at line 394

Craft version: 3.4.26
PHP version: 7.2
Database driver & version: MySQL 8.0.21

Migrating an in-development Craft site to a fresh Forge provisioned server using MySQL 8 and same error. Whole site is unavailable :(

Just fixed this for the next release, which I鈥檒l get out asap, but in the meantime you can patch your local install by changing your craftcms/cms requirement in composer.json to:

"require": {
  "craftcms/cms": "dev-develop as 3.4.27",
  "...": "..."
}

Then run composer update.

Craft 3.4.28 is out now with this fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bitboxfw picture bitboxfw  路  3Comments

michaelhue picture michaelhue  路  3Comments

angrybrad picture angrybrad  路  3Comments

mattstein picture mattstein  路  3Comments

leigeber picture leigeber  路  3Comments