From b2cb0db7b3dabb5f934694ae828b55cfbdb37c48 Mon Sep 17 00:00:00 2001 From: usbbush Date: Mon, 16 Dec 2024 16:37:40 -0500 Subject: [PATCH] [FIX] handle NULL values in hash calculation for accurate data comparison --- src/DB/Data/LocalTableData.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DB/Data/LocalTableData.php b/src/DB/Data/LocalTableData.php index c834621..258d534 100644 --- a/src/DB/Data/LocalTableData.php +++ b/src/DB/Data/LocalTableData.php @@ -110,7 +110,7 @@ public function getChangeDiff($table, $key) { $wrapCast = function($arr, $p) { return array_map(function($el) use ($p) { - return "CAST(`{$p}`.`{$el}` AS CHAR CHARACTER SET utf8)"; + return "COALESCE(CAST(`{$p}`.`{$el}` AS CHAR CHARACTER SET utf8), '')"; }, $arr); };