mirror of https://github.com/apache/lucene.git
SOLR-8799: Improve error message when tuple can't be read by SolrJ JDBC
This commit is contained in:
parent
6eea1f94c4
commit
15bf038f29
|
@ -78,7 +78,7 @@ class ResultSetImpl implements ResultSet {
|
|||
this.firstTuple = this.solrStream.read();
|
||||
this.solrStream.pushBack(firstTuple);
|
||||
} catch (IOException e) {
|
||||
throw new SQLException("Couldn't read first tuple", e);
|
||||
throw new SQLException(e);
|
||||
}
|
||||
|
||||
this.resultSetMetaData = new ResultSetMetaDataImpl(this);
|
||||
|
|
|
@ -396,6 +396,21 @@ public class JdbcTest extends AbstractFullDistribZkTestBase {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//Test error propagation
|
||||
props = new Properties();
|
||||
props.put("aggregationMode", "facet");
|
||||
try (Connection con = DriverManager.getConnection("jdbc:solr://" + zkHost + "?collection=collection1", props)) {
|
||||
try (Statement stmt = con.createStatement()) {
|
||||
try (ResultSet rs = stmt.executeQuery("select crap from collection1 group by a_s " +
|
||||
"order by sum(a_f) desc")) {
|
||||
} catch (Exception e) {
|
||||
String errorMessage = e.getMessage();
|
||||
assertTrue(errorMessage.contains("Group by queries must include atleast one aggregate function"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
testDriverMetadata();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue