From: bar Date: July 25 2006 1:46pm Subject: bk commit into 5.1 tree (bar:1.2265) BUG#20795 List-Archive: http://lists.mysql.com/commits/9539 X-Bug: 20795 Message-Id: <200607251346.k6PDkqAM085347@bar.intranet.mysql.r18.ru> Below is the list of changes that have just been committed into a local 5.1 repository of bar. When bar does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2006-07-25 18:46:43+05:00, bar@stripped +5 -0 Bug#20795: extractvalue() won't accept names containing a dot (.) Dot character was not considered as a valid identifier body character. mysql-test/r/xml.result@stripped, 2006-07-25 18:46:35+05:00, bar@stripped +6 -0 Adding test case mysql-test/t/xml.test@stripped, 2006-07-25 18:46:36+05:00, bar@stripped +6 -0 Adding test case sql/item_xmlfunc.cc@stripped, 2006-07-25 18:46:36+05:00, bar@stripped +2 -1 Treat dot character as a valid identifier body part. strings/ctype.c@stripped, 2006-07-25 18:46:36+05:00, bar@stripped +28 -28 Fixing to use '/' instead of '.' as a delimiter in charset file parser. strings/xml.c@stripped, 2006-07-25 18:46:36+05:00, bar@stripped +4 -4 Fixing to use '/' instead of '.' as a delimiter. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: bar # Host: bar.intranet.mysql.r18.ru # Root: /usr/home/bar/mysql-5.1.b20795 --- 1.63/strings/ctype.c 2006-07-25 18:46:53 +05:00 +++ 1.64/strings/ctype.c 2006-07-25 18:46:54 +05:00 @@ -80,35 +80,35 @@ 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} }; --- 1.11/strings/xml.c 2006-07-25 18:46:54 +05:00 +++ 1.12/strings/xml.c 2006-07-25 18:46:54 +05:00 @@ -159,7 +159,7 @@ } if (st->attrend > st->attr) { - st->attrend[0]='.'; + st->attrend[0]= '/'; st->attrend++; } memcpy(st->attrend,str,len); @@ -188,9 +188,9 @@ 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)) { --- 1.16/mysql-test/r/xml.result 2006-07-25 18:46:54 +05:00 +++ 1.17/mysql-test/r/xml.result 2006-07-25 18:46:54 +05:00 @@ -704,3 +704,9 @@ select extractValue('a','/ns:element/@xmlns:ns'); extractValue('a','/ns:element/@xmlns:ns') myns +select extractValue('DataOtherdata','/foo/foo.bar'); +extractValue('DataOtherdata','/foo/foo.bar') +Data +select extractValue('DataOtherdata','/foo/something'); +extractValue('DataOtherdata','/foo/something') +Otherdata --- 1.15/mysql-test/t/xml.test 2006-07-25 18:46:54 +05:00 +++ 1.16/mysql-test/t/xml.test 2006-07-25 18:46:54 +05:00 @@ -354,3 +354,9 @@ select extractValue('','count(ns:element)'); select extractValue('a','/ns:element'); select extractValue('a','/ns:element/@xmlns:ns'); + +# +# Bug#20795 extractvalue() won't accept names containing a dot (.) +# +select extractValue('DataOtherdata','/foo/foo.bar'); +select extractValue('DataOtherdata','/foo/something'); --- 1.18/sql/item_xmlfunc.cc 2006-07-25 18:46:54 +05:00 +++ 1.19/sql/item_xmlfunc.cc 2006-07-25 18:46:54 +05:00 @@ -1356,7 +1356,8 @@ (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;