From 0070e58aeea247f199c67f5317c11a8c27f4a54f Mon Sep 17 00:00:00 2001 From: tinect Date: Thu, 15 Aug 2024 14:52:42 +0200 Subject: [PATCH] fix: correct check for set SQL_Mode --- .../Checker/PerformanceChecker/MysqlSettingsChecker.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Components/Health/Checker/PerformanceChecker/MysqlSettingsChecker.php b/src/Components/Health/Checker/PerformanceChecker/MysqlSettingsChecker.php index e96f97b..f0f56d1 100644 --- a/src/Components/Health/Checker/PerformanceChecker/MysqlSettingsChecker.php +++ b/src/Components/Health/Checker/PerformanceChecker/MysqlSettingsChecker.php @@ -37,7 +37,7 @@ private function checkGroupConcatMaxLen(HealthCollection $collection): void 'sql_group_concat_max_len', 'MySQL value group_concat_max_len', (string) $groupConcatMaxLen, - 'Atleast ' . self::MYSQL_GROUP_CONCAT_MAX_LEN, + 'min ' . self::MYSQL_GROUP_CONCAT_MAX_LEN, self::DOCUMENTATION_URL, ), ); @@ -46,15 +46,14 @@ private function checkGroupConcatMaxLen(HealthCollection $collection): void private function checkSqlMode(HealthCollection $collection): void { - /** @var string|false $sqlMode */ $sqlMode = $this->connection->fetchOne('SELECT @@sql_mode'); - if (!$sqlMode || !str_contains($sqlMode, self::MYSQL_SQL_MODE_PART)) { + if (\is_string($sqlMode) && \str_contains($sqlMode, self::MYSQL_SQL_MODE_PART)) { $collection->add( SettingsResult::error( 'sql_mode', 'MySQL value sql_mode', - (string) $sqlMode, - 'Contains ' . self::MYSQL_SQL_MODE_PART, + $sqlMode, + 'No ' . self::MYSQL_SQL_MODE_PART, self::DOCUMENTATION_URL, ), );