Skip to content

Set default host name in ch_http_connection()#27

Merged
theory merged 1 commit into
mainfrom
issue-18
Nov 3, 2025
Merged

Set default host name in ch_http_connection()#27
theory merged 1 commit into
mainfrom
issue-18

Conversation

@theory
Copy link
Copy Markdown
Collaborator

@theory theory commented Oct 31, 2025

Otherwise, calls to clickhouse_raw_query() with a connection string that omits the host name causes an error. Using "localhost" as the default to match the default specified in the CREATE FUNCTION default. Add an empty connection string argument to a call to clickhouse_raw_query() in tests/sql/http.sql to test it.

Resolves #18.

@theory theory requested a review from serprex October 31, 2025 21:43
@theory theory self-assigned this Oct 31, 2025
@theory theory marked this pull request as ready for review October 31, 2025 21:43
Copy link
Copy Markdown
Member

@serprex serprex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we also want to fallback to localhost when !*host?

@theory
Copy link
Copy Markdown
Collaborator Author

theory commented Nov 3, 2025

Couldn't hurt, though I just tried 'host=' it and raised an error:

ERROR:  clickhouse_fdw: communication error: URL rejected: No host part in the URL

Otherwise, calls to `clickhouse_raw_query()` with a connection string
that omits the host name causes an error. Using "localhost" as the
default to match the default specified in the `CREATE FUNCTION` default.
Add an empty connection string argument to a call to
`clickhouse_raw_query()` in `tests/sql/http.sql` to test it.

Resolves #18.
@theory theory merged commit b9fd64f into main Nov 3, 2025
32 checks passed
@theory theory deleted the issue-18 branch November 3, 2025 19:29
@theory theory added the bug Something isn't working label Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clickhouse_raw_query() Panics when not host name

2 participants