List:Commits« Previous MessageNext Message »
From:bar Date:March 15 2006 8:57am
Subject:bk commit into 5.1 tree (bar:1.2183) BUG#18171
View as plain text  
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
  1.2183 06/03/15 11:57:37 bar@stripped +3 -0
  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.

  mysql-test/r/xml.result
    1.9 06/03/15 11:57:07 bar@stripped +4 -0
    Adding test.

  mysql-test/t/xml.test
    1.9 06/03/15 11:57:02 bar@stripped +9 -0
    Adding test.

  sql/item_xmlfunc.cc
    1.9 06/03/15 11:56:26 bar@stripped +4 -2
    Bug #18171 XML: ExtractValue: the XPath position() function crashes the server!
    Disallowing use of position() and last() without context.

# 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-new.b18171

--- 1.8/mysql-test/r/xml.result	2006-03-09 11:53:49 +04:00
+++ 1.9/mysql-test/r/xml.result	2006-03-15 11:57:07 +04:00
@@ -609,3 +609,7 @@
 select extractvalue('<a>Jack</a>' collate
latin1_bin,'/a[contains(../a,"j")]');
 extractvalue('<a>Jack</a>' collate latin1_bin,'/a[contains(../a,"j")]')
 
+select extractValue('<e>1</e>','position()');
+ERROR HY000: XPATH syntax error: ''
+select extractValue('<e>1</e>','last()');
+ERROR HY000: XPATH syntax error: ''

--- 1.8/mysql-test/t/xml.test	2006-03-09 11:53:49 +04:00
+++ 1.9/mysql-test/t/xml.test	2006-03-15 11:57:02 +04:00
@@ -277,3 +277,12 @@
 select extractvalue('<a>Jack</a>','/a[contains(../a,"j")]');
 select extractvalue('<a>Jack</a>','/a[contains(../a,"j")]' collate
latin1_bin);
 select extractvalue('<a>Jack</a>' collate
latin1_bin,'/a[contains(../a,"j")]');
+
+#
+# Bug #18171 XML: ExtractValue: the XPath position()
+# function crashes the server!
+#
+--error 1105
+select extractValue('<e>1</e>','position()');
+--error 1105
+select extractValue('<e>1</e>','last()');

--- 1.8/sql/item_xmlfunc.cc	2006-03-09 11:49:01 +04:00
+++ 1.9/sql/item_xmlfunc.cc	2006-03-15 11:56:26 +04:00
@@ -1141,13 +1141,15 @@
 
 static Item *create_func_last(MY_XPATH *xpath, Item **args, uint nargs)
 {
-  return new Item_func_xpath_count(xpath->context, xpath->pxml);
+  return xpath->context ? 
+         new Item_func_xpath_count(xpath->context, xpath->pxml) : NULL;
 }
 
 
 static Item *create_func_position(MY_XPATH *xpath, Item **args, uint nargs)
 {
-  return new Item_func_xpath_position(xpath->context, xpath->pxml);
+  return xpath->context ? 
+         new Item_func_xpath_position(xpath->context, xpath->pxml) : NULL;
 }
 
 
Thread
bk commit into 5.1 tree (bar:1.2183) BUG#18171bar15 Mar