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

Function my_xpath_parse_AbsoluteLocationPath

sql/item_xmlfunc.cc:1554–1572  ·  view source on GitHub ↗

Scan Absolute Location Path SYNOPSYS [2] AbsoluteLocationPath ::= '/' RelativeLocationPath? | AbbreviatedAbsoluteLocationPath [10] AbbreviatedAbsoluteLocationPath ::= '//' RelativeLocationPath We combine these two rules into one rule for better performance: [2,10] AbsoluteLocationPath ::= '/' RelativeLocationPath?

Source from the content-addressed store, hash-verified

1552 0 - failure
1553*/
1554static int my_xpath_parse_AbsoluteLocationPath(MY_XPATH *xpath)
1555{
1556 if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH))
1557 return 0;
1558
1559 xpath->context= xpath->rootelement;
1560
1561 if (my_xpath_parse_term(xpath, MY_XPATH_LEX_SLASH))
1562 {
1563 xpath->context= new Item_nodeset_func_descendantbyname(xpath->context,
1564 "*", 1,
1565 xpath->pxml, 1);
1566 return my_xpath_parse_RelativeLocationPath(xpath);
1567 }
1568
1569 my_xpath_parse_RelativeLocationPath(xpath);
1570
1571 return (xpath->error == 0);
1572}
1573
1574
1575/*

Callers 1

Calls 2

my_xpath_parse_termFunction · 0.85

Tested by

no test coverage detected