-
Notifications
You must be signed in to change notification settings - Fork 25
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
Assertion error checking #39
Comments
Thank you @sualeh for this finding. Could you confirm this issue occurs when working on the metadata of a In all the cases, I suggest the method |
@maximevw Thanks for jumping on these issues quickly. Here is a project that illustrates the You will need to have Docker installed, since it uses Test Containers. |
@sualeh, thanks for providing the example. After modifying the implementation of
Now, it also works when I replace the line 51 in your example by: final ResultSet resultSet = databaseMetaData.getSchemas(null, "invalid_ks");
// returns empty ResultSet because the keyspace invalid_ks doesn't exist So, this fixes the second issue preventing to get metadata from an empty |
Awesome! Thanks for the quick work, @maximevw! |
I would love to have a release of https://github.com/ing-bank/cassandra-jdbc-wrapper with these fixes, so I can remove the additional catches I put into https://github.com/schemacrawler/SchemaCrawler. How soon do you plan to release a new version? (No pressure.) |
Hi @sualeh, |
@maximevw SchemaCrawler does a good job going deep into the JDBC metadata calls. I found the issues I reported due to SchemaCrawler test failres. Would you like to include a SchemaCrawler unit test? I can help you with that. Basically, porting CassandraTest over to your project. |
@sualeh I think it's always a good idea to enhance unit testing. So, feel free to submit a new pull request helping to improve the code coverage of this driver. |
Return false when the method isSearchable(int) is called on the metadata of a result set without table or schema name. Also, fix issue preventing to retrieve the metadata of an empty CassandraMetadataResultSet, and add null safety on some methods of CassandraResultSet and CassandraMetadataResultSet.
The fix has been integrated to the branch |
CResultSetMetaData
makes an assumption that all table names are CQL identifiers. However, for some metadata resultset, table names may be empty strings. This can cause an assertion error inCResultSetMetaData::isSearchable
. Perhaps the flatmap can check for empty table names, and do something different to prevent the assertion error? The error comes fromKeyspaceMetadata::getTable
→CqlIdentifier::fromCql
→Strings::needsDoubleQuotes
.The text was updated successfully, but these errors were encountered: