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

[jdbc] added some tests and fixes #1966

Merged
merged 18 commits into from
Dec 2, 2024
Merged

[jdbc] added some tests and fixes #1966

merged 18 commits into from
Dec 2, 2024

Conversation

chernser
Copy link
Contributor

@chernser chernser commented Nov 23, 2024

Summary

Next things are done:

  • Marked tests integration to make them run while CI build and maven install
  • Fixed required dependency on client-v2
  • Removed unnecessary dependencies from jdbc-v2
  • Made Database metadata a single instance per connection to avoid spreading connection reference
  • Fixed get server version query
  • Fixed type matching for columns with 'Nullable(...)' type
  • Fixed catalog and schema terms confusion
  • Fixed different flag values like for nullsAreSortedHigh and supportsCatalogsInIndexDefinitions
  • Fixed getTables to return schema, type
  • Fixed getTableTypes to return what is stored in DB
  • Fixed getColumns correct types, flags, precision, decimal digits ...
  • Added some DatabaseMedata tests
  • Fixed changing schema to take effect
  • Implemented getting functions
  • Implemented getting type info

Relates to: #1974

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@chernser chernser requested a review from Paultagoras November 23, 2024 03:32
@chernser chernser requested a review from mzitnik November 27, 2024 23:23
@chernser chernser marked this pull request as ready for review November 27, 2024 23:23
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
4 Security Hotspots
55.6% Coverage on New Code (required ≥ 80%)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@mshustov mshustov linked an issue Nov 29, 2024 that may be closed by this pull request
checkClosed();
StatementType type = parseStatementType(sql);

if (type == StatementType.SELECT) {
executeQuery(sql, settings);
executeQuery(sql, settings); // keep open to allow getResultSet()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we eventually close it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should be tested

  1. execute query
  2. get result set and not close
  3. execute another query
  4. get new result set
  5. try to do something on the first result set

/**
* JDBC driver specific properties. Do not include any ClickHouse client properties here.
*/
public enum DriveProperties {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be DriverProperties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, it should - we need to fix it.

}

private Connection getConnection() throws SQLException {
return DriverManager.getConnection(getEndpointString(isCloud()));
Copy link
Contributor

Choose a reason for hiding this comment

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

In theory this could be restored to just the one line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is true - but I think it is not my code.

@Paultagoras Paultagoras merged commit e8479d9 into main Dec 2, 2024
58 of 61 checks passed
@Paultagoras Paultagoras deleted the jdbc_testing_dbeaver branch December 2, 2024 07:56
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.

[jdbc-v2] Fill DatabaseMetadata object with correct information
2 participants