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 calling getObject() #3995

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

NullPointerException when calling getObject() #3995

monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2016-04-27 14:56:46 +0200
From: monetdb
To: clients devs <>
Version: 11.21.19 (Jul2015-SP4)
CC: martin.van.dinther

Last updated: 2016-06-23 10:24:40 +0200

Comment 22101

Date: 2016-04-27 14:56:46 +0200
From: monetdb

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36
Build Identifier:

nl.cwi.monetdb.jdbc.MonetResultSet.getObject(MonetResultSet.java:1945)

Reproducible: Always

Steps to Reproduce:

1.using jetbrains datagrip, this error occurs after connection

I fixed the driver source code by inserting at line 1945 (it is a copy/paste of the already existing code at line 1579) :

	/* statement is null for virtual result sets such as the ones that hold generated keys */
	if (this.getStatement() == null) {
		return getObject(columnName, new HashMap<String, Class<?>>());
	}

btw, is there a repository we can contribute to ?

Comment 22136

Date: 2016-05-12 12:44:32 +0200
From: MonetDB Mercurial Repository <>

Changeset 92ae5904dd8d made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=92ae5904dd8d

Changeset description:

Fix for Bug #3995

Comment 22137

Date: 2016-05-12 12:57:19 +0200
From: Martin van Dinther <<martin.van.dinther>>

Thanks for reporting the issue.

As you can see in the changeset I used a different solution which is more in line with all the others getXxxx(String ColumnName) methods.
It will call the getObject(int columnIndex) method which already has the logic for dealing with:
if (this.getStatement() == null) { ...
So no need to duplicate that logic and code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant