db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r448258 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/types/ engine/org/apache/derby/loc/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ testing/org/apache...
Date Wed, 20 Sep 2006 16:35:10 GMT
Author: mikem
Date: Wed Sep 20 09:35:09 2006
New Revision: 448258

URL: http://svn.apache.org/viewvc?view=rev&rev=448258
Log:
DERBY-1775
contributed by Army Brown
committing  d1775_v2.patch

Attaching a patch that does the following:

1. Updates the 2200M message text to be more generic,
as suggested in the description of this issue.

2. Replaces "see next exception" with the in-lined
error message while continuing to do exception
chaining as usual.

3. Also replaces "see next exception" with in-line
error messages for a couple of other SQL/XML
errors--namely UNEXPECTED_XML_ERROR and
XML_QUERY_ERROR. 


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SqlXmlUtil.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/XML.java
    db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/xml_general.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/xml_general.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xml_general.out

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SqlXmlUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SqlXmlUtil.java?view=diff&rev=448258&r1=448257&r2=448258
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SqlXmlUtil.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SqlXmlUtil.java Wed Sep 20
09:35:09 2006
@@ -233,7 +233,7 @@
              * run as normal.
              */ 
             throw StandardException.newException(
-                SQLState.LANG_UNEXPECTED_XML_EXCEPTION, t);
+                SQLState.LANG_UNEXPECTED_XML_EXCEPTION, t, t.getMessage());
 
         }
 
@@ -290,7 +290,7 @@
              * continue to run as normal. 
              */
             throw StandardException.newException(
-                SQLState.LANG_XML_QUERY_ERROR, te, opName);
+                SQLState.LANG_XML_QUERY_ERROR, te, opName, te.getMessage());
 
         }
     }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/XML.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/XML.java?view=diff&rev=448258&r1=448257&r2=448258
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/XML.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/XML.java Wed Sep 20 09:35:09
2006
@@ -577,7 +577,7 @@
          * will continue to run as normal.
          */ 
             throw StandardException.newException(
-                SQLState.LANG_INVALID_XML_DOCUMENT, t);
+                SQLState.LANG_INVALID_XML_DOCUMENT, t, t.getMessage());
 
         }
 
@@ -730,7 +730,8 @@
          * fail but Derby will continue to run as normal. 
          */
             throw StandardException.newException(
-                SQLState.LANG_XML_QUERY_ERROR, xe, "XMLEXISTS");
+                SQLState.LANG_XML_QUERY_ERROR, xe,
+                "XMLEXISTS", xe.getMessage());
         }
     }
 
@@ -803,7 +804,8 @@
          * fail but Derby will continue to run as normal. 
          */
             throw StandardException.newException(
-                SQLState.LANG_XML_QUERY_ERROR, xe, "XMLQUERY");
+                SQLState.LANG_XML_QUERY_ERROR, xe,
+                "XMLQUERY", xe.getMessage());
         }
     }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties?view=diff&rev=448258&r1=448257&r2=448258
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/loc/messages_en.properties Wed Sep 20
09:35:09 2006
@@ -433,7 +433,7 @@
 0100E=XX Attempt to return too many result sets. 
 02000=No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty
table.
 # Next one is generic XQuery error per SQL/XML[2006]
-10000=Encountered error while evaluating XML query expression for {0} operator; see next
exception for details.
+10000=Encountered error while evaluating XML query expression for {0} operator: {1}
 21000=Scalar subquery is only allowed to return a single row.
 22001=A truncation error was encountered trying to shrink {0} ''{1}'' to length {2}.
 54006=The length resulting from {0} operation is greater than {1}.
@@ -467,7 +467,7 @@
 
 ## SQL/XML errors.
 2200L=Values assigned to XML columns must be well-formed DOCUMENT nodes.
-2200M=Failed to parse XMLPARSE operand; see next exception for details.
+2200M=Invalid XML DOCUMENT: {0}
 2200V=Invalid context item for {0} operator; context items must be well-formed DOCUMENT nodes.
 2200W=XQuery serialization error: Attempted to serialize one or more top-level Attribute
nodes.
 # end SQL/XML errors.
@@ -1308,7 +1308,7 @@
 
 #XML - Derby-specific XML errors that are not covered by the SQL standard.
 XML00=Failed to locate ''{0}'' API or implementation classes.  XML operations are not permitted
