MySQL 9.1.0
Source Code Documentation
item_xmlfunc.cc File Reference
#include "sql/item_xmlfunc.h"
#include <assert.h>
#include <sys/types.h>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <memory>
#include "m_string.h"
#include "my_sys.h"
#include "mysql/strings/m_ctype.h"
#include "mysql/udf_registration_types.h"
#include "mysql_com.h"
#include "mysqld_error.h"
#include "sql/check_stack.h"
#include "sql/current_thd.h"
#include "sql/derror.h"
#include "sql/item.h"
#include "sql/item_cmpfunc.h"
#include "sql/item_func.h"
#include "sql/sp_pcontext.h"
#include "sql/sql_class.h"
#include "sql/sql_const.h"
#include "sql/sql_error.h"
#include "sql/sql_lex.h"

Classes

struct  MY_XPATH_LEX
 
struct  MY_XPATH_FLT
 
struct  MY_XPATH_FUNC
 
struct  MY_XPATH
 
class  Item_nodeset_func
 
class  Item_nodeset_func_rootelement
 
class  Item_nodeset_func_union
 
class  Item_nodeset_func_axisbyname
 
class  Item_nodeset_func_selfbyname
 
class  Item_nodeset_func_childbyname
 
class  Item_nodeset_func_descendantbyname
 
class  Item_nodeset_func_ancestorbyname
 
class  Item_nodeset_func_parentbyname
 
class  Item_nodeset_func_attributebyname
 
class  Item_nodeset_func_predicate
 
class  Item_nodeset_func_elementbyindex
 
class  Item_bool
 
class  Item_xpath_cast_bool
 
class  Item_xpath_cast_number
 
class  Item_nodeset_context_cache
 
class  Item_func_xpath_position
 
class  Item_func_xpath_count
 
class  Item_func_xpath_sum
 
class  Item_nodeset_to_const_comparator
 
struct  my_xpath_keyword_names_st
 
struct  MY_XML_USER_DATA
 

Macros

#define MY_XPATH_LEX_DIGITS   'd'
 
#define MY_XPATH_LEX_IDENT   'i'
 
#define MY_XPATH_LEX_STRING   's'
 
#define MY_XPATH_LEX_SLASH   '/'
 
#define MY_XPATH_LEX_LB   '['
 
#define MY_XPATH_LEX_RB   ']'
 
#define MY_XPATH_LEX_LP   '('
 
#define MY_XPATH_LEX_RP   ')'
 
#define MY_XPATH_LEX_EQ   '='
 
#define MY_XPATH_LEX_LESS   '<'
 
#define MY_XPATH_LEX_GREATER   '>'
 
#define MY_XPATH_LEX_AT   '@'
 
#define MY_XPATH_LEX_COLON   ':'
 
#define MY_XPATH_LEX_ASTERISK   '*'
 
#define MY_XPATH_LEX_DOT   '.'
 
#define MY_XPATH_LEX_VLINE   '|'
 
#define MY_XPATH_LEX_MINUS   '-'
 
#define MY_XPATH_LEX_PLUS   '+'
 
#define MY_XPATH_LEX_EXCL   '!'
 
#define MY_XPATH_LEX_COMMA   ','
 
#define MY_XPATH_LEX_DOLLAR   '$'
 
#define MY_XPATH_LEX_ERROR   'A'
 
#define MY_XPATH_LEX_EOF   'B'
 
#define MY_XPATH_LEX_AND   'C'
 
#define MY_XPATH_LEX_OR   'D'
 
#define MY_XPATH_LEX_DIV   'E'
 
#define MY_XPATH_LEX_MOD   'F'
 
#define MY_XPATH_LEX_FUNC   'G'
 
#define MY_XPATH_LEX_NODETYPE   'H'
 
#define MY_XPATH_LEX_AXIS   'I'
 
#define MY_XPATH_LEX_LE   'J'
 
#define MY_XPATH_LEX_GE   'K'
 
#define MY_XPATH_AXIS_ANCESTOR   0
 
#define MY_XPATH_AXIS_ANCESTOR_OR_SELF   1
 
#define MY_XPATH_AXIS_ATTRIBUTE   2
 
#define MY_XPATH_AXIS_CHILD   3
 
#define MY_XPATH_AXIS_DESCENDANT   4
 
#define MY_XPATH_AXIS_DESCENDANT_OR_SELF   5
 
#define MY_XPATH_AXIS_FOLLOWING   6
 
#define MY_XPATH_AXIS_FOLLOWING_SIBLING   7
 
#define MY_XPATH_AXIS_NAMESPACE   8
 
#define MY_XPATH_AXIS_PARENT   9
 
#define MY_XPATH_AXIS_PRECEDING   10
 
#define MY_XPATH_AXIS_PRECEDING_SIBLING   11
 
#define MY_XPATH_AXIS_SELF   12
 
#define my_xpath_parse_PredicateExpr(x)   my_xpath_parse_Expr((x))
 
#define my_xpath_parse_Expr(x)   my_xpath_parse_OrExpr((x))
 
#define MAX_LEVEL   256
 

Typedefs

using XPathFilter = std::vector< MY_XPATH_FLT >
 
using ActiveNodes = std::vector< bool >
 

Functions

static Itemnodeset2bool (Item *item)
 
static Item_bool_funceq_func (int oper, Item *a, Item *b)
 
static Item_bool_funceq_func_reverse (int oper, Item *a, Item *b)
 
static Itemcreate_comparator (MY_XPATH *xpath, int oper, MY_XPATH_LEX *context, Item *a, Item *b)
 
static Item_nodeset_funcnametestfunc (MY_XPATH *xpath, int type, Item *arg, const char *beg, size_t len)
 
static int my_xpath_keyword (MY_XPATH *x, struct my_xpath_keyword_names_st *keyword_names, const char *beg, const char *end)
 
static Itemcreate_func_true (MY_XPATH *, Item **, uint)
 
static Itemcreate_func_false (MY_XPATH *, Item **, uint)
 
static Itemcreate_func_not (MY_XPATH *, Item **args, uint)
 
static Itemcreate_func_ceiling (MY_XPATH *, Item **args, uint)
 
static Itemcreate_func_floor (MY_XPATH *, Item **args, uint)
 
static Itemcreate_func_bool (MY_XPATH *, Item **args, uint)
 
static Itemcreate_func_number (MY_XPATH *xpath, Item **args, uint nargs)
 
static Itemcreate_func_string_length (MY_XPATH *xpath, Item **args, uint nargs)
 
static Itemcreate_func_round (MY_XPATH *, Item **args, uint)
 
static Itemcreate_func_last (MY_XPATH *xpath, Item **, uint)
 
static Itemcreate_func_position (MY_XPATH *xpath, Item **, uint)
 
static Itemcreate_func_contains (MY_XPATH *, Item **args, uint)
 
static Itemcreate_func_concat (MY_XPATH *, Item **args, uint)
 
static Itemcreate_func_substr (MY_XPATH *, Item **args, uint nargs)
 
static Itemcreate_func_count (MY_XPATH *, Item **args, uint)
 
static Itemcreate_func_sum (MY_XPATH *xpath, Item **args, uint)
 
static MY_XPATH_FUNCmy_xpath_function (const char *beg, const char *end)
 
static void my_xpath_lex_init (MY_XPATH_LEX *lex, const char *str, const char *strend)
 
static void my_xpath_init (MY_XPATH *xpath)
 
static int my_xdigit (int c)
 
static void my_xpath_lex_scan (MY_XPATH *xpath, MY_XPATH_LEX *lex, const char *beg, const char *end)
 
static int my_xpath_parse_term (MY_XPATH *xpath, int term)
 
static int my_xpath_parse_AxisName (MY_XPATH *xpath)
 
static int my_xpath_parse_LocationPath (MY_XPATH *xpath)
 
static int my_xpath_parse_AbsoluteLocationPath (MY_XPATH *xpath)
 
static int my_xpath_parse_RelativeLocationPath (MY_XPATH *xpath)
 
static int my_xpath_parse_AbbreviatedStep (MY_XPATH *xpath)
 
static int my_xpath_parse_Step (MY_XPATH *xpath)
 
static int my_xpath_parse_AxisSpecifier (MY_XPATH *xpath)
 
static int my_xpath_parse_NodeTest (MY_XPATH *xpath)
 
static int my_xpath_parse_AbbreviatedAxisSpecifier (MY_XPATH *xpath)
 
static int my_xpath_parse_NameTest (MY_XPATH *xpath)
 
static int my_xpath_parse_FunctionCall (MY_XPATH *xpath)
 
static int my_xpath_parse_Number (MY_XPATH *xpath)
 
static int my_xpath_parse_FilterExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_PathExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_OrExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_UnaryExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_MultiplicativeExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_AdditiveExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_RelationalExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_AndExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_EqualityExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_VariableReference (MY_XPATH *xpath)
 Scan Variable reference. More...
 
static int my_xpath_parse_AxisSpecifier_NodeTest_opt_Predicate_list (MY_XPATH *xpath)
 
static int my_xpath_parse_AxisName_colon_colon (MY_XPATH *xpath)
 
static int my_xpath_parse_NodeTest_lp_rp (MY_XPATH *xpath)
 
static int my_xpath_parse_lp_Expr_rp (MY_XPATH *xpath)
 
static int my_xpath_parse_PrimaryExpr_literal (MY_XPATH *xpath)
 
static int my_xpath_parse_PrimaryExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_UnionExpr (MY_XPATH *xpath)
 
static int my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath (MY_XPATH *xpath)
 
static int my_xpath_parse_ne (MY_XPATH *xpath)
 
static int my_xpath_parse_EqualityOperator (MY_XPATH *xpath)
 
static int my_xpath_parse_RelationalOperator (MY_XPATH *xpath)
 
static int my_xpath_parse_AdditiveOperator (MY_XPATH *xpath)
 
static int my_xpath_parse_MultiplicativeOperator (MY_XPATH *xpath)
 
static int my_xpath_parse_NCName (MY_XPATH *xpath)
 
static int my_xpath_parse_QName (MY_XPATH *xpath)
 
static int my_xpath_parse_NodeTest_QName (MY_XPATH *xpath)
 
static int my_xpath_parse_NodeTest_asterisk (MY_XPATH *xpath)
 
static int my_xpath_parse (MY_XPATH *xpath, const char *str, const char *strend)
 
int xml_enter (MY_XML_PARSER *st, const char *attr, size_t len)
 
int xml_value (MY_XML_PARSER *st, const char *attr, size_t len)
 
int xml_leave (MY_XML_PARSER *st, const char *attr, size_t len)
 
static bool parse_xml (String *raw_xml, ParsedXML *parsed_xml_buf)
 

Variables

static char simpletok [128]
 
static struct my_xpath_keyword_names_st my_keyword_names []
 
static struct my_xpath_keyword_names_st my_axis_names []
 
static struct my_xpath_keyword_names_st my_nodetype_names []
 
static MY_XPATH_FUNC my_func_names3 []
 
static MY_XPATH_FUNC my_func_names4 []
 
static MY_XPATH_FUNC my_func_names5 []
 
static MY_XPATH_FUNC my_func_names6 []
 
static MY_XPATH_FUNC my_func_names []
 

Macro Definition Documentation

◆ MAX_LEVEL

#define MAX_LEVEL   256

◆ MY_XPATH_AXIS_ANCESTOR

#define MY_XPATH_AXIS_ANCESTOR   0

◆ MY_XPATH_AXIS_ANCESTOR_OR_SELF

#define MY_XPATH_AXIS_ANCESTOR_OR_SELF   1

◆ MY_XPATH_AXIS_ATTRIBUTE

#define MY_XPATH_AXIS_ATTRIBUTE   2

◆ MY_XPATH_AXIS_CHILD

#define MY_XPATH_AXIS_CHILD   3

◆ MY_XPATH_AXIS_DESCENDANT

#define MY_XPATH_AXIS_DESCENDANT   4

◆ MY_XPATH_AXIS_DESCENDANT_OR_SELF

#define MY_XPATH_AXIS_DESCENDANT_OR_SELF   5

◆ MY_XPATH_AXIS_FOLLOWING

#define MY_XPATH_AXIS_FOLLOWING   6

◆ MY_XPATH_AXIS_FOLLOWING_SIBLING

#define MY_XPATH_AXIS_FOLLOWING_SIBLING   7

◆ MY_XPATH_AXIS_NAMESPACE

#define MY_XPATH_AXIS_NAMESPACE   8

◆ MY_XPATH_AXIS_PARENT

#define MY_XPATH_AXIS_PARENT   9

◆ MY_XPATH_AXIS_PRECEDING

#define MY_XPATH_AXIS_PRECEDING   10

◆ MY_XPATH_AXIS_PRECEDING_SIBLING

#define MY_XPATH_AXIS_PRECEDING_SIBLING   11

◆ MY_XPATH_AXIS_SELF

#define MY_XPATH_AXIS_SELF   12

◆ MY_XPATH_LEX_AND

#define MY_XPATH_LEX_AND   'C'

◆ MY_XPATH_LEX_ASTERISK

#define MY_XPATH_LEX_ASTERISK   '*'

◆ MY_XPATH_LEX_AT

#define MY_XPATH_LEX_AT   '@'

◆ MY_XPATH_LEX_AXIS

#define MY_XPATH_LEX_AXIS   'I'

◆ MY_XPATH_LEX_COLON

#define MY_XPATH_LEX_COLON   ':'

◆ MY_XPATH_LEX_COMMA

#define MY_XPATH_LEX_COMMA   ','

◆ MY_XPATH_LEX_DIGITS

#define MY_XPATH_LEX_DIGITS   'd'

◆ MY_XPATH_LEX_DIV

#define MY_XPATH_LEX_DIV   'E'

◆ MY_XPATH_LEX_DOLLAR

#define MY_XPATH_LEX_DOLLAR   '$'

◆ MY_XPATH_LEX_DOT

#define MY_XPATH_LEX_DOT   '.'

◆ MY_XPATH_LEX_EOF

#define MY_XPATH_LEX_EOF   'B'

◆ MY_XPATH_LEX_EQ

#define MY_XPATH_LEX_EQ   '='

◆ MY_XPATH_LEX_ERROR

#define MY_XPATH_LEX_ERROR   'A'

◆ MY_XPATH_LEX_EXCL

#define MY_XPATH_LEX_EXCL   '!'

◆ MY_XPATH_LEX_FUNC

#define MY_XPATH_LEX_FUNC   'G'

◆ MY_XPATH_LEX_GE

#define MY_XPATH_LEX_GE   'K'

◆ MY_XPATH_LEX_GREATER

#define MY_XPATH_LEX_GREATER   '>'

◆ MY_XPATH_LEX_IDENT

#define MY_XPATH_LEX_IDENT   'i'

◆ MY_XPATH_LEX_LB

#define MY_XPATH_LEX_LB   '['

◆ MY_XPATH_LEX_LE

#define MY_XPATH_LEX_LE   'J'

◆ MY_XPATH_LEX_LESS

#define MY_XPATH_LEX_LESS   '<'

◆ MY_XPATH_LEX_LP

#define MY_XPATH_LEX_LP   '('

◆ MY_XPATH_LEX_MINUS

#define MY_XPATH_LEX_MINUS   '-'

◆ MY_XPATH_LEX_MOD

#define MY_XPATH_LEX_MOD   'F'

◆ MY_XPATH_LEX_NODETYPE

#define MY_XPATH_LEX_NODETYPE   'H'

◆ MY_XPATH_LEX_OR

#define MY_XPATH_LEX_OR   'D'

◆ MY_XPATH_LEX_PLUS

#define MY_XPATH_LEX_PLUS   '+'

◆ MY_XPATH_LEX_RB

#define MY_XPATH_LEX_RB   ']'

◆ MY_XPATH_LEX_RP

#define MY_XPATH_LEX_RP   ')'

◆ MY_XPATH_LEX_SLASH

#define MY_XPATH_LEX_SLASH   '/'

◆ MY_XPATH_LEX_STRING

#define MY_XPATH_LEX_STRING   's'

◆ MY_XPATH_LEX_VLINE

#define MY_XPATH_LEX_VLINE   '|'

◆ my_xpath_parse_Expr

#define my_xpath_parse_Expr (   x)    my_xpath_parse_OrExpr((x))

◆ my_xpath_parse_PredicateExpr

#define my_xpath_parse_PredicateExpr (   x)    my_xpath_parse_Expr((x))

Typedef Documentation

◆ ActiveNodes

using ActiveNodes = std::vector<bool>

◆ XPathFilter

using XPathFilter = std::vector<MY_XPATH_FLT>

Function Documentation

◆ create_comparator()

static Item * create_comparator ( MY_XPATH xpath,
int  oper,
MY_XPATH_LEX context,
Item a,
Item b 
)
static

◆ create_func_bool()

static Item * create_func_bool ( MY_XPATH ,
Item **  args,
uint   
)
static

◆ create_func_ceiling()

static Item * create_func_ceiling ( MY_XPATH ,
Item **  args,
uint   
)
static

◆ create_func_concat()

static Item * create_func_concat ( MY_XPATH ,
Item **  args,
uint   
)
static

◆ create_func_contains()

static Item * create_func_contains ( MY_XPATH ,
Item **  args,
uint   
)
static

◆ create_func_count()

static Item * create_func_count ( MY_XPATH ,
Item **  args,
uint   
)
static

◆ create_func_false()

static Item * create_func_false ( MY_XPATH ,
Item **  ,
uint   
)
static

◆ create_func_floor()

static Item * create_func_floor ( MY_XPATH ,
Item **  args,
uint   
)
static

◆ create_func_last()

static Item * create_func_last ( MY_XPATH xpath,
Item **  ,
uint   
)
static

◆ create_func_not()

static Item * create_func_not ( MY_XPATH ,
Item **  args,
uint   
)
static

◆ create_func_number()

static Item * create_func_number ( MY_XPATH xpath,
Item **  args,
uint  nargs 
)
static

◆ create_func_position()

static Item * create_func_position ( MY_XPATH xpath,
Item **  ,
uint   
)
static

◆ create_func_round()

static Item * create_func_round ( MY_XPATH ,
Item **  args,
uint   
)
static

◆ create_func_string_length()

static Item * create_func_string_length ( MY_XPATH xpath,
Item **  args,
uint  nargs 
)
static

◆ create_func_substr()

static Item * create_func_substr ( MY_XPATH ,
Item **  args,
uint  nargs 
)
static

◆ create_func_sum()

static Item * create_func_sum ( MY_XPATH xpath,
Item **  args,
uint   
)
static

◆ create_func_true()

static Item * create_func_true ( MY_XPATH ,
Item **  ,
uint   
)
static

◆ eq_func()

static Item_bool_func * eq_func ( int  oper,
Item a,
Item b 
)
static

◆ eq_func_reverse()

static Item_bool_func * eq_func_reverse ( int  oper,
Item a,
Item b 
)
static

◆ my_xdigit()

static int my_xdigit ( int  c)
static

◆ my_xpath_function()

static MY_XPATH_FUNC * my_xpath_function ( const char *  beg,
const char *  end 
)
static

◆ my_xpath_init()

static void my_xpath_init ( MY_XPATH xpath)
static

◆ my_xpath_keyword()

static int my_xpath_keyword ( MY_XPATH x,
struct my_xpath_keyword_names_st keyword_names,
const char *  beg,
const char *  end 
)
static

◆ my_xpath_lex_init()

static void my_xpath_lex_init ( MY_XPATH_LEX lex,
const char *  str,
const char *  strend 
)
static

◆ my_xpath_lex_scan()

static void my_xpath_lex_scan ( MY_XPATH xpath,
MY_XPATH_LEX lex,
const char *  beg,
const char *  end 
)
static

◆ my_xpath_parse()

static int my_xpath_parse ( MY_XPATH xpath,
const char *  str,
const char *  strend 
)
static

◆ my_xpath_parse_AbbreviatedAxisSpecifier()

static int my_xpath_parse_AbbreviatedAxisSpecifier ( MY_XPATH xpath)
static

◆ my_xpath_parse_AbbreviatedStep()

static int my_xpath_parse_AbbreviatedStep ( MY_XPATH xpath)
static

◆ my_xpath_parse_AbsoluteLocationPath()

static int my_xpath_parse_AbsoluteLocationPath ( MY_XPATH xpath)
static

◆ my_xpath_parse_AdditiveExpr()

static int my_xpath_parse_AdditiveExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_AdditiveOperator()

static int my_xpath_parse_AdditiveOperator ( MY_XPATH xpath)
static

◆ my_xpath_parse_AndExpr()

static int my_xpath_parse_AndExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_AxisName()

static int my_xpath_parse_AxisName ( MY_XPATH xpath)
static

◆ my_xpath_parse_AxisName_colon_colon()

static int my_xpath_parse_AxisName_colon_colon ( MY_XPATH xpath)
static

◆ my_xpath_parse_AxisSpecifier()

static int my_xpath_parse_AxisSpecifier ( MY_XPATH xpath)
static

◆ my_xpath_parse_AxisSpecifier_NodeTest_opt_Predicate_list()

static int my_xpath_parse_AxisSpecifier_NodeTest_opt_Predicate_list ( MY_XPATH xpath)
static

◆ my_xpath_parse_EqualityExpr()

static int my_xpath_parse_EqualityExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_EqualityOperator()

static int my_xpath_parse_EqualityOperator ( MY_XPATH xpath)
static

◆ my_xpath_parse_FilterExpr()

static int my_xpath_parse_FilterExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath()

static int my_xpath_parse_FilterExpr_opt_slashes_RelativeLocationPath ( MY_XPATH xpath)
static

◆ my_xpath_parse_FunctionCall()

static int my_xpath_parse_FunctionCall ( MY_XPATH xpath)
static

◆ my_xpath_parse_LocationPath()

static int my_xpath_parse_LocationPath ( MY_XPATH xpath)
static

◆ my_xpath_parse_lp_Expr_rp()

static int my_xpath_parse_lp_Expr_rp ( MY_XPATH xpath)
static

◆ my_xpath_parse_MultiplicativeExpr()

static int my_xpath_parse_MultiplicativeExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_MultiplicativeOperator()

static int my_xpath_parse_MultiplicativeOperator ( MY_XPATH xpath)
static

◆ my_xpath_parse_NameTest()

static int my_xpath_parse_NameTest ( MY_XPATH xpath)
static

◆ my_xpath_parse_NCName()

static int my_xpath_parse_NCName ( MY_XPATH xpath)
static

◆ my_xpath_parse_ne()

static int my_xpath_parse_ne ( MY_XPATH xpath)
static

◆ my_xpath_parse_NodeTest()

static int my_xpath_parse_NodeTest ( MY_XPATH xpath)
static

◆ my_xpath_parse_NodeTest_asterisk()

static int my_xpath_parse_NodeTest_asterisk ( MY_XPATH xpath)
static

◆ my_xpath_parse_NodeTest_lp_rp()

static int my_xpath_parse_NodeTest_lp_rp ( MY_XPATH xpath)
static

◆ my_xpath_parse_NodeTest_QName()

static int my_xpath_parse_NodeTest_QName ( MY_XPATH xpath)
static

◆ my_xpath_parse_Number()

static int my_xpath_parse_Number ( MY_XPATH xpath)
static

◆ my_xpath_parse_OrExpr()

static int my_xpath_parse_OrExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_PathExpr()

static int my_xpath_parse_PathExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_PrimaryExpr()

static int my_xpath_parse_PrimaryExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_PrimaryExpr_literal()

static int my_xpath_parse_PrimaryExpr_literal ( MY_XPATH xpath)
static

◆ my_xpath_parse_QName()

static int my_xpath_parse_QName ( MY_XPATH xpath)
static

◆ my_xpath_parse_RelationalExpr()

static int my_xpath_parse_RelationalExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_RelationalOperator()

static int my_xpath_parse_RelationalOperator ( MY_XPATH xpath)
static

◆ my_xpath_parse_RelativeLocationPath()

static int my_xpath_parse_RelativeLocationPath ( MY_XPATH xpath)
static

◆ my_xpath_parse_Step()

static int my_xpath_parse_Step ( MY_XPATH xpath)
static

◆ my_xpath_parse_term()

static int my_xpath_parse_term ( MY_XPATH xpath,
int  term 
)
static

◆ my_xpath_parse_UnaryExpr()

static int my_xpath_parse_UnaryExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_UnionExpr()

static int my_xpath_parse_UnionExpr ( MY_XPATH xpath)
static

◆ my_xpath_parse_VariableReference()

static int my_xpath_parse_VariableReference ( MY_XPATH xpath)
static

Scan Variable reference.

Implements parsing of two syntax structures:

  1. Standard XPath syntax [36], for SP variables:

    VariableReference ::= '$' QName

    Finds a SP variable with the given name. If outside of a SP context, or variable with the given name doesn't exists, then error is returned.

  2. Non-standard syntax - MySQL extension for user variables:

    VariableReference ::= '$' '@' QName

Item, corresponding to the variable, is returned in xpath->item in both cases.

Parameters
xpathpointer to XPath structure
Returns
Operation status
Return values
1Success
0Failure

◆ nametestfunc()

static Item_nodeset_func * nametestfunc ( MY_XPATH xpath,
int  type,
Item arg,
const char *  beg,
size_t  len 
)
static

◆ nodeset2bool()

static Item * nodeset2bool ( Item item)
static

◆ parse_xml()

static bool parse_xml ( String raw_xml,
ParsedXML parsed_xml_buf 
)
static

◆ xml_enter()

int xml_enter ( MY_XML_PARSER st,
const char *  attr,
size_t  len 
)

◆ xml_leave()

int xml_leave ( MY_XML_PARSER st,
const char *  attr,
size_t  len 
)

◆ xml_value()

int xml_value ( MY_XML_PARSER st,
const char *  attr,
size_t  len 
)

Variable Documentation

◆ my_axis_names

struct my_xpath_keyword_names_st my_axis_names[]
static
Initial value:
= {
{MY_XPATH_LEX_AXIS, "descendant-or-self", 18,
{MY_XPATH_LEX_AXIS, "following-sibling", 17,
{MY_XPATH_LEX_AXIS, "preceding-sibling", 17,
{0, nullptr, 0, 0}}
#define MY_XPATH_AXIS_SELF
Definition: item_xmlfunc.cc:758
#define MY_XPATH_AXIS_ANCESTOR
Definition: item_xmlfunc.cc:746
#define MY_XPATH_AXIS_ATTRIBUTE
Definition: item_xmlfunc.cc:748
#define MY_XPATH_AXIS_DESCENDANT
Definition: item_xmlfunc.cc:750
#define MY_XPATH_AXIS_NAMESPACE
Definition: item_xmlfunc.cc:754
#define MY_XPATH_AXIS_ANCESTOR_OR_SELF
Definition: item_xmlfunc.cc:747
#define MY_XPATH_LEX_AXIS
Definition: item_xmlfunc.cc:739
#define MY_XPATH_AXIS_CHILD
Definition: item_xmlfunc.cc:749
#define MY_XPATH_AXIS_FOLLOWING_SIBLING
Definition: item_xmlfunc.cc:753
#define MY_XPATH_AXIS_PRECEDING
Definition: item_xmlfunc.cc:756
#define MY_XPATH_AXIS_PRECEDING_SIBLING
Definition: item_xmlfunc.cc:757
#define MY_XPATH_AXIS_PARENT
Definition: item_xmlfunc.cc:755
#define MY_XPATH_AXIS_DESCENDANT_OR_SELF
Definition: item_xmlfunc.cc:751
#define MY_XPATH_AXIS_FOLLOWING
Definition: item_xmlfunc.cc:752

◆ my_func_names

MY_XPATH_FUNC my_func_names[]
static
Initial value:
= {
{"id", 2, 1, 1, nullptr},
{"boolean", 7, 1, 1, create_func_bool},
{"ceiling", 7, 1, 1, create_func_ceiling},
{"position", 8, 0, 0, create_func_position},
{"contains", 8, 2, 2, create_func_contains},
{"substring", 9, 2, 3, create_func_substr},
{"translate", 9, 3, 3, nullptr},
{"local-name", 10, 0, 1, nullptr},
{"starts-with", 11, 2, 2, nullptr},
{"namespace-uri", 13, 0, 1, nullptr},
{"string-length", 13, 0, 1, create_func_string_length},
{"substring-after", 15, 2, 2, nullptr},
{"normalize-space", 15, 0, 1, nullptr},
{"substring-before", 16, 2, 2, nullptr},
{nullptr, 0, 0, 0, nullptr}}
static Item * create_func_string_length(MY_XPATH *xpath, Item **args, uint nargs)
Definition: item_xmlfunc.cc:1045
static Item * create_func_position(MY_XPATH *xpath, Item **, uint)
Definition: item_xmlfunc.cc:1059
static Item * create_func_contains(MY_XPATH *, Item **args, uint)
Definition: item_xmlfunc.cc:1064
static Item * create_func_ceiling(MY_XPATH *, Item **args, uint)
Definition: item_xmlfunc.cc:1022
static Item * create_func_bool(MY_XPATH *, Item **args, uint)
Definition: item_xmlfunc.cc:1030
static Item * create_func_substr(MY_XPATH *, Item **args, uint nargs)
Definition: item_xmlfunc.cc:1072

◆ my_func_names3

MY_XPATH_FUNC my_func_names3[]
static
Initial value:
= {{"sum", 3, 1, 1, create_func_sum},
{"not", 3, 1, 1, create_func_not},
{nullptr, 0, 0, 0, nullptr}}
static Item * create_func_sum(MY_XPATH *xpath, Item **args, uint)
Definition: item_xmlfunc.cc:1084
static Item * create_func_not(MY_XPATH *, Item **args, uint)
Definition: item_xmlfunc.cc:1018

◆ my_func_names4

MY_XPATH_FUNC my_func_names4[]
static
Initial value:
= {{"last", 4, 0, 0, create_func_last},
{"true", 4, 0, 0, create_func_true},
{"name", 4, 0, 1, nullptr},
{"lang", 4, 1, 1, nullptr},
{nullptr, 0, 0, 0, nullptr}}
static Item * create_func_true(MY_XPATH *, Item **, uint)
Definition: item_xmlfunc.cc:1010
static Item * create_func_last(MY_XPATH *xpath, Item **, uint)
Definition: item_xmlfunc.cc:1055

◆ my_func_names5

MY_XPATH_FUNC my_func_names5[]
static
Initial value:
= {{"count", 5, 1, 1, create_func_count},
{"false", 5, 0, 0, create_func_false},
{"floor", 5, 1, 1, create_func_floor},
{"round", 5, 1, 1, create_func_round},
{nullptr, 0, 0, 0, nullptr}}
static Item * create_func_floor(MY_XPATH *, Item **args, uint)
Definition: item_xmlfunc.cc:1026
static Item * create_func_round(MY_XPATH *, Item **args, uint)
Definition: item_xmlfunc.cc:1051
static Item * create_func_false(MY_XPATH *, Item **, uint)
Definition: item_xmlfunc.cc:1014
static Item * create_func_count(MY_XPATH *, Item **args, uint)
Definition: item_xmlfunc.cc:1079

◆ my_func_names6

MY_XPATH_FUNC my_func_names6[]
static
Initial value:
= {
{"concat", 6, 2, 255, create_func_concat},
{"number", 6, 0, 1, create_func_number},
{"string", 6, 0, 1, nullptr},
{nullptr, 0, 0, 0, nullptr}}
static Item * create_func_number(MY_XPATH *xpath, Item **args, uint nargs)
Definition: item_xmlfunc.cc:1034
static Item * create_func_concat(MY_XPATH *, Item **args, uint)
Definition: item_xmlfunc.cc:1068

◆ my_keyword_names

struct my_xpath_keyword_names_st my_keyword_names[]
static
Initial value:
= {
{MY_XPATH_LEX_AND, "and", 3, 0},
{MY_XPATH_LEX_OR, "or", 2, 0},
{MY_XPATH_LEX_DIV, "div", 3, 0},
{MY_XPATH_LEX_MOD, "mod", 3, 0},
{0, nullptr, 0, 0}}
#define MY_XPATH_LEX_MOD
Definition: item_xmlfunc.cc:736
#define MY_XPATH_LEX_DIV
Definition: item_xmlfunc.cc:735
#define MY_XPATH_LEX_OR
Definition: item_xmlfunc.cc:734
#define MY_XPATH_LEX_AND
Definition: item_xmlfunc.cc:733

◆ my_nodetype_names

struct my_xpath_keyword_names_st my_nodetype_names[]
static
Initial value:
= {
{MY_XPATH_LEX_NODETYPE, "comment", 7, 0},
{MY_XPATH_LEX_NODETYPE, "text", 4, 0},
{MY_XPATH_LEX_NODETYPE, "processing-instruction", 22, 0},
{MY_XPATH_LEX_NODETYPE, "node", 4, 0},
{0, nullptr, 0, 0}}
#define MY_XPATH_LEX_NODETYPE
Definition: item_xmlfunc.cc:738

◆ simpletok

char simpletok[128]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}