Skip to content

Commit 4f1fb31

Browse files
committed
up version smi2 clickhouse driver
1 parent 5f926b3 commit 4f1fb31

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"require": {
1515
"php": "^7.1",
16-
"smi2/phpClickHouse": "^0.18",
16+
"smi2/phpClickHouse": "^1.0",
1717
"doctrine/dbal": "^2.6"
1818
},
1919
"autoload": {

src/ClickHouseStatement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function closeCursor()
103103
public function columnCount()
104104
{
105105
return $this->rows
106-
? \count(\array_slice($this->rows, 0, 1)[0])
106+
? \count(current($this->rows))
107107
: 0;
108108
}
109109

tests/SelectTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,5 +203,13 @@ public function testDynamicParametersSelect()
203203
]
204204
], $stmt->fetchAll());
205205
}
206+
207+
public function testColumnCount()
208+
{
209+
$stmt = $this->connection->prepare('SELECT * FROM test_select_table');
210+
$stmt->execute();
211+
212+
$this->assertEquals(3, $stmt->columnCount());
213+
}
206214
}
207215

0 commit comments

Comments
 (0)