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
MAX of empty set causes internal error (sometimes)
-
- Posts: 124
- Joined: Sat May 24, 2008 4:49 pm
Re: MAX of empty set causes internal error (sometimes)
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:
I'll hopefully have this fixed shortly.
Code: Select all
max (relation {x integer} {}, x)
ERROR: Result of MAX on no values is undefined.
Line 1
Re: MAX of empty set causes internal error (sometimes)
This has been fixed in version 0.3.14.