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

Update sqlite-jdbc to 3.41.2.2 to address CVE-2023-32697 #1667

Merged
merged 3 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ dependencies {
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.6.2')

testImplementation group: 'com.h2database', name: 'h2', version: '2.1.214'
testImplementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.32.3.3'
testImplementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.41.2.2'
testImplementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'

// Needed for BWC tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import lombok.EqualsAndHashCode;
import java.util.stream.Collectors;
import lombok.Getter;
import lombok.ToString;
import org.json.JSONPropertyName;
Expand All @@ -24,7 +25,6 @@
* query with SELECT columns or just *, order of column and row may matter or not. So the internal data structure of this
* class is passed in from outside either list or set, hash map or linked hash map etc.
*/
@EqualsAndHashCode(exclude = "databaseName")
@ToString
public class DBResult {

Expand Down Expand Up @@ -191,4 +191,24 @@ private static <T extends Comparable<T>> List<T> sort(Collection<T> collection)
return list;
}

public boolean equals(final Object o) {
if (o == this) {
return true;
}
if (!(o instanceof DBResult)) {
return false;
}
final DBResult other = (DBResult) o;
// H2 calculates the value before setting column name
// for example, for query "select 1 + 1" it returns a column named "2" instead of "1 + 1"
boolean skipColumnNameCheck = databaseName.equalsIgnoreCase("h2") || other.databaseName.equalsIgnoreCase("h2");
if (!skipColumnNameCheck && !schema.equals(other.schema)) {
return false;
}
if (skipColumnNameCheck && !schema.stream().map(Type::getType).collect(Collectors.toList())
.equals(other.schema.stream().map(Type::getType).collect(Collectors.toList()))) {
return false;
}
return dataRows.equals(other.dataRows);
}
}