Skip to content

Commit 93462d9

Browse files
committed
[SQLite] Ignore cases where we cannot get an expected result for a cast
1 parent 73214e9 commit 93462d9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/sqlancer/sqlite3/ast/SQLite3Expression.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,17 +1630,25 @@ public static ConstantTuple applyAffinities(TypeAffinity leftAffinity, TypeAffin
16301630
if (leftAffinity.isNumeric() && (rightAffinity == TypeAffinity.TEXT || rightAffinity == TypeAffinity.BLOB
16311631
|| rightAffinity == TypeAffinity.NONE)) {
16321632
right = right.applyNumericAffinity();
1633+
assert right != null;
16331634
} else if (rightAffinity.isNumeric() && (leftAffinity == TypeAffinity.TEXT || leftAffinity == TypeAffinity.BLOB
16341635
|| leftAffinity == TypeAffinity.NONE)) {
16351636
left = left.applyNumericAffinity();
1637+
assert left != null;
16361638
}
16371639

16381640
// If one operand has TEXT affinity and the other has no affinity, then TEXT
16391641
// affinity is applied to the other operand.
16401642
if (leftAffinity == TypeAffinity.TEXT && rightAffinity == TypeAffinity.NONE) {
16411643
right = right.applyTextAffinity();
1644+
if (right == null) {
1645+
throw new IgnoreMeException();
1646+
}
16421647
} else if (rightAffinity == TypeAffinity.TEXT && leftAffinity == TypeAffinity.NONE) {
16431648
left = left.applyTextAffinity();
1649+
if (left == null) {
1650+
throw new IgnoreMeException();
1651+
}
16441652
}
16451653
return new ConstantTuple(left, right);
16461654
}

0 commit comments

Comments
 (0)