unless these classes are in your classpath.
-XML01=Encountered unexpected error while processing XML; see next exception for details.
+XML01=Encountered unexpected error while processing XML: {0}
 
 # 0A - SQLState class indicating feature not supported
 0A000.S=Feature not implemented: {0}.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/xml_general.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/xml_general.out?view=diff&rev=448258&r1=448257&r2=448258
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/xml_general.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/xml_general.out
Wed Sep 20 09:35:09 2006
@@ -180,7 +180,7 @@
 ij> select i from t1 where xmlparse(document '<hein/>' preserve whitespace);
 ERROR 42X19: The WHERE or HAVING clause or CHECK CONSTRAINT definition is a 'XML' expression.
 It must be a BOOLEAN expression.
 ij> insert into t1 values (1, xmlparse(document '<oops>' preserve whitespace));
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details. SQLSTATE:
XJ001: Java exception: 'XML document structures must start and end within the same entity.:
xxxFILTERED-SAX-EXCEPTIONxxx'.
+ERROR 2200M: Invalid XML DOCUMENT: XML document structures must start and end within the
same entity. SQLSTATE: XJ001: Java exception: 'XML document structures must start and end
within the same entity.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> prepare ps1 as 'insert into t1(x) values XMLPARSE(document ? preserve whitespace)';
 ij> -- These should work.
 insert into t1 values (5, xmlparse(document '<hmm/>' preserve whitespace));
@@ -304,7 +304,7 @@
 ij> -- These should succeed at the XMLEXISTS level, but fail with
 ----- parse/truncation errors.
 select xmlserialize(xmlparse(document vc preserve whitespace) as char(10)) from t4;
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details. SQLSTATE:
XJ001: Java exception: 'Content is not allowed in prolog.: xxxFILTERED-SAX-EXCEPTIONxxx'.
+ERROR 2200M: Invalid XML DOCUMENT: Content is not allowed in prolog. SQLSTATE: XJ001: Java
exception: 'Content is not allowed in prolog.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> select xmlserialize(x as char) from t1;
 ERROR 22001: A truncation error was encountered trying to shrink CHAR '<update2> document
was inserted as part of an UPDATE </updat&' to length 1.
 ij> select xmlserialize(x as clob(10)) from t1;
@@ -334,7 +334,7 @@
 select xmlserialize(xmlparse(document '<hmm>' preserve whitespace) as clob) from t2;
 1                                                                                       
                                       
 -----
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details. SQLSTATE:
XJ001: Java exception: 'XML document structures must start and end within the same entity.:
xxxFILTERED-SAX-EXCEPTIONxxx'.
+ERROR 2200M: Invalid XML DOCUMENT: XML document structures must start and end within the
same entity. SQLSTATE: XJ001: Java exception: 'XML document structures must start and end
within the same entity.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> select xmlserialize(xmlparse(document x preserve whitespace) as char(100)) from t1;
 ERROR 42X25: The 'XMLParse' function is not allowed on the 'XML' type.
 ij> -- These should succeed.
@@ -649,7 +649,7 @@
     xmlquery('data(//@*)' passing by ref x returning sequence empty on empty)
   as char(70))
 from t1;
-ERROR 10000: Encountered error while evaluating XML query expression for XMLQUERY operator;
see next exception for details. SQLSTATE: XJ001: Java exception: 'Could not find function:
data: javax.xml.transform.TransformerException'.
+ERROR 10000: Encountered error while evaluating XML query expression for XMLQUERY operator:
Could not find function: data SQLSTATE: XJ001: Java exception: 'Could not find function: data:
javax.xml.transform.TransformerException'.
 ij> -- These should all succeed.  Since it's Xalan that's actually doing
 ----- the query evaluation we don't need to test very many queries; we
 ----- just want to make sure we get the correct results when there is

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/xml_general.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/xml_general.out?view=diff&rev=448258&r1=448257&r2=448258
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/xml_general.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/xml_general.out
Wed Sep 20 09:35:09 2006
@@ -180,7 +180,7 @@
 ij> select i from t1 where xmlparse(document '<hein/>' preserve whitespace);
 ERROR 42X19: The WHERE or HAVING clause or CHECK CONSTRAINT definition is a 'XML' expression.
 It must be a BOOLEAN expression.
 ij> insert into t1 values (1, xmlparse(document '<oops>' preserve whitespace));
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details. SQLSTATE:
XJ001: Java exception: 'XML document structures must start and end within the same entity.:
xxxFILTERED-SAX-EXCEPTIONxxx'.
+ERROR 2200M: Invalid XML DOCUMENT: XML document structures must start and end within the
same entity. SQLSTATE: XJ001: Java exception: 'XML document structures must start and end
within the same entity.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> prepare ps1 as 'insert into t1(x) values XMLPARSE(document ? preserve whitespace)';
 ERROR 42Z79: Unable to determine the parameter type for XMLPARSE; try using a CAST.
 ij> -- These should work.
@@ -305,7 +305,7 @@
 ij> -- These should succeed at the XMLEXISTS level, but fail with
 ----- parse/truncation errors.
 select xmlserialize(xmlparse(document vc preserve whitespace) as char(10)) from t4;
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details. SQLSTATE:
XJ001: Java exception: 'Content is not allowed in prolog.: xxxFILTERED-SAX-EXCEPTIONxxx'.
+ERROR 2200M: Invalid XML DOCUMENT: Content is not allowed in prolog. SQLSTATE: XJ001: Java
exception: 'Content is not allowed in prolog.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> select xmlserialize(x as char) from t1;
 ERROR 22001: A truncation error was encountered trying to shrink CHAR '<update2> document
was inserted as part of an UPDATE </updat&' to length 1.
 ij> select xmlserialize(x as clob(10)) from t1;
@@ -335,7 +335,7 @@
 select xmlserialize(xmlparse(document '<hmm>' preserve whitespace) as clob) from t2;
 1                                                                                       
                                       
 -----
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details. SQLSTATE:
XJ001: Java exception: 'XML document structures must start and end within the same entity.:
xxxFILTERED-SAX-EXCEPTIONxxx'.
+ERROR 2200M: Invalid XML DOCUMENT: XML document structures must start and end within the
same entity. SQLSTATE: XJ001: Java exception: 'XML document structures must start and end
within the same entity.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> select xmlserialize(xmlparse(document x preserve whitespace) as char(100)) from t1;
 ERROR 42X25: The 'XMLParse' function is not allowed on the 'XML' type.
 ij> -- These should succeed.
@@ -650,7 +650,7 @@
     xmlquery('data(//@*)' passing by ref x returning sequence empty on empty)
   as char(70))
 from t1;
-ERROR 10000: Encountered error while evaluating XML query expression for XMLQUERY operator;
see next exception for details. SQLSTATE: XJ001: Java exception: 'Could not find function:
data: javax.xml.transform.TransformerException'.
+ERROR 10000: Encountered error while evaluating XML query expression for XMLQUERY operator:
Could not find function: data SQLSTATE: XJ001: Java exception: 'Could not find function: data:
javax.xml.transform.TransformerException'.
 ij> -- These should all succeed.  Since it's Xalan that's actually doing
 ----- the query evaluation we don't need to test very many queries; we
 ----- just want to make sure we get the correct results when there is

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xml_general.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xml_general.out?view=diff&rev=448258&r1=448257&r2=448258
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xml_general.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xml_general.out
Wed Sep 20 09:35:09 2006
@@ -182,7 +182,7 @@
 ij> select i from t1 where xmlparse(document '<hein/>' preserve whitespace);
 ERROR 42X19: The WHERE or HAVING clause or CHECK CONSTRAINT definition is a 'XML' expression.
 It must be a BOOLEAN expression.
 ij> insert into t1 values (1, xmlparse(document '<oops>' preserve whitespace));
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details.
+ERROR 2200M: Invalid XML DOCUMENT: XML document structures must start and end within the
same entity.
 ERROR XJ001: Java exception: 'XML document structures must start and end within the same
entity.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> prepare ps1 as 'insert into t1(x) values XMLPARSE(document ? preserve whitespace)';
 ERROR 42Z79: Unable to determine the parameter type for XMLPARSE; try using a CAST.
@@ -311,7 +311,7 @@
 1         
 ----------
 <hmm/>    
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details.
+ERROR 2200M: Invalid XML DOCUMENT: Content is not allowed in prolog.
 ERROR XJ001: Java exception: 'Content is not allowed in prolog.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> select xmlserialize(x as char) from t1;
 1   
@@ -352,7 +352,7 @@
 select xmlserialize(xmlparse(document '<hmm>' preserve whitespace) as clob) from t2;
 1                                                                                       
                                       
 --------------------------------------------------------------------------------------------------------------------------------
-ERROR 2200M: Failed to parse XMLPARSE operand; see next exception for details.
+ERROR 2200M: Invalid XML DOCUMENT: XML document structures must start and end within the
same entity.
 ERROR XJ001: Java exception: 'XML document structures must start and end within the same
entity.: xxxFILTERED-SAX-EXCEPTIONxxx'.
 ij> select xmlserialize(xmlparse(document x preserve whitespace) as char(100)) from t1;
 ERROR 42X25: The 'XMLParse' function is not allowed on the 'XML' type.
@@ -668,7 +668,7 @@
     xmlquery('data(//@*)' passing by ref x returning sequence empty on empty)
   as char(70))
 from t1;
-ERROR 10000: Encountered error while evaluating XML query expression for XMLQUERY operator;
see next exception for details.
+ERROR 10000: Encountered error while evaluating XML query expression for XMLQUERY operator:
Could not find function: data
 ERROR XJ001: Java exception: 'Could not find function: data: javax.xml.transform.TransformerException'.
 ij> -- These should all succeed.  Since it's Xalan that's actually doing
 -- the query evaluation we don't need to test very many queries; we



Mime
View raw message