Commit graph

23 commits

Author SHA1 Message Date
bar@bar.intranet.mysql.r18.ru
f3bda9b73f Merge mysql.com:/usr/home/bar/mysql-5.1-new.b18201
into  mysql.com:/usr/home/bar/mysql-5.1-kt
2006-06-19 11:18:05 +05:00
bar@mysql.com
467052aa5b Merge mysql.com:/usr/home/bar/mysql-5.1-new
into  mysql.com:/usr/home/bar/mysql-5.1-new.b18170
2006-05-03 09:08:12 +05:00
bar@mysql.com
bd3f46ed35 Merge mysql.com:/usr/home/bar/mysql-5.1-new
into  mysql.com:/usr/home/bar/mysql-5.1-new.b18201
2006-05-02 14:10:18 +05:00
bar@mysql.com
9686848d64 item_xmlfunc.cc:
After review minor fixes for bug#16319
  Thanks to Gluh for suggestions.
2006-04-19 11:11:47 +05:00
bar@mysql.com
8fb685c254 Bug#18201: XML: ExtractValue works even if the xml
fragment is not well-formed xml

Problem:
- ExtractValue silently returned NULL if a wrong XML value is passed.
- In some cases "unexpected END-OF-INPUT" error was not detected, and
  a non-NULL result could be returned for a bad XML value.

Fix:
- Adding warning messages, to make user aware why NULL was returned.
- Missing "unexpected END-OF-INPUT" error is reported now.
2006-04-17 14:40:25 +05:00
bar@mysql.com
faee72a936 Bug#18170: XML: ExtractValue(): XPath expression can't use QNames (colon in names)
Problem source:
Qualified names (aka QName) didn't work as tag names and attribute names,
because the parser lacked a real rule to scan QName, so it understood
only non-qualified names without prefixes.

Solution:
New rule was added to check both "ident" and "ident:ident" sequences.
2006-04-17 11:49:20 +05:00
bar@mysql.com
ed6899c64f Merge mysql.com:/usr/home/bar/mysql-5.1-new
into  mysql.com:/usr/home/bar/mysql-5.1-new.b16319
2006-04-14 13:34:18 +05:00
bar@mysql.com
df2d425afd Bug#16233: XML: ExtractValue() fails with special characters
ExtractValue didn't understand tag and attribute names
consisting of "tricky" national letters (e.g. latin accenter letters).
It happened because XPath lex parser recognized only basic
latin letter a..z ad a part of an identifier.

Fixed to recognize all letters by means of new "full ctype" which
was added recently.
2006-04-11 13:25:02 +05:00
bar@mysql.com
334af05334 Bug#16319: XML: extractvalue() returns syntax errors for some functions 2006-04-07 14:07:56 +05:00
monty@mysql.com
1994ed49ec Fixed compiler and valgrind warnings
Added missing DBUG_xxx_RETURN statements
Fixed some usage of not initialized variables (as found by valgrind)
Ensure that we don't remove locked tables used as name locks from open table cache until unlock_table_names() are called.
This was fixed by having drop_locked_name() returning any table used as a name lock so that we can free it in unlock_table_names()
This will allow Tomas to continue with his work to use namelocks to syncronize things.

Note: valgrind still produces a lot of warnings about using not initialized code and shows memory loss errors when running the ndb tests
2006-03-29 14:27:36 +03:00
bar@mysql.com
1ddf3c2705 item_xmlfunc.cc:
After review fix.
  Thanks to Gluh for suggestion.
  Bug#18172: XML: Extractvalue() accepts mallformed XPath without a XPath syntax error
2006-03-22 12:57:41 +04:00
bar@mysql.com
2e7cf881ac Bug #18172 XML: Extractvalue() accepts mallformed
XPath without a XPath syntax error
item_xmlfunc.cc:
  Error message didn't happen because after
  a failing attempt to parse RelativeLocationPath,
  my_xpath_parse_AbsoluteLocationPath() returned success.
  Changeing logic a bit:
  - Try to parse EOF first, return success if true.
  - Then try to parse RelativeLocationPath(), return success if true.
  - Otherwise return failure.
xml.result:
  Adding test case.
  Also, this change made it possible to generate 
  an error message earlier in the case of another
  bad XPATH syntax.
xml.test:
  Adding test case.
2006-03-20 14:57:34 +04:00
bar@mysql.com
e983bc7486 xml.result, xml.test:
Adding test.
item_xmlfunc.cc:
  Bug #18171 XML: ExtractValue: the XPath position() function crashes the server!
  Disallowing use of position() and last() without context.
2006-03-15 11:57:37 +04:00
bar@mysql.com
8c2fb88a8f Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-new/
into  mysql.com:/usr/home/bar/mysql-5.1-new.b16318
2006-03-09 11:53:56 +04:00
bar@mysql.com
f516d1f9f2 Bug#16318: XML: extractvalue() incorrectly returns last() = 1
xml.result, xml.test:
  Adding test case.
item_xmlfunc.cc:
  - adding "size" member into MY_XPATH_FLT struct,
  to pass parent's context size when iterating
  in a predicate. Previously, temporaty context
  size was calculated instead, which is always 1.
  As a result, things like last() and count() 
  didn't work fine.
  - adding iteration into Item_func_xpath_elementbyindex:
  similar to Item_func_xpath_predicate.
  This is to make things like last() and count()
  work inside square brackets.
2006-03-03 18:36:14 +04:00
bar@mysql.com
5e2ab5f4a0 Bug#16316: XML: extractvalue() is case-sensitive with contains()
xml.result, xml.test:
  Adding test case.
item_xmlfunc.cc:
  Fixed that Item_nodeset_func derived classes
  didn't take into account charset of the XML value
  and always worked using "binary" charset.
2006-03-02 14:05:38 +04:00
bar@mysql.com
9e47ae44a0 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/usr/home/bar/mysql-5.1-new.16315
2006-03-02 10:42:08 +04:00
bar@mysql.com
47b4f00720 Bug#16315 XML: extractvalue() handles self badly
xml.result, xml.test:
  Adding test case.
item_xmlfunc.cc:
  Adding a special function to handle "self" axis.
  Previously "child" and "self" were handled the same.
2006-03-01 13:16:12 +04:00
gluh@eagle.intranet.mysql.r18.ru
701110c943 Bug#16320 XML: extractvalue() won't accept names containing underscores
added '_' to allowed tag body symbols
2006-03-01 10:36:22 +04:00
bar@mysql.com
bcc72ad04f Bug#16313 XML: extractvalue() ignores '!' in names
xml.result, xml.test:
  Adding test case.
item_xmlfunc.cc:
  Fixed that the "!" character written at the end was ignored.

  Now if we try to scan "!=", and if "!" is not
  followed by "=", we rollback lex scanner back 
  to "!" token, so the parser will start to check
  the next rule from the "!" character again.

  Previously parser started from the next character,
  which was EOF in the example in xml.test,
  which led to query being successfully parsed,
  instead of producing a syntax error.
2006-02-28 13:59:16 +04:00
bar@mysql.com
f057c9b4e7 Bug#16234 XML: Crash if ExtractValue()
Also fixes 16314: XML: extractvalue() crash if vertical bar
xml.result, xml.test:
  Adding test case
item_xmlfunc.cc:
  Using root element as a context node,
  instead of NULL, with relative paths.
2006-02-10 13:24:10 +04:00
konstantin@mysql.com
9bf1e22b4c Fix -ansi -pedantic compile 2006-01-05 11:18:26 +03:00
bar@mysql.com
519f9d628c Adding XPath support: ExtractValue and UpdateXML functions.
libmysqld/Makefile.am:
sql/Makefile.am:
  Adding new source files.
  Adding new file into build process.
include/my_xml.h:
strings/xml.c:
  Adding new XML parse flags to skip text normalization and 
  to use relative tag names. Adding enum for XML token types.
sql/lex.h:
  Making parser aware of new SQL functions.
sqll/item_create.h, sql/item_create.cc:
  Adding creators for ExtractValue and UpdateXML.
sql/item.h:
  Adding new Item types: nodeset and nodeset comparator.
sql/item_xmlfunc.h
sql/item_xmlfunc.cc
  Adding new classes implementing XPath functions.
mysql-test/t/xml.test, mysql-test/r/xml.result:
  New files: adding test case
2005-12-21 17:13:52 +04:00