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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c51d7419
Commit
c51d7419
authored
May 03, 2006
by
bar@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/usr/home/bar/mysql-5.1-new.b18170
parents
4ba1a4b3
467052aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletion
+42
-1
mysql-test/r/xml.result
mysql-test/r/xml.result
+9
-0
mysql-test/t/xml.test
mysql-test/t/xml.test
+8
-0
sql/item_xmlfunc.cc
sql/item_xmlfunc.cc
+25
-1
No files found.
mysql-test/r/xml.result
View file @
c51d7419
...
...
@@ -665,3 +665,12 @@ CALL p2();
EXTRACTVALUE(p,'/Ñ/r')
A
DROP PROCEDURE p2;
select extractValue('<ns:element xmlns:ns="myns"/>','count(ns:element)');
extractValue('<ns:element xmlns:ns="myns"/>','count(ns:element)')
1
select extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element');
extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element')
a
select extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element/@xmlns:ns');
extractValue('<ns:element xmlns:ns="myns">a</ns:element>','/ns:element/@xmlns:ns')
myns
mysql-test/t/xml.test
View file @
c51d7419
...
...
@@ -335,3 +335,11 @@ END//
DELIMITER
;
//
CALL
p2
();
DROP
PROCEDURE
p2
;
#
# Bug#18170: XML: ExtractValue():
# XPath expression can't use QNames (colon in names)
#
select
extractValue
(
'<ns:element xmlns:ns="myns"/>'
,
'count(ns:element)'
);
select
extractValue
(
'<ns:element xmlns:ns="myns">a</ns:element>'
,
'/ns:element'
);
select
extractValue
(
'<ns:element xmlns:ns="myns">a</ns:element>'
,
'/ns:element/@xmlns:ns'
);
sql/item_xmlfunc.cc
View file @
c51d7419
...
...
@@ -2280,6 +2280,30 @@ static int my_xpath_parse_Number(MY_XPATH *xpath)
}
/*
QName grammar can be found in a separate document
http://www.w3.org/TR/REC-xml-names/#NT-QName
[6] QName ::= (Prefix ':')? LocalPart
[7] Prefix ::= NCName
[8] LocalPart ::= NCName
*/
static
int
my_xpath_parse_QName
(
MY_XPATH
*
xpath
)
{
const
char
*
beg
;
if
(
!
my_xpath_parse_term
(
xpath
,
MY_XPATH_LEX_IDENT
))
return
0
;
beg
=
xpath
->
prevtok
.
beg
;
if
(
!
my_xpath_parse_term
(
xpath
,
MY_XPATH_LEX_COLON
))
return
1
;
/* Non qualified name */
if
(
!
my_xpath_parse_term
(
xpath
,
MY_XPATH_LEX_IDENT
))
return
0
;
xpath
->
prevtok
.
beg
=
beg
;
return
1
;
}
/*
Scan Variable reference
...
...
@@ -2313,7 +2337,7 @@ my_xpath_parse_VariableReference(MY_XPATH *xpath)
static
int
my_xpath_parse_NodeTest_QName
(
MY_XPATH
*
xpath
)
{
if
(
!
my_xpath_parse_
term
(
xpath
,
MY_XPATH_LEX_IDENT
))
if
(
!
my_xpath_parse_
QName
(
xpath
))
return
0
;
DBUG_ASSERT
(
xpath
->
context
);
uint
len
=
xpath
->
prevtok
.
end
-
xpath
->
prevtok
.
beg
;
...
...
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