mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Fix true update queries for blobs.
This commit is contained in:
committed by
Cody Henthorne
parent
0ca438ed25
commit
0359f27cd9
@@ -18,6 +18,7 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -122,8 +123,14 @@ public final class SqlUtil {
|
||||
|
||||
for (Map.Entry<String, Object> entry : valueSet) {
|
||||
if (entry.getValue() != null) {
|
||||
qualifier.append(entry.getKey()).append(" != ? OR ").append(entry.getKey()).append(" IS NULL");
|
||||
fullArgs.add(String.valueOf(entry.getValue()));
|
||||
if (entry.getValue() instanceof byte[]) {
|
||||
byte[] data = (byte[]) entry.getValue();
|
||||
qualifier.append("hex(").append(entry.getKey()).append(") != ? OR ").append(entry.getKey()).append(" IS NULL");
|
||||
fullArgs.add(Hex.toStringCondensed(data).toUpperCase(Locale.US));
|
||||
} else {
|
||||
qualifier.append(entry.getKey()).append(" != ? OR ").append(entry.getKey()).append(" IS NULL");
|
||||
fullArgs.add(String.valueOf(entry.getValue()));
|
||||
}
|
||||
} else {
|
||||
qualifier.append(entry.getKey()).append(" NOT NULL");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user