-
Notifications
You must be signed in to change notification settings - Fork 619
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
NPE bug while doing an update operation #948
Comments
Describe the bug To Reproduce There are two classes:
In both cases Error reproduction for Spring JdbcTemplate (see
Error reproduction for JDBC PreparedStatement (see
Expected behavior Environment (please complete the following information):
Additional context Don't need to do anything, it's a duplicate of issue #911 |
@razvanmihaescu please check that the next version will fix your issue:
|
Or use the snapshot from maven snapshots. |
@razvanmihaescu please try the latest release 3.42.0.1 |
Hello
I discovered that with the latest 2 versions of org.xerial:sqlite-jdbc -> 3.41.2.2 & 3.42.0.0, if the first new value of an update operation is null, the update itself crashes with a NPE, the issue is occuring only in this case, if the null value is for the first parameter, any index works fine.
Here is the stack trace:
xception: nullntat org.sqlite.core.CoreStatement.checkIndex(CoreStatement.java:145)ntat org.sqlite.jdbc3.JDBC3PreparedStatement.getParameterType(JDBC3PreparedStatement.java:165)ntat org.springframework.jdbc.core.StatementCreatorUtils.setNull(StatementCreatorUtils.java:253)ntat org.springframework.jdbc.core.StatementCreatorUtils.setParameterValueInternal(StatementCreatorUtils.java:234)ntat org.springframework.jdbc.core.StatementCreatorUtils.setParameterValue(StatementCreatorUtils.java:168)ntat org.springframework.jdbc.core.ArgumentPreparedStatementSetter.doSetValue(ArgumentPreparedStatementSetter.java:69)ntat org.springframework.jdbc.core.ArgumentPreparedStatementSetter.setValues(ArgumentPreparedStatementSetter.java:50)ntat org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:963)ntat org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651)ntat org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960)ntat org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015)ntat org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1025)
And also the query itself (please understand the sql dialect mistakes and everything which may look odd, because the code comes from a commercial project):
UPDATE <TABLE_NAME> SET revision=revision + 1, column2 = ?, column3 = ?, ... WHERE id = ? , [null, , , ...]
I can also provide you a version in which everything worked perfectly fine, before upgrading the sqlite library -> 3.32.3.2
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: