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

Function my_xpath_parse_OrExpr

sql/item_xmlfunc.cc:2031–2054  ·  view source on GitHub ↗

Scan Or Expression SYNOPSYS [21] OrExpr ::= AndExpr | OrExpr 'or' AndExpr RETURN 1 - success 0 - failure */

Source from the content-addressed store, hash-verified

2029 0 - failure
2030*/
2031static int my_xpath_parse_OrExpr(MY_XPATH *xpath)
2032{
2033 THD *thd= current_thd;
2034 uchar stack_top;
2035
2036 if (check_stack_overrun(thd, STACK_MIN_SIZE, &stack_top))
2037 return 1;
2038
2039 if (!my_xpath_parse_AndExpr(xpath))
2040 return 0;
2041
2042 while (my_xpath_parse_term(xpath, MY_XPATH_LEX_OR))
2043 {
2044 Item *prev= xpath->item;
2045 if (!my_xpath_parse_AndExpr(xpath))
2046 {
2047 return 0;
2048 xpath->error= 1;
2049 }
2050 xpath->item= new Item_cond_or(nodeset2bool(xpath, prev),
2051 nodeset2bool(xpath, xpath->item));
2052 }
2053 return 1;
2054}
2055
2056
2057/*

Callers

nothing calls this directly

Calls 4

check_stack_overrunFunction · 0.85
my_xpath_parse_AndExprFunction · 0.85
my_xpath_parse_termFunction · 0.85
nodeset2boolFunction · 0.85

Tested by

no test coverage detected