From dd4c7fd6c9f4d5479355c2dbffcf0318bb171a6b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 16 May 2023 16:56:18 -0700 Subject: [PATCH] setup - Fix uninstall on MySQL 8.0 Overview -------- Fix a bug with uninstalling or reinstalling via cv (`cv core:uninstall` or `cv core:install -f`) on MySQL 8.0. Before ------ On MySQL 8.0, it fails - because all table-names appear as null. It's looking for a result column named `table_name` but actually receives `TABLE_NAME`. After ----- Doesn't matter if the column is called `table_name` or `TABLE_NAME`. --- setup/src/Setup/DbUtil.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/src/Setup/DbUtil.php b/setup/src/Setup/DbUtil.php index 438fb708c9..d62bf0b00d 100644 --- a/setup/src/Setup/DbUtil.php +++ b/setup/src/Setup/DbUtil.php @@ -311,8 +311,8 @@ class DbUtil { $sql = sprintf("SELECT table_name FROM information_schema.TABLES WHERE TABLE_SCHEMA='%s' AND TABLE_TYPE = 'BASE TABLE'", $conn->escape_string($databaseName)); - return array_map(function($arr) { - return $arr['table_name']; + return array_map(function ($arr) { + return $arr['table_name'] ?? $arr['TABLE_NAME']; }, self::fetchAll($conn, $sql)); } -- 2.25.1