Skip to content

Commit

Permalink
Fix PR #276
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Dec 26, 2021
1 parent d60603c commit a91b7c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions clickhouse_driver/dbapi/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def _process_response(self, response, executemany=False):

if not response or isinstance(response, int):
self._columns = self._types = self._rows = []
if isinstance(response, int):
self._rowcount = response
return

if self._stream_results:
Expand Down
6 changes: 2 additions & 4 deletions tests/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ def test_rowcount_insert_from_select(self):

def test_execute_insert(self):
with self.created_cursor() as cursor, self.create_table('a UInt8'):
cursor.execute(
'INSERT INTO test VALUES',
parameters=[[1]]
)
cursor.execute('INSERT INTO test VALUES', [[4]])
self.assertEqual(cursor.rowcount, 1)

def test_description(self):
with self.created_cursor() as cursor:
Expand Down

0 comments on commit a91b7c5

Please sign in to comment.