Skip to content

Commit a242e74

Browse files
committed
Revert "change probe expression for mocking" since it didn't pass tests
This reverts commit 2aa3848. Failed actions run https://github.com/manticoresoftware/manticoresearch/actions/runs/19363676805
1 parent 2aa3848 commit a242e74

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/stackmock.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,10 @@ class CreateExprStackSize_c final : public StackMeasurer_c
132132
void BuildMockExpr ( int iComplexity ) final
133133
{
134134
m_sExpr.Clear();
135-
m_sExpr << "IF(attr_a IN(0,1),10,";
135+
m_sExpr << "((attr_a=0)*1)";
136136

137-
for ( int i = 1; i<iComplexity+1; ++i )
138-
m_sExpr << "IF(attr_a IN(" << i << "," << i+1 << ")," << (i+1)*10 << ",";
139-
m_sExpr << (iComplexity+2)*10 << ")";
140-
for ( int i = 0; i<iComplexity; ++i )
141-
m_sExpr << ")";
142-
143-
//IF(a IN(0,1),10,20)
144-
//IF(a IN(0,1),10,IF(a IN(1,2),20,30))
145-
//IF(a IN(0,1),10,IF(a IN(1,2),20,IF(a IN(2,3),30,40))) ...
137+
for ( int i = 1; i<iComplexity+1; ++i ) // ((attr_a=0)*1) + ((attr_b=1)*3) + ((attr_b=2)*5) + ...
138+
m_sExpr << "+((attr_b=" << i << ")*" << i * 2+1 << ")";
146139
}
147140

148141
ATTRIBUTE_NO_SANITIZE_ADDRESS void MockParseTest () final
@@ -161,6 +154,8 @@ class CreateExprStackSize_c final : public StackMeasurer_c
161154
tAttr.m_eAttrType = SPH_ATTR_INTEGER;
162155
tAttr.m_sName = "attr_a";
163156
tParams.m_tSchema.AddAttr ( tAttr, false );
157+
tAttr.m_sName = "attr_b";
158+
tParams.m_tSchema.AddAttr ( tAttr, false );
164159

165160
tParams.m_sExpr = m_sExpr.cstr();
166161

0 commit comments

Comments
 (0)