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

NullPointerException when query null date column #1253

Closed
shgohh opened this issue Feb 5, 2020 · 4 comments
Closed

NullPointerException when query null date column #1253

shgohh opened this issue Feb 5, 2020 · 4 comments

Comments

@shgohh
Copy link

shgohh commented Feb 5, 2020

Driver version

Microsoft JDBC Driver 8.2

SQL Server version

Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64)

Client Operating System

Windows 10

JAVA/JVM version

jdk-13.0.2

Table schema

create table test_date (date_col date);
insert into test_date(date_col) values(null);

Problem description

NullPointerException was thrown when the following query was executed:-
select * from test_date;

  1. Expected behaviour: one row return, date_col column is null
  2. Actual behaviour: NullPointerException was thrown
  3. Error message/stack trace:
    java.sql.SQLException: java.lang.NullPointerException
    at workbench.storage.reader.RowDataReader.readColumnData(RowDataReader.java:411)
    at workbench.storage.reader.RowDataReader.read(RowDataReader.java:267)
    at workbench.storage.DataStore.initData(DataStore.java:1461)
    at workbench.storage.DataStore.initData(DataStore.java:1398)
    at workbench.sql.SqlCommand.processResults(SqlCommand.java:801)
    at workbench.sql.commands.SelectCommand.execute(SelectCommand.java:148)
    at workbench.sql.StatementRunner.runStatement(StatementRunner.java:552)
    at workbench.gui.sql.SqlPanel.displayResult(SqlPanel.java:3479)
    at workbench.gui.sql.SqlPanel.runStatement(SqlPanel.java:2210)
    at workbench.gui.sql.SqlPanel$16.run(SqlPanel.java:2148)
    Caused by: java.lang.NullPointerException
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getObject(SQLServerResultSet.java:2400)
    at workbench.storage.reader.ResultSetHolder.getObject(ResultSetHolder.java:145)
    at workbench.storage.reader.RowDataReader.readDateValue(RowDataReader.java:507)
    at workbench.storage.reader.RowDataReader.readColumnData(RowDataReader.java:293)
    ... 9 more
  4. Any other details that can be helpful:
@mprins
Copy link

mprins commented Feb 5, 2020

duplicate of #1249

@ulvii
Copy link
Contributor

ulvii commented Feb 5, 2020

Hi @shgohh ,
We are aware of the issue. Would you try the jar files @peterbae attached to #1249 ?

@shgohh
Copy link
Author

shgohh commented Feb 6, 2020

Hi @ulvii ,
Yes, problem fixed in github-1249.zip, please consider to release new version, otherwise latest version 8.2 is just useless.

@ulvii
Copy link
Contributor

ulvii commented Feb 27, 2020

Hi @shgohh ,

The issue is now fixed in 8.2.1 release, which can be downloaded from Download Center, Maven, GitHub.

@ulvii ulvii closed this as completed Feb 27, 2020
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

No branches or pull requests

3 participants