1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

MySQL 8.0.17+ support: INT types no longer return a width specification

Fixes: #4216
This commit is contained in:
Nick Liu
2020-07-16 17:30:57 -05:00
parent 3fcbcd34c0
commit aee67c1399

View File

@@ -154,6 +154,16 @@ class db_verify
$actual['default'] = preg_replace("/DEFAULT '(\d*\.?\d*)'/i", 'DEFAULT $1', $actual['default'] ); $actual['default'] = preg_replace("/DEFAULT '(\d*\.?\d*)'/i", 'DEFAULT $1', $actual['default'] );
} }
/**
* Display width specification for integer data types was deprecated in MySQL 8.0.17
* @see https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html
*/
if(1 === preg_match('/([A-Z]*INT)/i', $expected['type']))
{
$expected['value'] = '';
$actual['value'] = '';
}
// Correct difference on CREATE TABLE statement between MariaDB and MySQL // Correct difference on CREATE TABLE statement between MariaDB and MySQL
if(1 === preg_match('/(DATE|DATETIME|TIMESTAMP|TIME|YEAR)/i', $expected['default'])) if(1 === preg_match('/(DATE|DATETIME|TIMESTAMP|TIME|YEAR)/i', $expected['default']))
{ {