Commit d406c600 authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/data0/bk/mysql-5.1

into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt

parents 5e2babfe ceb050a8
......@@ -704,3 +704,9 @@ 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
select extractValue('<foo><foo.bar>Data</foo.bar><something>Otherdata</something></foo>','/foo/foo.bar');
extractValue('<foo><foo.bar>Data</foo.bar><something>Otherdata</something></foo>','/foo/foo.bar')
Data
select extractValue('<foo><foo.bar>Data</foo.bar><something>Otherdata</something></foo>','/foo/something');
extractValue('<foo><foo.bar>Data</foo.bar><something>Otherdata</something></foo>','/foo/something')
Otherdata
......@@ -354,3 +354,9 @@ DROP PROCEDURE p2;
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');
#
# Bug#20795 extractvalue() won't accept names containing a dot (.)
#
select extractValue('<foo><foo.bar>Data</foo.bar><something>Otherdata</something></foo>','/foo/foo.bar');
select extractValue('<foo><foo.bar>Data</foo.bar><something>Otherdata</something></foo>','/foo/something');
......@@ -1356,7 +1356,8 @@ my_xpath_lex_scan(MY_XPATH *xpath,
(length= xpath->cs->cset->ctype(xpath->cs, &ctype,
(const uchar*) beg,
(const uchar*) end)) > 0 &&
((ctype & (_MY_L | _MY_U | _MY_NMR)) || *beg == '_' || *beg == '-') ;
((ctype & (_MY_L | _MY_U | _MY_NMR)) ||
*beg == '_' || *beg == '-' || *beg == '.') ;
beg+= length) /* no op */;
lex->end= beg;
......
......@@ -80,35 +80,35 @@ struct my_cs_file_section_st
static struct my_cs_file_section_st sec[] =
{
{_CS_MISC, "xml"},
{_CS_MISC, "xml.version"},
{_CS_MISC, "xml.encoding"},
{_CS_MISC, "xml/version"},
{_CS_MISC, "xml/encoding"},
{_CS_MISC, "charsets"},
{_CS_MISC, "charsets.max-id"},
{_CS_CHARSET, "charsets.charset"},
{_CS_PRIMARY_ID, "charsets.charset.primary-id"},
{_CS_BINARY_ID, "charsets.charset.binary-id"},
{_CS_CSNAME, "charsets.charset.name"},
{_CS_FAMILY, "charsets.charset.family"},
{_CS_CSDESCRIPT, "charsets.charset.description"},
{_CS_MISC, "charsets.charset.alias"},
{_CS_MISC, "charsets.charset.ctype"},
{_CS_CTYPEMAP, "charsets.charset.ctype.map"},
{_CS_MISC, "charsets.charset.upper"},
{_CS_UPPERMAP, "charsets.charset.upper.map"},
{_CS_MISC, "charsets.charset.lower"},
{_CS_LOWERMAP, "charsets.charset.lower.map"},
{_CS_MISC, "charsets.charset.unicode"},
{_CS_UNIMAP, "charsets.charset.unicode.map"},
{_CS_COLLATION, "charsets.charset.collation"},
{_CS_COLNAME, "charsets.charset.collation.name"},
{_CS_ID, "charsets.charset.collation.id"},
{_CS_ORDER, "charsets.charset.collation.order"},
{_CS_FLAG, "charsets.charset.collation.flag"},
{_CS_COLLMAP, "charsets.charset.collation.map"},
{_CS_RESET, "charsets.charset.collation.rules.reset"},
{_CS_DIFF1, "charsets.charset.collation.rules.p"},
{_CS_DIFF2, "charsets.charset.collation.rules.s"},
{_CS_DIFF3, "charsets.charset.collation.rules.t"},
{_CS_MISC, "charsets/max-id"},
{_CS_CHARSET, "charsets/charset"},
{_CS_PRIMARY_ID, "charsets/charset/primary-id"},
{_CS_BINARY_ID, "charsets/charset/binary-id"},
{_CS_CSNAME, "charsets/charset/name"},
{_CS_FAMILY, "charsets/charset/family"},
{_CS_CSDESCRIPT, "charsets/charset/description"},
{_CS_MISC, "charsets/charset/alias"},
{_CS_MISC, "charsets/charset/ctype"},
{_CS_CTYPEMAP, "charsets/charset/ctype/map"},
{_CS_MISC, "charsets/charset/upper"},
{_CS_UPPERMAP, "charsets/charset/upper/map"},
{_CS_MISC, "charsets/charset/lower"},
{_CS_LOWERMAP, "charsets/charset/lower/map"},
{_CS_MISC, "charsets/charset/unicode"},
{_CS_UNIMAP, "charsets/charset/unicode/map"},
{_CS_COLLATION, "charsets/charset/collation"},
{_CS_COLNAME, "charsets/charset/collation/name"},
{_CS_ID, "charsets/charset/collation/id"},
{_CS_ORDER, "charsets/charset/collation/order"},
{_CS_FLAG, "charsets/charset/collation/flag"},
{_CS_COLLMAP, "charsets/charset/collation/map"},
{_CS_RESET, "charsets/charset/collation/rules/reset"},
{_CS_DIFF1, "charsets/charset/collation/rules/p"},
{_CS_DIFF2, "charsets/charset/collation/rules/s"},
{_CS_DIFF3, "charsets/charset/collation/rules/t"},
{0, NULL}
};
......
......@@ -159,7 +159,7 @@ static int my_xml_enter(MY_XML_PARSER *st, const char *str, uint len)
}
if (st->attrend > st->attr)
{
st->attrend[0]='.';
st->attrend[0]= '/';
st->attrend++;
}
memcpy(st->attrend,str,len);
......@@ -188,9 +188,9 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, uint slen)
char g[32];
int rc;
/* Find previous '.' or beginning */
for( e=p->attrend; (e>p->attr) && (e[0] != '.') ; e--);
glen = (uint) ((e[0] == '.') ? (p->attrend-e-1) : p->attrend-e);
/* Find previous '/' or beginning */
for( e=p->attrend; (e>p->attr) && (e[0] != '/') ; e--);
glen = (uint) ((e[0] == '/') ? (p->attrend-e-1) : p->attrend-e);
if (str && (slen != glen))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment