Commit graph

57 commits

Author SHA1 Message Date
Alexander Barkov
64d33032a6 Merge 5.3->5.5 2014-04-23 17:43:20 +04:00
Alexander Barkov
a24ea50d1a MDEV-5338 XML parser accepts malformed data 2014-04-23 15:53:47 +04:00
Sergei Golubchik
4881c65007 test case for
MDEV-5689 ExtractValue(xml, 'substring(/x,/y)') crashes
MySQL bug#12428404 MYSQLD.EXE CRASHES WHEN EXTRACTVALUE() IS CALLED WITH MALFORMED XPATH EXP
2014-02-17 11:09:24 +01:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Georgi Kodinov
01b68c5105 Bug #12375190: UPDATEXML CRASHES ON SIMPLE INPUTS
The XPATH implementation was not handling correctly the XPATH 
production #19 
(http://www.w3.org/TR/1999/REC-xpath-19991116/#node-sets),
namely

PathExpr ::= | FilterExpr '/' RelativeLocationPath
                    | FilterExpr '//' RelativeLocationPath

It was lacking context for the RelativeLocationPath and it was just 
ignoring the second slash instead of treating it as a different axis 
specifier.
Fixed the above two problems and added a test case.
2011-05-03 10:48:24 +03:00
Alexander Barkov
561738dc10 Merging from mysql-5.1 2011-03-01 17:42:37 +03:00
Alexander Barkov
fd1e3b03ff Bug#11766725 (Bug#59901) EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332
Problem: a byte behind the end of input string was read
in case of a broken XML not having a quote or doublequote
character closing a string value.

Fix: changing condition not to read behind the end of input string

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  Adding tests

  @ strings/xml.c
  When checking if the closing quote/doublequote was found,
  using p->cur[0] us unsafe, as p->cur can point to the byte after the value.
  Comparing p->cur to p->beg instead.
2011-03-01 15:30:18 +03:00
Alexander Barkov
5574a2cd91 Bug#44332 my_xml_scan reads behind the end of buffer
Problem: the scanner function tested for strings "<![CDATA[" and
"-->" without checking input string boundaries, which led to valgrind's
"Conditional jump or move depends on uninitialised value(s)" error.

Fix: Adding boundary checking.

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  Adding test

  @ strings/xml.c
  Adding a helper function my_xml_parser_prefix_cmp(),
  with input string boundary check.
2011-01-18 09:38:41 +03:00
Alexander Barkov
daf602a223 Merging from 5.1. 2011-01-18 09:50:03 +03:00
Ramil Kalimullin
bd557f04f6 Manual merge from mysql-5.5-bugteam. 2010-11-22 14:47:28 +03:00
Ramil Kalimullin
65116d3408 Manual-merge from mysql-5.1-bugteam. 2010-11-22 12:21:10 +03:00
Alexander Barkov
76ce2feb5f Bug#58175 xml functions read initialized bytes when conversions happen
Problem:

 nr_of_decimals could read behind the end of the buffer
 in case of a non-null-terminated string, which caused
 valgring warnings.

Fix:

  fixing nr_of_decimals not to read behind the "end" pointer.

modified:

  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  @ sql/item.cc
2010-11-19 18:24:29 +03:00
Alexander Barkov
8f4af42145 Bug#57279 updatexml dies with: Assertion failed: str_arg[length] == 0
Problem: crash in Item_float constructor on DBUG_ASSERT due
to not null-terminated string parameter.

Fix: making Item_float::Item_float non-null-termintated parameter safe:
- Using temporary buffer when generating error

modified:
  @ mysql-test/r/xml.result
  @ mysql-test/t/xml.test
  @ sql/item.cc
2010-11-18 16:11:18 +03:00
Alexander Barkov
aa668865e2 Bug#57257 Replace(ExtractValue(...)) causes MySQL crash
Bug#57820 extractvalue crashes

Problem: ExtractValue and Replace crashed in some cases
due to invalid handling of empty and NULL arguments.

Per file comments:

  @mysql-test/r/ctype_ujis.result
  @mysql-test/r/xml.result
  @mysql-test/t/ctype_ujis.test
  @mysql-test/t/xml.test
  Adding tests

  @sql/item_strfunc.cc
  Make sure Item_func_replace::val_str safely handles empty strings.

  @sql/item_xmlfunc.cc
  set null_value if nodeset_func returned NULL,
  which is possible when the second argument is an
  unset user variable.
2010-11-11 13:25:23 +03:00
Sergey Glukhov
b46dc9ca4d Bug#43183 ExctractValue() brings result list in missorder
The problem is that XML functions(items) do not reset null_value
before their execution and further item excution may use
null_value value of the previous result.
The fix is to reset null_value.


mysql-test/r/xml.result:
  test result
mysql-test/t/xml.test:
  test case
sql/item_xmlfunc.cc:
  The problem is that XML functions(items) do not reset null_value
  before their execution and further item excution may use
  null_value value of the previous result.
  The fix is to reset null_value.
2009-04-01 13:40:33 +05:00
Sergey Glukhov
1d09ec6208 Bug#42495 updatexml: Assertion failed: xpath->context, file .\item_xmlfunc.cc, line 2507
Problem:
   RelativeLocationPath can appear only after a node-set expression
   in the third and the fourth branches of this rule:
     PathExpr :: =  LocationPath
                    | FilterExpr
                    | FilterExpr '/' RelativeLocationPath
                    | FilterExpr '//' RelativeLocationPath
   XPatch code didn't check the type of FilterExpr and crashed.
Fix:
   If FilterExpr is a scalar expression
   (variable reference, literal, number, scalar function call)
   return error.


mysql-test/r/xml.result:
  test result
mysql-test/t/xml.test:
  test case
sql/item_xmlfunc.cc:
  Problem:
     RelativeLocationPath can appear only after a node-set expression
     in the third and the fourth branches of this rule:
       PathExpr :: =  LocationPath
                      | FilterExpr
                      | FilterExpr '/' RelativeLocationPath
                      | FilterExpr '//' RelativeLocationPath
     XPatch code didn't check the type of FilterExpr and crashed.
  Fix:
     If FilterExpr is a scalar expression
     (variable reference, literal, number, scalar function call)
     return error.
2009-02-04 15:40:12 +04:00
Alexander Barkov
8d4b41605b Bug#38227 EXTRACTVALUE doesn't work with DTD declarations
Problem:
 XML syntax parser allowed to use quoted strings as attribute names,
 and tried to put them into parser state stack instead of identifiers.
 After that parser failed, if quoted string contained some slash characters.
Fix:
 - Disallowing quoted strings in regular tags.
 - Allowing quoted string in DOCTYPE declararion, but
 don't push it into parse state stack (just skip it).
2008-12-10 13:05:57 +04:00
unknown
961cc887bf Fix for bug #32557: order by updatexml causes assertion in filesort
Problem: even if an Item_xml_str_func successor returns NULL, it doesn't have 
a corresponding property (maybe_null) set, that leads to a failed assertion.

Fix: set nullability property of Item_xml_str_func.


mysql-test/r/xml.result:
  Fix for bug #32557: order by updatexml causes assertion in filesort
    - test result.
mysql-test/t/xml.test:
  Fix for bug #32557: order by updatexml causes assertion in filesort
    - test case.
sql/item_xmlfunc.h:
  Fix for bug #32557: order by updatexml causes assertion in filesort
    - set Item_xml_str_func::maybe_null.
2007-11-21 16:00:09 +04:00
unknown
130f9b9f50 Many files:
Error message numbers.


mysql-test/r/binlog_unsafe.result:
  Error message numbers.
mysql-test/r/events_bugs.result:
  Error message numbers.
mysql-test/r/events_trans.result:
  Error message numbers.
mysql-test/r/sp_gis.result:
  Error message numbers.
mysql-test/r/xml.result:
  Error message numbers.
mysql-test/suite/rpl/r/rpl_incident.result:
  Error message numbers.
mysql-test/suite/rpl/r/rpl_loaddata_fatal.result:
  Error message numbers.
mysql-test/suite/rpl/r/rpl_udf.result:
  Error message numbers.
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
  Error message numbers.
mysql-test/suite/ndb/r/ndb_dd_basic.result:
  Error message numbers.
mysql-test/suite/ndb/r/ndb_dd_ddl.result:
  Error message numbers.
mysql-test/suite/ndb/r/ndb_gis.result:
  Error message numbers.
mysql-test/suite/ndb/r/ndb_row_format.result:
  Error message numbers.
mysql-test/suite/ndb/r/ndb_single_user.result:
  Error message numbers.
2007-10-27 01:40:48 +05:00
unknown
c0cc6d2a7a Fix for bug #31438: updatexml still crashes
Problem: check missed if the second updatexml() argument is valid.

Fix: check it.


mysql-test/r/xml.result:
  Fix for bug #31438: updatexml still crashes
    - test result.
mysql-test/t/xml.test:
  Fix for bug #31438: updatexml still crashes
    - test case.
sql/item_xmlfunc.cc:
  Fix for bug #31438: updatexml still crashes
    - check if the second argument passed to the updatexml() is valid.
2007-10-08 16:52:15 +05:00
unknown
c0d75796cd Many files:
Merge with 5.0-opt.


mysql-test/r/binlog_unsafe.result:
  Merge with 5.0-opt.
mysql-test/r/events_bugs.result:
  Merge with 5.0-opt.
mysql-test/r/events_trans.result:
  Merge with 5.0-opt.
mysql-test/r/sp.result:
  Merge with 5.0-opt.
mysql-test/r/sp_gis.result:
  Merge with 5.0-opt.
mysql-test/r/xml.result:
  Merge with 5.0-opt.
mysql-test/suite/rpl/r/rpl_incident.result:
  Merge with 5.0-opt.
mysql-test/suite/rpl/r/rpl_loaddata_fatal.result:
  Merge with 5.0-opt.
mysql-test/suite/rpl/r/rpl_udf.result:
  Merge with 5.0-opt.
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
  Merge with 5.0-opt.
mysql-test/suite/ndb/r/ndb_dd_basic.result:
  Merge with 5.0-opt.
mysql-test/suite/ndb/r/ndb_dd_ddl.result:
  Merge with 5.0-opt.
mysql-test/suite/ndb/r/ndb_gis.result:
  Merge with 5.0-opt.
mysql-test/suite/ndb/r/ndb_row_format.result:
  Merge with 5.0-opt.
mysql-test/suite/ndb/r/ndb_single_user.result:
  Merge with 5.0-opt.
2007-09-14 17:21:50 +02:00
unknown
6930e7dedf Many files:
Post-merge fix.


mysql-test/r/binlog_unsafe.result:
  Post-merge fix.
mysql-test/r/events_bugs.result:
  Post-merge fix.
mysql-test/r/events_trans.result:
  Post-merge fix.
mysql-test/r/sp.result:
  Post-merge fix.
mysql-test/r/sp_gis.result:
  Post-merge fix.
mysql-test/r/xml.result:
  Post-merge fix.
2007-08-03 13:07:37 +05:00
unknown
ae398d995a Bug #29245: Bad Merge Caused Error Codes Conflict between 5.0/5.1
Fix some error messages so that all error codes are equivalent in 5.0 and 5.1


mysql-test/r/backup.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/events_bugs.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/events_trans.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/ndb_dd_basic.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/ndb_dd_ddl.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/ndb_gis.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/ndb_row_format.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_extraCol_innodb.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_extraCol_myisam.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_incident.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_ndb_extraCol.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_row_tabledefs_2myisam.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_row_tabledefs_3innodb.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/rpl_sp.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/select.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/show_check.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/sp.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/sp_gis.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/sp_trans.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/type_timestamp.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/warnings.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/r/xml.result:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/t/grant.test:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
mysql-test/t/partition_grant.test:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
sql/mysql_priv.h:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
sql/share/errmsg.txt:
  Fix some error messages so that all error codes are equivalent in 5.0 and 5.1
2007-06-26 13:15:43 +02:00
unknown
1da8ea2ee0 Bug#28558 UpdateXML called with garbage crashes server
Problem: Memory overrun happened in attempts to generate
error messages (e.g. in case of incorrect XPath syntax).
Reason: set_if_bigger() was used instead of set_if_smaller().
Change: replacing wrong set_if_bigger() to set_if_smaller(),
and making minor additional code clean-ups.


mysql-test/r/xml.result:
  Adding test cases for all pieces of code with
  set_if_smaller() followed by my_printf_error().
mysql-test/t/xml.test:
  Adding test cases for all pieces of code with
  set_if_smaller() followed by my_printf_error().
sql/item_xmlfunc.cc:
  - fixing incorrect set_if_bigger to set_if_smaller in two places
  - getting read of unnesessary "char context[32]" variable and
    using '%.*s' instead if '%s' in the error format.
2007-05-23 12:34:47 +05:00
unknown
2375c78f4d Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into  mysql.com:/home/bar/mysql-5.1.b26518


mysql-test/r/xml.result:
  Auto merged
mysql-test/t/xml.test:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
2007-05-08 13:36:05 +05:00
unknown
8ce067caea Bug#26518 XPath and variables problem
Problem: XPath variables didn't work.
Fix: adding variables support,
both user-defined and sp local variables are now supported by XPath.


mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Adding variables support:
  - SP variables with standard XPath syntax:  $i
  - User variables with non-standard syntax:  $@i
2007-05-08 13:32:29 +05:00
unknown
9c2923fef4 Bug#27898 UPDATEXML Crashes the Server!
Problem: when replacing the root element, UpdateXML
erroneously tried to mix old XML content with the
replacement string, which led to crash.
Fix: don't use the old XML content in these cases,
just return the replacement string.


mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Adding special code to handle replacements of the root element -
  the replacing content is just copied to the result,
  the previous content of the XML value is removed.
2007-05-02 13:18:07 +05:00
unknown
932bd2a61d Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-rpl
into  mysql.com:/home/bar/mysql-5.1.b24747


mysql-test/r/xml.result:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
2007-01-22 13:28:58 +04:00
unknown
38fd186721 Bug#24747 XPath error with the node name "Text"
mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Bug#24747 XPath error with the node name "Text"
  
  Problem: keywords, nodetype names and axis names
  didn't work in node name context.
  
  Fix:
  1. Changes in lexem scanner behaviour when an identifier has been read:
  - search through axis names and return MY_XPATH_AXIS_xxx only
    when identifier is followed by two semicolons. Don't check axis
    names and return MY_XPATH_IDENT of not followed by two semicolons.
  - search through nodetype names and return MY_XPATH_LEX_NODETYPE
    only when identifier is followed by left parenthesis.
    Don't check nodetype names and return MY_XPATH_LEX_IDENT when
    not followed by parenthesis
  2. Change in syntax analizer: QName scanner now accepts keywords 
     AND, OR, MOD, DIV as valid node names.
2006-12-27 18:14:28 +04:00
unknown
715e63ae98 WL# 3031
Post-commit issues fixed
* Test results for other tests fixed due to added error #s
* Memory allocation/free issues found with running with valgrind
* Fix to mysql-test-run shell script to run federated_server test (installs
mysql.servers table properly)


mysql-test/r/1st.result:
  WL #3031
  
  New result for 1st test
mysql-test/r/backup.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/connect.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/information_schema.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/mysql.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/mysqlcheck.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/ndb_dd_basic.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/ndb_dd_ddl.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/select.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/show_check.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/sp.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/sp_gis.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/sp_trans.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/system_mysql_db.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/type_timestamp.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/warnings.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
mysql-test/r/xml.result:
  WL #3031
  
  Error codes differ due to addition of error codes for federated server errors (2)
  so all test results with hard-coded error #s will be off by two. New results generated.
scripts/mysql_create_system_tables.sh:
  WL #3031
  
  Fixed old mysql-test-run.sh script to work with new mysql.servers table as reported
  by Cisco
sql/sql_yacc.yy:
  WL# 3031
  
  OPTIONS/options must be usable as table or column name.
storage/federated/ha_federated.cc:
  WL# 3031
  
  * Fixed allocation and free issues (warnings found with --valgrind)
  * Fixed cast issues
  * Made sure port was set accordingly
2006-12-08 22:19:51 -05:00
unknown
7595cb06eb Bug#22823 gt and lt operators appear to be reversed in ExtractValue() command
Problem: "greater than" and "less than" XPath operators appeared to have been implemented in reverse.
Fix: swap arguments to eq_func() and eq_func_reverse() to provide correct operation result.


mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Pass argumemtns to eq_func() and eq_func_reverse() in correct order:
  nodeset argument first, then scalar argument.
  Also, fixing eq_func_reverse() to do correct conversion, e.g:
  "scalar > nodeset" into "nodeset < scalar" instead of wrong "nodeset <= scalar"
  "scalar >= nodeset" into "nodeset <= scalar" instead of wrong "nodeset < scalar".
2006-10-23 14:17:57 +05:00
unknown
32ede45dd4 Bug#20854 XML functions: wrong result in ExtractValue
mysql-test/r/xml.result:
  - Adding test case
  - Fixing error message
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  For grammar rules with loops like:
  
    AdditiveExpr ::= MultiplicativeExpr ('+' MultiplicativeExpr)*
  
  If we scanned scanned '+' and then met an error when parsing
  MultiplicativeExpr, then we should fully stop parsing - without
  trying to apply any other rules.
  
  Fix: add "error" member into MY_XPATH structure,
  and make my_xpath_parse_term() never return success
  as soon as error set.
strings/xml.c:
  Adding my_xml_ctype map for flags, indicating
  whether a character is a space character, is a
  valid identifier start character, is a valid
  identifier body character. Using this map to
  properly scan identifiers. Also, using this map
  to scan spaces faster (instead of strchr).
2006-09-14 11:47:19 +05:00
unknown
6530968211 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:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Treat dot character as a valid identifier body part.
strings/ctype.c:
  Fixing to use '/' instead of '.' as a delimiter in charset file parser.
strings/xml.c:
  Fixing to use '/' instead of '.' as a delimiter.
2006-07-25 18:46:43 +05:00
unknown
fa3c7e99e5 Additional fix for 18201 XML: ExtractValue works even if the xml fragment is not well-formed xml
Changing error number
2006-06-19 14:17:04 +05:00
unknown
ca741138e7 Merge mysql.com:/usr/home/bar/mysql-5.1-new.b18201
into  mysql.com:/usr/home/bar/mysql-5.1-kt


mysql-test/r/xml.result:
  Auto merged
mysql-test/t/xml.test:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
2006-06-19 11:18:05 +05:00
unknown
20256d8a56 Merge mysql.com:/usr/home/bar/mysql-5.1-new
into  mysql.com:/usr/home/bar/mysql-5.1-new.b18170


mysql-test/r/xml.result:
  Auto merged
mysql-test/t/xml.test:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
2006-05-03 09:08:12 +05:00
unknown
d3bb4670a9 Merge mysql.com:/usr/home/bar/mysql-5.1-new
into  mysql.com:/usr/home/bar/mysql-5.1-new.b18201


mysql-test/r/xml.result:
  Auto merged
mysql-test/t/xml.test:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
2006-05-02 14:10:18 +05:00
unknown
3010775ed1 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.


mysql-test/r/xml.result:
  - Fixing XML systax error in old test
  - Adding test cases.
mysql-test/t/xml.test:
  - Fixing XML systax error in old test
  - Adding test cases.
sql/item_xmlfunc.cc:
  Produce warning in case of XML systax error,
  instead of silentrly returning NULL.
strings/xml.c:
  - Making error messages better looking and clearer:
  It is important because now they're seen in SHOW WARNINGS
  (previously they were used only for debugging purposes).
  - Adding "unexpected END-OF-INPUT" error if after scanning
    closing tag for the root element some input is left
    (previously this error was ignored in a mistake).
2006-04-17 14:40:25 +05:00
unknown
1a3cb50c24 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.


mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Adding real QName parser rule and using it in NodeTest rule.
2006-04-17 11:49:20 +05:00
unknown
9faa297074 Merge mysql.com:/usr/home/bar/mysql-5.1-new
into  mysql.com:/usr/home/bar/mysql-5.1-new.b16319


mysql-test/r/xml.result:
  Auto merged
mysql-test/t/xml.test:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
2006-04-14 13:34:18 +05:00
unknown
1655d73c45 Merge mysql.com:/usr/home/bar/mysql-5.1-new
into  mysql.com:/usr/home/bar/mysql-5.1-new.b18285


mysql-test/r/xml.result:
  Auto merged
mysql-test/t/xml.test:
  Auto merged
2006-04-11 17:12:29 +05:00
unknown
6c0cfad17b 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.


mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Using recently implemented "true" ctype functionality
      to treat all national letters as valid tag names,
      Only basic latin letters worked so far.
strings/ctype-simple.c:
  A bug fix: ctype is array of 257 elements,
      adding offset to address correct element.
2006-04-11 13:25:02 +05:00
unknown
e84041f174 Bug#16319: XML: extractvalue() returns syntax errors for some functions
mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
sql/item_xmlfunc.cc:
  Adding support for missing XPath function string-length().
  Fixing function lookup to allow functions with one optional arguments
  (i.e. with 0 or 1 arguments)
2006-04-07 14:07:56 +05:00
unknown
fd9d70a072 Bug#18285: ExtractValue not returning character data within <![CDATA[]]> as expected
mysql-test/r/xml.result:
  Adding test case
mysql-test/t/xml.test:
  Adding test case
strings/xml.c:
  Adding missing support of CDATA sections.
2006-04-07 11:04:33 +05:00
unknown
5f8bd7fe0f 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.


sql/item_xmlfunc.cc:
  Bug #18172 XML: Extractvalue() accepts mallformed XPath without a XPath syntax error
  Error message didn't happen because after
  a failing attempt to parse RelativeLocationPath(),
  my_xpath_parse_AbsoluteLocationPath() returned with 1.
  Changeing logic a bit: check for EOF first.
  Then try to parse RelativeLocationPath().
  If the latter fails, return failure.
mysql-test/t/xml.test:
  Adding test case.
mysql-test/r/xml.result:
  Adding test case.
  Also, this change makes error message
  to be generated earlier in the case of another
  bad XPATH syntax.
2006-03-20 14:57:34 +04:00
unknown
1dc87feb20 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.


sql/item_xmlfunc.cc:
  Bug #18171 XML: ExtractValue: the XPath position() function crashes the server!
  Disallowing use of position() and last() without context.
mysql-test/t/xml.test:
  Adding test.
mysql-test/r/xml.result:
  Adding test.
2006-03-15 11:57:37 +04:00
unknown
41a863830a Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1-new/
into  mysql.com:/usr/home/bar/mysql-5.1-new.b16318


sql/item_xmlfunc.cc:
  Auto merged
mysql-test/r/xml.result:
  After merge fix
mysql-test/t/xml.test:
  After merge fix
2006-03-09 11:53:56 +04:00
unknown
a5694ba4cf 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.


sql/item_xmlfunc.cc:
  Bug#16318: XML: extractvalue() incorrectly returns last() = 1
  - 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.
mysql-test/t/xml.test:
  Adding test case.
mysql-test/r/xml.result:
  Adding test case.
2006-03-03 18:36:14 +04:00
unknown
c76459aca9 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.


sql/item_xmlfunc.cc:
  Bug#16316: XML: extractvalue() is case-sensitive with contains()
  Fixed that Item_nodeset_func derived classes
  didn't take into account charset of the XML value
  and always worked using "binary" charset.
mysql-test/t/xml.test:
  Adding test case.
mysql-test/r/xml.result:
  Adding test case.
2006-03-02 14:05:38 +04:00