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

fix: use BIT for Oracle DB instead of Boolean #6264

Merged
merged 1 commit into from Dec 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -978,10 +978,19 @@ private int updateOrInsertVulnerability(DefCveItem cve, String description) {
callUpdate.setNull(4, java.sql.Types.DOUBLE);
callUpdate.setNull(5, java.sql.Types.DOUBLE);
callUpdate.setNull(6, java.sql.Types.VARCHAR);
callUpdate.setNull(7, java.sql.Types.BOOLEAN);
callUpdate.setNull(8, java.sql.Types.BOOLEAN);
callUpdate.setNull(9, java.sql.Types.BOOLEAN);
callUpdate.setNull(10, java.sql.Types.BOOLEAN);
//TODO this is may also be an issue for MS SQL, if an issue is created we'll just need
// to create an isMsSQL flag. See todo below in setUpdateColum
if (isOracle) {
callUpdate.setNull(7, java.sql.Types.BIT);
callUpdate.setNull(8, java.sql.Types.BIT);
callUpdate.setNull(9, java.sql.Types.BIT);
callUpdate.setNull(10, java.sql.Types.BIT);
} else {
callUpdate.setNull(7, java.sql.Types.BOOLEAN);
callUpdate.setNull(8, java.sql.Types.BOOLEAN);
callUpdate.setNull(9, java.sql.Types.BOOLEAN);
callUpdate.setNull(10, java.sql.Types.BOOLEAN);
}
callUpdate.setNull(11, java.sql.Types.DOUBLE);
callUpdate.setNull(12, java.sql.Types.VARCHAR);
callUpdate.setNull(13, java.sql.Types.VARCHAR);
Expand Down Expand Up @@ -1649,7 +1658,13 @@ private void setUpdateColumn(PreparedStatement ps, int i, String value) throws S

private void setUpdateColumn(PreparedStatement ps, int i, Boolean value) throws SQLException {
if (value == null) {
ps.setNull(i, java.sql.Types.BOOLEAN);
//TODO this is may also be an issue for MS SQL, if an issue is created we'll just need
// to create an isMsSQL flag. See todo above in updateOrInsertVulnerability.
if (isOracle) {
ps.setNull(i, java.sql.Types.BIT);
} else {
ps.setNull(i, java.sql.Types.BOOLEAN);
}
} else {
ps.setBoolean(i, value);
}
Expand Down