diff options
author | bar@mysql.com <> | 2006-04-14 13:57:46 +0500 |
---|---|---|
committer | bar@mysql.com <> | 2006-04-14 13:57:46 +0500 |
commit | e75d52711abac1db16bff53fbc586926d8fc360b (patch) | |
tree | 6195f282f87bbee31132482d710da655971082e4 /sql | |
parent | 6f5999e9b5ffa775e8d3c0510e8b2c6a6ef2b1e7 (diff) | |
parent | ed6899c64f11817c035d6c54f33185c08f2c02dc (diff) | |
download | mariadb-git-e75d52711abac1db16bff53fbc586926d8fc360b.tar.gz |
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/usr/home/bar/mysql-5.1-new.b16319
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_xmlfunc.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index 71900c26c2d..6e5941cccf9 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -1133,6 +1133,13 @@ static Item *create_func_number(MY_XPATH *xpath, Item **args, uint nargs) } +static Item *create_func_string_length(MY_XPATH *xpath, Item **args, uint nargs) +{ + Item *arg= nargs ? args[0] : xpath->context; + return arg ? new Item_func_char_length(arg) : 0; +} + + static Item *create_func_round(MY_XPATH *xpath, Item **args, uint nargs) { return new Item_func_round(args[0], new Item_int((char*)"0",0,1),0); @@ -1243,9 +1250,11 @@ static MY_XPATH_FUNC my_func_names[] = {"substring" , 9 , 2 , 3 , create_func_substr}, {"translate" , 9 , 3 , 3 , 0}, + {"local-name" , 10 , 0 , 1 , 0}, {"starts-with" , 11 , 2 , 2 , 0}, {"namespace-uri" , 13 , 0 , 1 , 0}, + {"string-length" , 13 , 0 , 1 , create_func_string_length}, {"substring-after" , 15 , 2 , 2 , 0}, {"normalize-space" , 15 , 0 , 1 , 0}, {"substring-before" , 16 , 2 , 2 , 0}, @@ -1837,7 +1846,12 @@ static int my_xpath_parse_FunctionCall(MY_XPATH *xpath) for (nargs= 0 ; nargs < func->maxargs; ) { if (!my_xpath_parse_Expr(xpath)) - return 0; + { + if (nargs < func->minargs) + return 0; + else + goto right_paren; + } args[nargs++]= xpath->item; if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_COMMA)) { @@ -1847,6 +1861,8 @@ static int my_xpath_parse_FunctionCall(MY_XPATH *xpath) break; } } + +right_paren: if (!my_xpath_parse_term(xpath, MY_XPATH_LEX_RP)) return 0; |