[jira] Updated: (DERBY-2739) Use DOM interfaces to implement XML operators

2011-03-01 Thread Rick Hillegas (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Hillegas updated DERBY-2739:
-

Attachment: releaseNote.html

Adjusted the release note.

> Use DOM interfaces to implement XML operators
> -
>
> Key: DERBY-2739
> URL: https://issues.apache.org/jira/browse/DERBY-2739
> Project: Derby
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 10.3.1.4
>Reporter: Knut Anders Hatlen
>Assignee: Knut Anders Hatlen
>Priority: Minor
> Fix For: 10.8.0.0
>
> Attachments: infinity-NaN.diff, ns-npe.diff, numeric-tests.diff, 
> releaseNote.html, releaseNote.html, remove-xalan-jars.diff, 
> stricter-assertions.diff, xml-interfaces-2.diff, xml-interfaces-3.diff, 
> xml-interfaces.diff
>
>
> Sun's Java 1.5.0 and higher includes Xalan, but Derby doesn't find it because 
> it has been moved to a non-standard package. Derby should be able to detect 
> and use these classes if it cannot find Xalan in the standard package on the 
> classpath. This would make it easier for many users to start using Derby's 
> XML features.
> See also the discussion in this thread: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200705.mbox/%[email protected]%3e>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (DERBY-2739) Use DOM interfaces to implement XML operators

2011-02-28 Thread Knut Anders Hatlen (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2739:
--

Attachment: remove-xalan-jars.diff

Attaching a patch that removes the references to xercesImpl.jar, xalan.jar and 
serializer.jar from the build scripts and build instructions.

> Use DOM interfaces to implement XML operators
> -
>
> Key: DERBY-2739
> URL: https://issues.apache.org/jira/browse/DERBY-2739
> Project: Derby
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 10.3.1.4
>Reporter: Knut Anders Hatlen
>Assignee: Knut Anders Hatlen
>Priority: Minor
> Fix For: 10.8.0.0
>
> Attachments: infinity-NaN.diff, ns-npe.diff, numeric-tests.diff, 
> releaseNote.html, remove-xalan-jars.diff, stricter-assertions.diff, 
> xml-interfaces-2.diff, xml-interfaces-3.diff, xml-interfaces.diff
>
>
> Sun's Java 1.5.0 and higher includes Xalan, but Derby doesn't find it because 
> it has been moved to a non-standard package. Derby should be able to detect 
> and use these classes if it cannot find Xalan in the standard package on the 
> classpath. This would make it easier for many users to start using Derby's 
> XML features.
> See also the discussion in this thread: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200705.mbox/%[email protected]%3e>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (DERBY-2739) Use DOM interfaces to implement XML operators

2011-02-28 Thread Knut Anders Hatlen (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2739:
--

Attachment: releaseNote.html

Attaching a release note for this issue.

> Use DOM interfaces to implement XML operators
> -
>
> Key: DERBY-2739
> URL: https://issues.apache.org/jira/browse/DERBY-2739
> Project: Derby
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 10.3.1.4
>Reporter: Knut Anders Hatlen
>Assignee: Knut Anders Hatlen
>Priority: Minor
> Fix For: 10.8.0.0
>
> Attachments: infinity-NaN.diff, ns-npe.diff, numeric-tests.diff, 
> releaseNote.html, stricter-assertions.diff, xml-interfaces-2.diff, 
> xml-interfaces-3.diff, xml-interfaces.diff
>
>
> Sun's Java 1.5.0 and higher includes Xalan, but Derby doesn't find it because 
> it has been moved to a non-standard package. Derby should be able to detect 
> and use these classes if it cannot find Xalan in the standard package on the 
> classpath. This would make it easier for many users to start using Derby's 
> XML features.
> See also the discussion in this thread: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200705.mbox/%[email protected]%3e>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (DERBY-2739) Use DOM interfaces to implement XML operators

2011-02-23 Thread Knut Anders Hatlen (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2739:
--

Issue & fix info: [Release Note Needed]  (was: [Patch Available])
   Fix Version/s: 10.8.0.0

I've committed xml-interfaces-3.diff to trunk with revision 1073874.

Leaving the issue open until a release note has been attached. I'll also see if 
some of the jar files under tools/java can be removed now. I think xalan.jar, 
serializer.jar and xercesImpl.jar aren't used in the build anymore.

> Use DOM interfaces to implement XML operators
> -
>
> Key: DERBY-2739
> URL: https://issues.apache.org/jira/browse/DERBY-2739
> Project: Derby
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 10.3.1.4
>Reporter: Knut Anders Hatlen
>Assignee: Knut Anders Hatlen
>Priority: Minor
> Fix For: 10.8.0.0
>
> Attachments: infinity-NaN.diff, ns-npe.diff, numeric-tests.diff, 
> stricter-assertions.diff, xml-interfaces-2.diff, xml-interfaces-3.diff, 
> xml-interfaces.diff
>
>
> Sun's Java 1.5.0 and higher includes Xalan, but Derby doesn't find it because 
> it has been moved to a non-standard package. Derby should be able to detect 
> and use these classes if it cannot find Xalan in the standard package on the 
> classpath. This would make it easier for many users to start using Derby's 
> XML features.
> See also the discussion in this thread: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200705.mbox/%[email protected]%3e>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (DERBY-2739) Use DOM interfaces to implement XML operators

2011-02-18 Thread Knut Anders Hatlen (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2739:
--

Attachment: xml-interfaces-3.diff

Uploading version 3 of the patch, with these minor changes:

1) Removed some debug code that I'd forgotten in the test framework.

2) Improved the checking of XPath requirements by using 
DOMImplementation.getFeature() instead of DOMImplementation.hasFeature(). The 
problem solved by this change is when a recent and fully capable Xalan is on 
the classpath with a Java 1.4.2 implementation, but not in an endorsed 
directory. In that case, the Xalan implementation satisfies the requirements, 
but the interfaces don't (because xml-apis.jar doesn't override the old 
interfaces that come with the JVM unless it's in an endorsed directory).

Since hasFeature() is a DOM Level 2 method available in Java 1.4.2, whereas 
getFeature() is DOM Level 3, we could have the situation where hasFeature() 
exists and says that XPath level 3 is supported by the implementation (which is 
true), but when we try to use it by calling getFeature(), we get a 
NoSuchMethodError because the interface is too old.

By using the getFeature() method to check the level of support, we'll detect 
this lack of supporting interfaces earlier so that we don't attempt to call 
methods that don't exist on the platform.

> Use DOM interfaces to implement XML operators
> -
>
> Key: DERBY-2739
> URL: https://issues.apache.org/jira/browse/DERBY-2739
> Project: Derby
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 10.3.1.4
>Reporter: Knut Anders Hatlen
>Assignee: Knut Anders Hatlen
>Priority: Minor
> Attachments: infinity-NaN.diff, ns-npe.diff, numeric-tests.diff, 
> stricter-assertions.diff, xml-interfaces-2.diff, xml-interfaces-3.diff, 
> xml-interfaces.diff
>
>
> Sun's Java 1.5.0 and higher includes Xalan, but Derby doesn't find it because 
> it has been moved to a non-standard package. Derby should be able to detect 
> and use these classes if it cannot find Xalan in the standard package on the 
> classpath. This would make it easier for many users to start using Derby's 
> XML features.
> See also the discussion in this thread: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200705.mbox/%[email protected]%3e>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (DERBY-2739) Use DOM interfaces to implement XML operators

2011-02-18 Thread Knut Anders Hatlen (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2739:
--

Issue & fix info: [Patch Available]

All the regression tests ran cleanly with Sun's Java 6. I've also verified that 
the XML tests pass with 1.4.2 and 1.5.0. Setting the "Patch Available" flag.

> Use DOM interfaces to implement XML operators
> -
>
> Key: DERBY-2739
> URL: https://issues.apache.org/jira/browse/DERBY-2739
> Project: Derby
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 10.3.1.4
>Reporter: Knut Anders Hatlen
>Assignee: Knut Anders Hatlen
>Priority: Minor
> Attachments: infinity-NaN.diff, ns-npe.diff, numeric-tests.diff, 
> stricter-assertions.diff, xml-interfaces-2.diff, xml-interfaces.diff
>
>
> Sun's Java 1.5.0 and higher includes Xalan, but Derby doesn't find it because 
> it has been moved to a non-standard package. Derby should be able to detect 
> and use these classes if it cannot find Xalan in the standard package on the 
> classpath. This would make it easier for many users to start using Derby's 
> XML features.
> See also the discussion in this thread: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200705.mbox/%[email protected]%3e>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (DERBY-2739) Use DOM interfaces to implement XML operators

2011-02-18 Thread Knut Anders Hatlen (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2739:
--

Attachment: xml-interfaces-2.diff

Attaching a new patch, xml-interfaces-2.diff, which supersedes the
xml-interfaces.diff patch. There aren't many differences between the
two patches, so the description in the comment from 03/Jan/11 is still
accurate. Also note the svn magic mentioned in that comment to
reintroduce tools/java/xml-apis.jar for the build.

The new patch adds some more comments, and it addresses the only known
outstanding issue with the previous patch, that is, formatting of
numbers returned by XPath queries had changed from the original
implementation.

In short, the problem was that the previous patch used
Double.toString() to format the numbers, which caused these
differences:

  - scientific notation was used for sufficiently small or big
numbers, for instance "1.23E-5" instead of "0.123"

  - trailing zeros after the decimal point weren't removed, so we'd
get "14.0" instead of "14"

Especially this latter difference caused problems, for example when
inserting results from XPath queries into columns of type INT, since
the former string ("14.0") couldn't be cast to INT. The XPath
libraries return all numbers as double values, so there's no way to
know whether the query actually returned the integer 14 or the
floating point number 14.0.

In this patch, the formatting of numbers is changed back to how it
used to be. The original implementation would format numbers the same
way as the XPath string function, as described here:
http://www.w3.org/TR/xpath/#function-string

I didn't find any method in the Java class library that formatted the
numbers exactly that way, but I found that BigDecimal.toPlainString()
was very close, and if we manually removed trailing zeros (including
the decimal point if the entire fraction part is zero), the results
seemed to be identical to the old results, and the tests passed.

Now the problem was that toPlainString() was a new method in Java 5,
so it's not avaialble on Java 1.4 or CDC Foundation Profile 1.1, which
we still need to support. Luckily, on those older platforms,
BigDecimal.toString() is defined the same way as toPlainString() on
newer platforms. The definition of toString() was changed in Java 5,
so we cannot use that method on all platforms, but using
toPlainString() when available and falling back to toString()
otherwise, seems to give consistent results across the platforms
(tested with 1.4.2, 1.5.0 and 1.6.0).

The resulting code in SqlXmlUtil.numberToString() is a bit ugly, using
reflection to call the correct method, but I thought that doing it
this way was less error-prone than writing our own code to format the
numbers manually.

> Use DOM interfaces to implement XML operators
> -
>
> Key: DERBY-2739
> URL: https://issues.apache.org/jira/browse/DERBY-2739
> Project: Derby
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 10.3.1.4
>Reporter: Knut Anders Hatlen
>Assignee: Knut Anders Hatlen
>Priority: Minor
> Attachments: infinity-NaN.diff, ns-npe.diff, numeric-tests.diff, 
> stricter-assertions.diff, xml-interfaces-2.diff, xml-interfaces.diff
>
>
> Sun's Java 1.5.0 and higher includes Xalan, but Derby doesn't find it because 
> it has been moved to a non-standard package. Derby should be able to detect 
> and use these classes if it cannot find Xalan in the standard package on the 
> classpath. This would make it easier for many users to start using Derby's 
> XML features.
> See also the discussion in this thread: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200705.mbox/%[email protected]%3e>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (DERBY-2739) Use DOM interfaces to implement XML operators

2011-02-17 Thread Knut Anders Hatlen (JIRA)

 [ 
https://issues.apache.org/jira/browse/DERBY-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Knut Anders Hatlen updated DERBY-2739:
--

Summary: Use DOM interfaces to implement XML operators  (was: Automatically 
detect and use the Xalan which is included in Sun's Java 1.5.0 and higher)

I'm changing the issue summary so that it's not tied to one particular 
vendor/version of the JVM.

> Use DOM interfaces to implement XML operators
> -
>
> Key: DERBY-2739
> URL: https://issues.apache.org/jira/browse/DERBY-2739
> Project: Derby
>  Issue Type: Improvement
>  Components: SQL
>Affects Versions: 10.3.1.4
>Reporter: Knut Anders Hatlen
>Assignee: Knut Anders Hatlen
>Priority: Minor
> Attachments: infinity-NaN.diff, ns-npe.diff, numeric-tests.diff, 
> stricter-assertions.diff, xml-interfaces.diff
>
>
> Sun's Java 1.5.0 and higher includes Xalan, but Derby doesn't find it because 
> it has been moved to a non-standard package. Derby should be able to detect 
> and use these classes if it cannot find Xalan in the standard package on the 
> classpath. This would make it easier for many users to start using Derby's 
> XML features.
> See also the discussion in this thread: 
> http://mail-archives.apache.org/mod_mbox/db-derby-dev/200705.mbox/%[email protected]%3e>

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira