Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #179 - insertion using row values #276

Merged
merged 1 commit into from
Dec 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clickhouse_driver/dbapi/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def _process_response(self, response, executemany=False):
self._rowcount = response
response = None

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

Expand Down
7 changes: 7 additions & 0 deletions tests/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ def test_rowcount_insert_from_select(self):
)
self.assertEqual(cursor.rowcount, -1)

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

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