huosenyuan commented on issue #9252:
URL: https://github.com/apache/shardingsphere/issues/9252#issuecomment-773809394
~~~
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-sql-parser-hsqldb</artifactId>
<version>5.0.0-RC1-SNAPSHOT</version>
</dependency>
~~~
After I customize the hsql dialect, I execute the query SQL, and a null
pointer appears here. This is my modified code. I don't know if it's a bug
~~~
package org.apache.shardingsphere.driver.jdbc.core.resultset;
...
/**
* ShardingSphere result set.
*/
public final class ShardingSphereResultSet extends AbstractResultSetAdapter {
private final MergedResult mergeResultSet;
private final Map<String, Integer> columnLabelAndIndexMap;
public ShardingSphereResultSet(final List<ResultSet> resultSets, final
MergedResult mergeResultSet, final Statement statement, final ExecutionContext
executionContext) throws SQLException {
super(resultSets, statement, executionContext);
if (Objects.nonNull(resultSets.get(0))) {
this.mergeResultSet = mergeResultSet;
this.columnLabelAndIndexMap = createColumnLabelAndIndexMap(
resultSets.get(0).getMetaData());
} else {
this.columnLabelAndIndexMap = new HashMap<>();
this.mergeResultSet = new MergedResult() {
@Override
public boolean next() throws SQLException {
return false;
}
@Override
public Object getValue(int columnIndex, Class<?> type)
throws SQLException {
return null;
}
@Override
public Object getCalendarValue(int columnIndex, Class<?>
type, Calendar calendar) throws SQLException {
return null;
}
@Override
public InputStream getInputStream(int columnIndex, String
type) throws SQLException {
return null;
}
@Override
public boolean wasNull() throws SQLException {
return true;
}
};
}
}
~~~
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]