forked from ClickHouse/clickhouse-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sql comment issues in DBAPI cursor (ClickHouse#29)
- Loading branch information
Showing
3 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from sqlalchemy.engine import Engine | ||
|
||
|
||
def test_cursor_query(test_engine: Engine): | ||
query = """ | ||
-- 6dcd92a04feb50f14bbcf07c661680ba | ||
WITH dummy = 2 | ||
SELECT * FROM system.tables LIMIT 2 | ||
-- 6dcd92a04feb50f14bbcf07c661680ba | ||
""" | ||
|
||
connection = test_engine.connect() | ||
rows = list(row for row in connection.execute(query)) | ||
assert len(rows) == 2 | ||
|
||
rows = list(row for row in connection.execute('DROP TABLE IF EXISTS dummy_table')) | ||
assert rows[0][0] == 'OK' | ||
|
||
rows = list(row for row in connection.execute('describe TABLE system.columns')) | ||
assert len(rows) > 5 |