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 for UNKNOWN DATABASE exception #344

Merged
merged 9 commits into from
Nov 1, 2023

Conversation

IlyaTsoi
Copy link
Contributor

We get a UNKNOWN DATABASE exception because a connection string uses target DB.
runQuery() tries to execute CREATE DATABASE statement within an absent context. We can use multistatement as a workaround to execute CREATE DATABASE query within a system DB context

… target DB.

`runQuery()` tries to execute `CREATE DATABASE` statement within an absent context. We can use multistatement to execute `CREATE DATABASE` query within a `system` DB context
@aadant aadant requested a review from subkanthi October 25, 2023 23:48
@subkanthi
Copy link
Collaborator

@IlyaTsoi can u please check why the test u added is failing, please pull latest from develop.

@IlyaTsoi
Copy link
Contributor Author

@IlyaTsoi can u please check why the test u added is failing, please pull latest from develop.

I did try) But I can't reproduce this error in my environment, test passes successfully.

@subkanthi
Copy link
Collaborator

@IlyaTsoi can u please check why the test u added is failing, please pull latest from develop.

I did try) But I can't reproduce this error in my environment, test passes successfully.

Error connectingjava.sql.SQLException: Connection refused (Connection refused), server ClickHouseNode [uri=http://localhost:8123/test, options={client_name=Test_1}]@630096182

instead of localhost and 8123, you should get the host and port from clickHouseContainer.

        String hostName = clickHouseContainer.getHost();
        Integer port = clickHouseContainer.getFirstMappedPort();


@Container
private ClickHouseContainer clickHouseContainer = new ClickHouseContainer("clickhouse/clickhouse-server:latest")
.withInitScript("./init_clickhouse.sql");;
Copy link
Collaborator

Choose a reason for hiding this comment

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

extra semicolon

@subkanthi subkanthi merged commit 6b61c6e into Altinity:develop Nov 1, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants