github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/sql/opt/memo/testdata/expr (about) 1 # Test nullability of scalar expressions. 2 scalar-is-not-nullable 3 true AND false 4 ---- 5 true 6 7 scalar-is-not-nullable vars=(int) 8 @1 >= 5 9 ---- 10 false 11 12 scalar-is-not-nullable vars=(int!null) 13 @1 >= 5 14 ---- 15 true 16 17 scalar-is-not-nullable vars=(int!null, int!null) 18 @1 >= 5 AND @1 <= 10 AND @2 < 4 19 ---- 20 true 21 22 scalar-is-not-nullable vars=(int!null, int) 23 @1 >= 5 AND @1 <= 10 AND @2 < 4 24 ---- 25 false 26 27 scalar-is-not-nullable vars=(int!null) 28 @1 >= 5 AND @1 IN (1, 2) 29 ---- 30 true 31 32 scalar-is-not-nullable vars=(int!null) 33 @1 >= 5 AND @1 IN (1, 2, NULL) 34 ---- 35 false 36 37 scalar-is-not-nullable vars=(int!null, int!null) 38 CASE WHEN @1 >= 5 THEN @1 <= 10 ELSE @2 < 4 END 39 ---- 40 true 41 42 scalar-is-not-nullable vars=(int!null, int!null) 43 CASE WHEN @1 >= 5 THEN @1 <= 10 ELSE (@2 IN (4, NULL)) END 44 ---- 45 false