From 158dc3c19326bc9f473d9faa063298b8433c1b03 Mon Sep 17 00:00:00 2001 From: Alex Bowers Date: Tue, 7 Apr 2020 13:57:12 +0100 Subject: [PATCH] Bug fix for MySQL 8.0 In MySQL 8.0 tinyint without a length defined returns no length, causing a notice to be thrown --- data/source/database/adapter/MySql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/source/database/adapter/MySql.php b/data/source/database/adapter/MySql.php index bc49789a33..7125e6b609 100644 --- a/data/source/database/adapter/MySql.php +++ b/data/source/database/adapter/MySql.php @@ -446,7 +446,7 @@ protected function _column($real) { switch (true) { case in_array($column['type'], ['date', 'time', 'datetime', 'timestamp']): return $column; - case ($column['type'] === 'tinyint' && $column['length'] == '1'): + case ($column['type'] === 'tinyint' && isset($column['length']) && $column['length'] == '1'): case ($column['type'] === 'boolean'): return ['type' => 'boolean']; break; @@ -508,4 +508,4 @@ protected function _buildColumn($field) { } } -?> \ No newline at end of file +?>