MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / my_xpath_parse_AdditiveExpr

Function my_xpath_parse_AdditiveExpr

sql/item_xmlfunc.cc:2236–2257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2234 my_xpath_parse_term(xpath, MY_XPATH_LEX_MINUS);
2235}
2236static int my_xpath_parse_AdditiveExpr(MY_XPATH *xpath)
2237{
2238 if (!my_xpath_parse_MultiplicativeExpr(xpath))
2239 return 0;
2240
2241 while (my_xpath_parse_AdditiveOperator(xpath))
2242 {
2243 int oper= xpath->prevtok.term;
2244 Item *prev= xpath->item;
2245 if (!my_xpath_parse_MultiplicativeExpr(xpath))
2246 {
2247 xpath->error= 1;
2248 return 0;
2249 }
2250
2251 if (oper == MY_XPATH_LEX_PLUS)
2252 xpath->item= new Item_func_plus(prev, xpath->item);
2253 else
2254 xpath->item= new Item_func_minus(prev, xpath->item);
2255 };
2256 return 1;
2257}
2258
2259
2260/*

Callers 1

Tested by

no test coverage detected