db2 driver updates

This commit is contained in:
Mark Gregory
2026-11-11 10:58:11 +00:00
parent d9e83bcbcb
commit aee1fe6f14
14 changed files with 2316 additions and 27 deletions
+2 -3
View File
@@ -258,12 +258,11 @@ class Db2QueryGrammar extends Grammar
$expression = "{$function}({$column})";
// PDO_ODBC may return Db2 integer aggregates as binary data.
// Cast only the migration batch aggregate to VARCHAR.
// Cast migration batch aggregates, including custom repository tables.
if (
$function === 'max' &&
count($aggregate['columns']) === 1 &&
$aggregate['columns'][0] === 'batch' &&
$query->from === 'migrations'
$aggregate['columns'][0] === 'batch'
) {
$expression = "CAST(COALESCE({$expression}, 0) AS VARCHAR(20))";
}