MAX of empty set causes internal error (sometimes)

This forum is to report technical problems with Rel.
Post Reply
HughDarwen
Posts: 124
Joined: Sat May 24, 2008 4:49 pm

MAX of empty set causes internal error (sometimes)

Post by HughDarwen »

The current value of relvar SP is
RELATION {S# CHARACTER, P# CHARACTER, Qty INTEGER} {
TUPLE {S# "S1", P# "P1", Qty 300},
TUPLE {S# "S1", P# "P2", Qty 200},
TUPLE {S# "S1", P# "P3", Qty 400},
TUPLE {S# "S1", P# "P4", Qty 200},
TUPLE {S# "S1", P# "P5", Qty 100},
TUPLE {S# "S1", P# "P6", Qty 100},
TUPLE {S# "S2", P# "P1", Qty 300},
TUPLE {S# "S2", P# "P2", Qty 400},
TUPLE {S# "S3", P# "P2", Qty 200},
TUPLE {S# "S4", P# "P2", Qty 200},
TUPLE {S# "S4", P# "P4", Qty 300},
TUPLE {S# "S4", P# "P5", Qty 400}

MAX(SP, S#) yields, correctly, 'S4'.

MAX(SP WHERE FALSE, S#) gives rise to this:
RelTransaction: abort failed: com.sleepycat.je.DatabaseException: (JE 3.3.69) Transaction 2151 detected open cursors while aborting

But this doesn't always happen with MAX of the empty set. For example:
max (RELATION { S# CHAR }{ }, S#)

ERROR: null
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: MAX of empty set causes internal error (sometimes)

Post by Dave »

It's a bug in the mechanism that's supposed to generate an error message for MAX, MIN, UNION, D_UNION, and INTERSECT when performed on relations of cardinality zero. Instead of "ERROR: null" or an internal error, it's supposed to print:

Code: Select all

max (relation {x integer} {}, x) 
 
ERROR: Result of MAX on no values is undefined.

Line 1
I'll hopefully have this fixed shortly.
Dave
Site Admin
Posts: 372
Joined: Sun Nov 27, 2005 7:19 pm

Re: MAX of empty set causes internal error (sometimes)

Post by Dave »

This has been fixed in version 0.3.14.
Post Reply