We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I execute an INSERT INTO command using the httpclient, it returns an error if the insert query contains LIMIT 0.
INSERT INTO
LIMIT 0
No error. (I realize that inserting the results of a query that returns no rows is pointless, but here we are.)
> self.execute("CREATE OR REPLACE TABLE test_insert (col1 Int8) order by ();") > self.execute("INSERT INTO test_insert SELECT 1 LIMIT 0;") Traceback (most recent call last): File ".venv/lib/python3.11/site-packages/clickhouse_connect/dbapi/cursor.py", line 56, in execute query_result = self.client.query(operation, parameters) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/clickhouse_connect/driver/client.py", line 209, in query return self._query_with_context(query_context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".venv/lib/python3.11/site-packages/clickhouse_connect/driver/httpclient.py", line 210, in _query_with_context for col in json_result['meta']: ^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'json_result' where it is not associated with a value
Executing the same INSERT INTO query without LIMIT 0 works as expected and nothing is printed to terminal:
> self.execute("INSERT INTO test_insert SELECT 1;")
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
When I execute an
INSERT INTO
command using the httpclient, it returns an error if the insert query containsLIMIT 0
.Steps to reproduce
INSERT INTO
command whose query containsLIMIT 0
Expected behaviour
No error. (I realize that inserting the results of a query that returns no rows is pointless, but here we are.)
Code example
Executing the same
INSERT INTO
query withoutLIMIT 0
works as expected and nothing is printed to terminal:Configuration
Environment
ClickHouse server
The text was updated successfully, but these errors were encountered: