Skip to content

Commit cd189d5

Browse files
committed
fix: AND 1 = 1 case
1 parent e3a48c2 commit cd189d5

File tree

4 files changed

+301
-212
lines changed

4 files changed

+301
-212
lines changed

packages/cubejs-schema-compiler/parser/GenericSql.g4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ aliasField:
2222

2323
boolExp:
2424
exp |
25-
exp AND exp |
26-
exp OR exp |
27-
NOT exp
25+
boolExp AND boolExp |
26+
boolExp OR boolExp |
27+
NOT boolExp
2828
;
2929

3030
exp:

packages/cubejs-schema-compiler/parser/GenericSql.interp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ identifier
7575

7676

7777
atn:
78-
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 29, 163, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 37, 10, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 45, 10, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 7, 5, 52, 10, 5, 12, 5, 14, 5, 55, 11, 5, 3, 6, 3, 6, 5, 6, 59, 10, 6, 3, 7, 3, 7, 5, 7, 63, 10, 7, 3, 7, 5, 7, 66, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 79, 10, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 88, 10, 9, 12, 9, 14, 9, 91, 11, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 110, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 118, 10, 9, 12, 9, 14, 9, 121, 11, 9, 3, 10, 6, 10, 124, 10, 10, 13, 10, 14, 10, 125, 3, 10, 3, 10, 6, 10, 130, 10, 10, 13, 10, 14, 10, 131, 5, 10, 134, 10, 10, 3, 10, 3, 10, 6, 10, 138, 10, 10, 13, 10, 14, 10, 139, 5, 10, 142, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, 151, 10, 12, 3, 13, 3, 13, 3, 13, 7, 13, 156, 10, 13, 12, 13, 14, 13, 159, 11, 13, 3, 14, 3, 14, 3, 14, 2, 3, 16, 15, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 2, 4, 3, 2, 15, 20, 4, 2, 25, 25, 27, 27, 2, 175, 2, 36, 3, 2, 2, 2, 4, 38, 3, 2, 2, 2, 6, 46, 3, 2, 2, 2, 8, 48, 3, 2, 2, 2, 10, 58, 3, 2, 2, 2, 12, 60, 3, 2, 2, 2, 14, 78, 3, 2, 2, 2, 16, 109, 3, 2, 2, 2, 18, 141, 3, 2, 2, 2, 20, 143, 3, 2, 2, 2, 22, 150, 3, 2, 2, 2, 24, 152, 3, 2, 2, 2, 26, 160, 3, 2, 2, 2, 28, 29, 5, 4, 3, 2, 29, 30, 7, 2, 2, 3, 30, 37, 3, 2, 2, 2, 31, 32, 7, 3, 2, 2, 32, 33, 5, 4, 3, 2, 33, 34, 7, 4, 2, 2, 34, 35, 7, 2, 2, 3, 35, 37, 3, 2, 2, 2, 36, 28, 3, 2, 2, 2, 36, 31, 3, 2, 2, 2, 37, 3, 3, 2, 2, 2, 38, 39, 7, 7, 2, 2, 39, 40, 5, 8, 5, 2, 40, 41, 7, 9, 2, 2, 41, 44, 5, 6, 4, 2, 42, 43, 7, 10, 2, 2, 43, 45, 5, 14, 8, 2, 44, 42, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 5, 3, 2, 2, 2, 46, 47, 5, 12, 7, 2, 47, 7, 3, 2, 2, 2, 48, 53, 5, 10, 6, 2, 49, 50, 7, 5, 2, 2, 50, 52, 5, 10, 6, 2, 51, 49, 3, 2, 2, 2, 52, 55, 3, 2, 2, 2, 53, 51, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 9, 3, 2, 2, 2, 55, 53, 3, 2, 2, 2, 56, 59, 5, 12, 7, 2, 57, 59, 7, 8, 2, 2, 58, 56, 3, 2, 2, 2, 58, 57, 3, 2, 2, 2, 59, 11, 3, 2, 2, 2, 60, 65, 5, 24, 13, 2, 61, 63, 7, 14, 2, 2, 62, 61, 3, 2, 2, 2, 62, 63, 3, 2, 2, 2, 63, 64, 3, 2, 2, 2, 64, 66, 5, 26, 14, 2, 65, 62, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 13, 3, 2, 2, 2, 67, 79, 5, 16, 9, 2, 68, 69, 5, 16, 9, 2, 69, 70, 7, 11, 2, 2, 70, 71, 5, 16, 9, 2, 71, 79, 3, 2, 2, 2, 72, 73, 5, 16, 9, 2, 73, 74, 7, 12, 2, 2, 74, 75, 5, 16, 9, 2, 75, 79, 3, 2, 2, 2, 76, 77, 7, 13, 2, 2, 77, 79, 5, 16, 9, 2, 78, 67, 3, 2, 2, 2, 78, 68, 3, 2, 2, 2, 78, 72, 3, 2, 2, 2, 78, 76, 3, 2, 2, 2, 79, 15, 3, 2, 2, 2, 80, 81, 8, 9, 1, 2, 81, 110, 5, 24, 13, 2, 82, 83, 5, 26, 14, 2, 83, 84, 7, 3, 2, 2, 84, 89, 5, 16, 9, 2, 85, 86, 7, 5, 2, 2, 86, 88, 5, 16, 9, 2, 87, 85, 3, 2, 2, 2, 88, 91, 3, 2, 2, 2, 89, 87, 3, 2, 2, 2, 89, 90, 3, 2, 2, 2, 90, 92, 3, 2, 2, 2, 91, 89, 3, 2, 2, 2, 92, 93, 7, 4, 2, 2, 93, 110, 3, 2, 2, 2, 94, 95, 7, 23, 2, 2, 95, 96, 7, 3, 2, 2, 96, 97, 5, 16, 9, 2, 97, 98, 7, 14, 2, 2, 98, 99, 5, 26, 14, 2, 99, 100, 7, 4, 2, 2, 100, 110, 3, 2, 2, 2, 101, 110, 7, 28, 2, 2, 102, 110, 5, 18, 10, 2, 103, 110, 5, 26, 14, 2, 104, 110, 7, 24, 2, 2, 105, 106, 7, 3, 2, 2, 106, 107, 5, 16, 9, 2, 107, 108, 7, 4, 2, 2, 108, 110, 3, 2, 2, 2, 109, 80, 3, 2, 2, 2, 109, 82, 3, 2, 2, 2, 109, 94, 3, 2, 2, 2, 109, 101, 3, 2, 2, 2, 109, 102, 3, 2, 2, 2, 109, 103, 3, 2, 2, 2, 109, 104, 3, 2, 2, 2, 109, 105, 3, 2, 2, 2, 110, 119, 3, 2, 2, 2, 111, 112, 12, 12, 2, 2, 112, 113, 5, 20, 11, 2, 113, 114, 5, 16, 9, 13, 114, 118, 3, 2, 2, 2, 115, 116, 12, 11, 2, 2, 116, 118, 5, 22, 12, 2, 117, 111, 3, 2, 2, 2, 117, 115, 3, 2, 2, 2, 118, 121, 3, 2, 2, 2, 119, 117, 3, 2, 2, 2, 119, 120, 3, 2, 2, 2, 120, 17, 3, 2, 2, 2, 121, 119, 3, 2, 2, 2, 122, 124, 7, 26, 2, 2, 123, 122, 3, 2, 2, 2, 124, 125, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 125, 126, 3, 2, 2, 2, 126, 133, 3, 2, 2, 2, 127, 129, 7, 6, 2, 2, 128, 130, 7, 26, 2, 2, 129, 128, 3, 2, 2, 2, 130, 131, 3, 2, 2, 2, 131, 129, 3, 2, 2, 2, 131, 132, 3, 2, 2, 2, 132, 134, 3, 2, 2, 2, 133, 127, 3, 2, 2, 2, 133, 134, 3, 2, 2, 2, 134, 142, 3, 2, 2, 2, 135, 137, 7, 6, 2, 2, 136, 138, 7, 26, 2, 2, 137, 136, 3, 2, 2, 2, 138, 139, 3, 2, 2, 2, 139, 137, 3, 2, 2, 2, 139, 140, 3, 2, 2, 2, 140, 142, 3, 2, 2, 2, 141, 123, 3, 2, 2, 2, 141, 135, 3, 2, 2, 2, 142, 19, 3, 2, 2, 2, 143, 144, 9, 2, 2, 2, 144, 21, 3, 2, 2, 2, 145, 146, 7, 21, 2, 2, 146, 151, 7, 22, 2, 2, 147, 148, 7, 21, 2, 2, 148, 149, 7, 13, 2, 2, 149, 151, 7, 22, 2, 2, 150, 145, 3, 2, 2, 2, 150, 147, 3, 2, 2, 2, 151, 23, 3, 2, 2, 2, 152, 157, 5, 26, 14, 2, 153, 154, 7, 6, 2, 2, 154, 156, 5, 26, 14, 2, 155, 153, 3, 2, 2, 2, 156, 159, 3, 2, 2, 2, 157, 155, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 25, 3, 2, 2, 2, 159, 157, 3, 2, 2, 2, 160, 161, 9, 3, 2, 2, 161, 27, 3, 2, 2, 2, 20, 36, 44, 53, 58, 62, 65, 78, 89, 109, 117, 119, 125, 131, 133, 139, 141, 150, 157]
78+
[3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 29, 167, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, 5, 2, 37, 10, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 45, 10, 3, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 7, 5, 52, 10, 5, 12, 5, 14, 5, 55, 11, 5, 3, 6, 3, 6, 5, 6, 59, 10, 6, 3, 7, 3, 7, 5, 7, 63, 10, 7, 3, 7, 5, 7, 66, 10, 7, 3, 8, 3, 8, 3, 8, 3, 8, 5, 8, 72, 10, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 7, 8, 80, 10, 8, 12, 8, 14, 8, 83, 11, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 92, 10, 9, 12, 9, 14, 9, 95, 11, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 5, 9, 114, 10, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 7, 9, 122, 10, 9, 12, 9, 14, 9, 125, 11, 9, 3, 10, 6, 10, 128, 10, 10, 13, 10, 14, 10, 129, 3, 10, 3, 10, 6, 10, 134, 10, 10, 13, 10, 14, 10, 135, 5, 10, 138, 10, 10, 3, 10, 3, 10, 6, 10, 142, 10, 10, 13, 10, 14, 10, 143, 5, 10, 146, 10, 10, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 5, 12, 155, 10, 12, 3, 13, 3, 13, 3, 13, 7, 13, 160, 10, 13, 12, 13, 14, 13, 163, 11, 13, 3, 14, 3, 14, 3, 14, 2, 4, 14, 16, 15, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 2, 4, 3, 2, 15, 20, 4, 2, 25, 25, 27, 27, 2, 179, 2, 36, 3, 2, 2, 2, 4, 38, 3, 2, 2, 2, 6, 46, 3, 2, 2, 2, 8, 48, 3, 2, 2, 2, 10, 58, 3, 2, 2, 2, 12, 60, 3, 2, 2, 2, 14, 71, 3, 2, 2, 2, 16, 113, 3, 2, 2, 2, 18, 145, 3, 2, 2, 2, 20, 147, 3, 2, 2, 2, 22, 154, 3, 2, 2, 2, 24, 156, 3, 2, 2, 2, 26, 164, 3, 2, 2, 2, 28, 29, 5, 4, 3, 2, 29, 30, 7, 2, 2, 3, 30, 37, 3, 2, 2, 2, 31, 32, 7, 3, 2, 2, 32, 33, 5, 4, 3, 2, 33, 34, 7, 4, 2, 2, 34, 35, 7, 2, 2, 3, 35, 37, 3, 2, 2, 2, 36, 28, 3, 2, 2, 2, 36, 31, 3, 2, 2, 2, 37, 3, 3, 2, 2, 2, 38, 39, 7, 7, 2, 2, 39, 40, 5, 8, 5, 2, 40, 41, 7, 9, 2, 2, 41, 44, 5, 6, 4, 2, 42, 43, 7, 10, 2, 2, 43, 45, 5, 14, 8, 2, 44, 42, 3, 2, 2, 2, 44, 45, 3, 2, 2, 2, 45, 5, 3, 2, 2, 2, 46, 47, 5, 12, 7, 2, 47, 7, 3, 2, 2, 2, 48, 53, 5, 10, 6, 2, 49, 50, 7, 5, 2, 2, 50, 52, 5, 10, 6, 2, 51, 49, 3, 2, 2, 2, 52, 55, 3, 2, 2, 2, 53, 51, 3, 2, 2, 2, 53, 54, 3, 2, 2, 2, 54, 9, 3, 2, 2, 2, 55, 53, 3, 2, 2, 2, 56, 59, 5, 12, 7, 2, 57, 59, 7, 8, 2, 2, 58, 56, 3, 2, 2, 2, 58, 57, 3, 2, 2, 2, 59, 11, 3, 2, 2, 2, 60, 65, 5, 24, 13, 2, 61, 63, 7, 14, 2, 2, 62, 61, 3, 2, 2, 2, 62, 63, 3, 2, 2, 2, 63, 64, 3, 2, 2, 2, 64, 66, 5, 26, 14, 2, 65, 62, 3, 2, 2, 2, 65, 66, 3, 2, 2, 2, 66, 13, 3, 2, 2, 2, 67, 68, 8, 8, 1, 2, 68, 72, 5, 16, 9, 2, 69, 70, 7, 13, 2, 2, 70, 72, 5, 14, 8, 3, 71, 67, 3, 2, 2, 2, 71, 69, 3, 2, 2, 2, 72, 81, 3, 2, 2, 2, 73, 74, 12, 5, 2, 2, 74, 75, 7, 11, 2, 2, 75, 80, 5, 14, 8, 6, 76, 77, 12, 4, 2, 2, 77, 78, 7, 12, 2, 2, 78, 80, 5, 14, 8, 5, 79, 73, 3, 2, 2, 2, 79, 76, 3, 2, 2, 2, 80, 83, 3, 2, 2, 2, 81, 79, 3, 2, 2, 2, 81, 82, 3, 2, 2, 2, 82, 15, 3, 2, 2, 2, 83, 81, 3, 2, 2, 2, 84, 85, 8, 9, 1, 2, 85, 114, 5, 24, 13, 2, 86, 87, 5, 26, 14, 2, 87, 88, 7, 3, 2, 2, 88, 93, 5, 16, 9, 2, 89, 90, 7, 5, 2, 2, 90, 92, 5, 16, 9, 2, 91, 89, 3, 2, 2, 2, 92, 95, 3, 2, 2, 2, 93, 91, 3, 2, 2, 2, 93, 94, 3, 2, 2, 2, 94, 96, 3, 2, 2, 2, 95, 93, 3, 2, 2, 2, 96, 97, 7, 4, 2, 2, 97, 114, 3, 2, 2, 2, 98, 99, 7, 23, 2, 2, 99, 100, 7, 3, 2, 2, 100, 101, 5, 16, 9, 2, 101, 102, 7, 14, 2, 2, 102, 103, 5, 26, 14, 2, 103, 104, 7, 4, 2, 2, 104, 114, 3, 2, 2, 2, 105, 114, 7, 28, 2, 2, 106, 114, 5, 18, 10, 2, 107, 114, 5, 26, 14, 2, 108, 114, 7, 24, 2, 2, 109, 110, 7, 3, 2, 2, 110, 111, 5, 16, 9, 2, 111, 112, 7, 4, 2, 2, 112, 114, 3, 2, 2, 2, 113, 84, 3, 2, 2, 2, 113, 86, 3, 2, 2, 2, 113, 98, 3, 2, 2, 2, 113, 105, 3, 2, 2, 2, 113, 106, 3, 2, 2, 2, 113, 107, 3, 2, 2, 2, 113, 108, 3, 2, 2, 2, 113, 109, 3, 2, 2, 2, 114, 123, 3, 2, 2, 2, 115, 116, 12, 12, 2, 2, 116, 117, 5, 20, 11, 2, 117, 118, 5, 16, 9, 13, 118, 122, 3, 2, 2, 2, 119, 120, 12, 11, 2, 2, 120, 122, 5, 22, 12, 2, 121, 115, 3, 2, 2, 2, 121, 119, 3, 2, 2, 2, 122, 125, 3, 2, 2, 2, 123, 121, 3, 2, 2, 2, 123, 124, 3, 2, 2, 2, 124, 17, 3, 2, 2, 2, 125, 123, 3, 2, 2, 2, 126, 128, 7, 26, 2, 2, 127, 126, 3, 2, 2, 2, 128, 129, 3, 2, 2, 2, 129, 127, 3, 2, 2, 2, 129, 130, 3, 2, 2, 2, 130, 137, 3, 2, 2, 2, 131, 133, 7, 6, 2, 2, 132, 134, 7, 26, 2, 2, 133, 132, 3, 2, 2, 2, 134, 135, 3, 2, 2, 2, 135, 133, 3, 2, 2, 2, 135, 136, 3, 2, 2, 2, 136, 138, 3, 2, 2, 2, 137, 131, 3, 2, 2, 2, 137, 138, 3, 2, 2, 2, 138, 146, 3, 2, 2, 2, 139, 141, 7, 6, 2, 2, 140, 142, 7, 26, 2, 2, 141, 140, 3, 2, 2, 2, 142, 143, 3, 2, 2, 2, 143, 141, 3, 2, 2, 2, 143, 144, 3, 2, 2, 2, 144, 146, 3, 2, 2, 2, 145, 127, 3, 2, 2, 2, 145, 139, 3, 2, 2, 2, 146, 19, 3, 2, 2, 2, 147, 148, 9, 2, 2, 2, 148, 21, 3, 2, 2, 2, 149, 150, 7, 21, 2, 2, 150, 155, 7, 22, 2, 2, 151, 152, 7, 21, 2, 2, 152, 153, 7, 13, 2, 2, 153, 155, 7, 22, 2, 2, 154, 149, 3, 2, 2, 2, 154, 151, 3, 2, 2, 2, 155, 23, 3, 2, 2, 2, 156, 161, 5, 26, 14, 2, 157, 158, 7, 6, 2, 2, 158, 160, 5, 26, 14, 2, 159, 157, 3, 2, 2, 2, 160, 163, 3, 2, 2, 2, 161, 159, 3, 2, 2, 2, 161, 162, 3, 2, 2, 2, 162, 25, 3, 2, 2, 2, 163, 161, 3, 2, 2, 2, 164, 165, 9, 3, 2, 2, 165, 27, 3, 2, 2, 2, 22, 36, 44, 53, 58, 62, 65, 71, 79, 81, 93, 113, 121, 123, 129, 135, 137, 143, 145, 154, 161]

0 commit comments

Comments
 (0)