Skip to content

Commit aff3232

Browse files
committed
Resolve WITH-TOTAL problem
Sometimes request WITH TOTAL rerurn unkonwn format of response
1 parent 2717e3a commit aff3232

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/ClickHouseQuery.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,12 @@ public function queryArr($sql, $numeric_keys = false, $sess = null)
504504
} else {
505505
$s = \explode("\t", $s);
506506
if (!$numeric_keys) {
507-
$s = \array_combine($keys, $s);
507+
while(\count($s) < \count($keys)) {
508+
$s[]='';
509+
}
510+
if (\count($s) == \count($keys)) {
511+
$s = \array_combine($keys, $s);
512+
}
508513
}
509514
$this->extra[] = $s;
510515
}

0 commit comments

Comments
 (0)