Skip to content

Commit

Permalink
[CALCITE-1699] Statement may be null
Browse files Browse the repository at this point in the history
Per Javadoc, when the ResultSet that created a Statement
was created from a DatabaseMetaData call, the Statement
may be null.

Closes apache#403
  • Loading branch information
joshelser committed Mar 19, 2017
1 parent 0e11746 commit 554d963
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.Statement;
import java.util.Objects;

/**
* All we know about a statement. Encapsulates a {@link ResultSet}.
Expand All @@ -37,7 +36,8 @@ public class StatementInfo {
private boolean resultsInitialized = false;

public StatementInfo(Statement statement) {
this.statement = Objects.requireNonNull(statement);
// May be null when coming from a DatabaseMetaData call
this.statement = statement;
}

// Visible for testing
Expand Down

0 comments on commit 554d963

Please sign in to comment.