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

Function my_xpath_parse_FunctionCall

sql/item_xmlfunc.cc:1868–1904  ·  view source on GitHub ↗

Scan Function Call SYNOPSYS [16] FunctionCall ::= FunctionName '(' ( Argument ( ',' Argument )* )? ')' [17] Argument ::= Expr (RECURSIVE) [14] Expr ::= OrExpr reduced to: [16b] FunctionCall ::= FunctionName '(' ( OrExpr ( ',' OrExpr )* )? ')' (RECURSIVE) RETURN 1 - success 0 - failure */

Source from the content-addressed store, hash-verified

1866
1867*/
1868static int my_xpath_parse_FunctionCall(MY_XPATH *xpath)
1869{
1870 Item *args[256];
1871 uint nargs;
1872
1873 if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_FUNC))
1874 return 0;
1875
1876 MY_XPATH_FUNC *func= xpath->func;
1877
1878 if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_LP))
1879 return 0;
1880
1881 for (nargs= 0 ; nargs < func->maxargs; )
1882 {
1883 if (!my_xpath_parse_Expr(xpath))
1884 {
1885 if (nargs < func->minargs)
1886 return 0;
1887 goto right_paren;
1888 }
1889 args[nargs++]= xpath->item;
1890 if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_COMMA))
1891 {
1892 if (nargs < func->minargs)
1893 return 0;
1894 else
1895 break;
1896 }
1897 }
1898
1899right_paren:
1900 if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_RP))
1901 return 0;
1902
1903 return ((xpath->item= func->create(xpath, args, nargs))) ? 1 : 0;
1904}
1905
1906
1907/*

Callers 1

Calls 2

my_xpath_parse_termFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected