Bugs item #1886326, was opened at 2008-02-04 15:05 Message generated for change (Comment added) made by mr-meltdown You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1886326&group_id=56967
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: PF/runtime Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Theodora Tsikrika (theodora_t) Assigned to: Fabian (mr-meltdown) Summary: MonetDB JDBC driver exception for XQuery with no results Initial Comment: Hi all, I am using the MonetDB JDBC driver in a java program similar to the sample program in http://monetdb.cwi.nl/projects/monetdb/XQuery/Documentation/The-JDBC-Library.html#The-JDBC-Library to execute an XQuery query (instead of an SQL one). When the query does not return any results, I get the following: > Exception in thread "main" java.lang.ArithmeticException: / by zero When the query returns results, it works fine. I am using MonetDB/XQuery checked out from CVS HEAD on 5th November 2007: # MonetDB Server v4.21.0 # based on GDK v1.21.0 # Compiled for x86_64-redhat-linux-gnu/64bit with 32bit OIDs; dynamically linked. # MonetDB/XQuery module v0.21.0 loaded > java -version java version "1.7.0" IcedTea Runtime Environment (build 1.7.0-b21) IcedTea 64-Bit Server VM (build 1.7.0-b21, mixed mode) Regards, Theodora ---------------------------------------------------------------------- >Comment By: Fabian (mr-meltdown) Date: 2008-02-20 21:02 Message: Logged In: YES user_id=963970 Originator: NO 2 and a half hour later ... Due to missing history (cvs moves) and missing documentation (on my end) it took quite some while to figure out what was the "correct" way to solve this bug. In the end it al boiled down on the limitation of the XQuery backend to only support full-results-at-once, which means the resource allocation of JDBC needs to allocate the entire result at once. If the result is 0 rows big, however, then things went wrong when calculating the current cache block. Anyway, for the future we now know why we did this cache block calulation thing like this again... The fix I checked in is slightly different from what I gave you, but yours shouldn't hurt in use. TEST ADDED xquery/tests/BugTracker/Tests/JDBC_0_results.SF-1886326 ---------------------------------------------------------------------- Comment By: Theodora Tsikrika (theodora_t) Date: 2008-02-04 15:49 Message: Logged In: YES user_id=1785117 Originator: YES for $d at $rank in (1,2,3) return $d[$rank=4] ---------------------------------------------------------------------- Comment By: Fabian (mr-meltdown) Date: 2008-02-04 15:30 Message: Logged In: YES user_id=963970 Originator: NO Do you happen to know a query which needs no documents which returns an empty result, so I can test? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1886326&group_id=56967 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Monetdb-bugs mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/monetdb-bugs
