Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
08de2540
Commit
08de2540
authored
Sep 26, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-20674 Reuse val_native() in ExtractValue() and UpdateXML()
parent
a340af92
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
150 deletions
+141
-150
sql/item.h
sql/item.h
+0
-1
sql/item_xmlfunc.cc
sql/item_xmlfunc.cc
+102
-148
sql/item_xmlfunc.h
sql/item_xmlfunc.h
+39
-1
No files found.
sql/item.h
View file @
08de2540
...
@@ -1467,7 +1467,6 @@ class Item: public Value_source,
...
@@ -1467,7 +1467,6 @@ class Item: public Value_source,
{
{
return
type_handler
()
->
Item_val_bool
(
this
);
return
type_handler
()
->
Item_val_bool
(
this
);
}
}
virtual
String
*
val_raw
(
String
*
)
{
return
0
;
}
bool
eval_const_cond
()
bool
eval_const_cond
()
{
{
...
...
sql/item_xmlfunc.cc
View file @
08de2540
This diff is collapsed.
Click to expand it.
sql/item_xmlfunc.h
View file @
08de2540
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#define ITEM_XMLFUNC_INCLUDED
#define ITEM_XMLFUNC_INCLUDED
/* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2009, 2019, MariaDB
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
...
@@ -23,6 +24,42 @@
...
@@ -23,6 +24,42 @@
typedef
struct
my_xml_node_st
MY_XML_NODE
;
typedef
struct
my_xml_node_st
MY_XML_NODE
;
/* Structure to store nodeset elements */
class
MY_XPATH_FLT
{
public:
uint
num
;
// Absolute position in MY_XML_NODE array
uint
pos
;
// Relative position in context
uint
size
;
// Context size
public:
MY_XPATH_FLT
(
uint32
num_arg
,
uint32
pos_arg
)
:
num
(
num_arg
),
pos
(
pos_arg
),
size
(
0
)
{
}
MY_XPATH_FLT
(
uint32
num_arg
,
uint32
pos_arg
,
uint32
size_arg
)
:
num
(
num_arg
),
pos
(
pos_arg
),
size
(
size_arg
)
{
}
bool
append_to
(
Native
*
to
)
const
{
return
to
->
append
((
const
char
*
)
this
,
(
uint32
)
sizeof
(
*
this
));
}
};
class
NativeNodesetBuffer
:
public
NativeBuffer
<
16
*
sizeof
(
MY_XPATH_FLT
)
>
{
public:
const
MY_XPATH_FLT
&
element
(
uint
i
)
const
{
const
MY_XPATH_FLT
*
p
=
(
MY_XPATH_FLT
*
)
(
ptr
()
+
i
*
sizeof
(
MY_XPATH_FLT
));
return
*
p
;
}
uint32
elements
()
const
{
return
length
()
/
sizeof
(
MY_XPATH_FLT
);
}
}
;
class
Item_xml_str_func
:
public
Item_str_func
class
Item_xml_str_func
:
public
Item_str_func
{
{
protected:
protected:
...
@@ -103,7 +140,8 @@ class Item_func_xml_extractvalue: public Item_xml_str_func
...
@@ -103,7 +140,8 @@ class Item_func_xml_extractvalue: public Item_xml_str_func
class
Item_func_xml_update
:
public
Item_xml_str_func
class
Item_func_xml_update
:
public
Item_xml_str_func
{
{
String
tmp_value2
,
tmp_value3
;
NativeNodesetBuffer
tmp_native_value2
;
String
tmp_value3
;
bool
collect_result
(
String
*
str
,
bool
collect_result
(
String
*
str
,
const
MY_XML_NODE
*
cut
,
const
MY_XML_NODE
*
cut
,
const
String
*
replace
);
const
String
*
replace
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment