@@ -51,13 +51,15 @@ func (ctx *normalizeQueryContext) applyColIndexToFields(q *SoqlQuery, fields []S
51
51
}
52
52
}
53
53
case SoqlFieldInfo_Function :
54
- ctx .applyColIndexToFields (q , fields [i ].Parameters )
54
+ if err := ctx .applyColIndexToFields (q , fields [i ].Parameters ); err != nil {
55
+ return err
56
+ }
55
57
}
56
58
}
57
59
return nil
58
60
}
59
61
60
- func (ctx * normalizeQueryContext ) applyColIndexToConditions (q * SoqlQuery , conditions []SoqlCondition ) {
62
+ func (ctx * normalizeQueryContext ) applyColIndexToConditions (q * SoqlQuery , conditions []SoqlCondition ) error {
61
63
for i := range conditions {
62
64
if conditions [i ].Opcode == SoqlConditionOpcode_FieldInfo {
63
65
switch conditions [i ].Value .Type {
@@ -68,10 +70,13 @@ func (ctx *normalizeQueryContext) applyColIndexToConditions(q *SoqlQuery, condit
68
70
conditions [i ].Value .ColIndex = - 1
69
71
}
70
72
case SoqlFieldInfo_Function :
71
- ctx .applyColIndexToFields (q , conditions [i ].Value .Parameters )
73
+ if err := ctx .applyColIndexToFields (q , conditions [i ].Value .Parameters ); err != nil {
74
+ return err
75
+ }
72
76
}
73
77
}
74
78
}
79
+ return nil
75
80
}
76
81
77
82
func (ctx * normalizeQueryContext ) applyColIndexToOrders (orderBy []SoqlOrderByInfo ) {
@@ -84,15 +89,25 @@ func (ctx *normalizeQueryContext) applyColIndexToOrders(orderBy []SoqlOrderByInf
84
89
}
85
90
}
86
91
87
- func (ctx * normalizeQueryContext ) applyColIndex (q * SoqlQuery ) {
92
+ func (ctx * normalizeQueryContext ) applyColIndex (q * SoqlQuery ) error {
88
93
89
- ctx .applyColIndexToFields (q , q .Fields )
94
+ if err := ctx .applyColIndexToFields (q , q .Fields ); err != nil {
95
+ return err
96
+ }
90
97
91
98
ctx .applyColIndexToOrders (q .OrderBy )
92
99
93
- ctx .applyColIndexToFields (q , q .GroupBy )
100
+ if err := ctx .applyColIndexToFields (q , q .GroupBy ); err != nil {
101
+ return err
102
+ }
94
103
95
- ctx .applyColIndexToConditions (q , q .Where )
104
+ if err := ctx .applyColIndexToConditions (q , q .Where ); err != nil {
105
+ return err
106
+ }
107
+
108
+ if err := ctx .applyColIndexToConditions (q , q .Having ); err != nil {
109
+ return err
110
+ }
96
111
97
- ctx . applyColIndexToConditions ( q , q . Having )
112
+ return nil
98
113
}
0 commit comments