spurious error on selector invocation for a UDT value

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

spurious error on selector invocation for a UDT value

Post by HughDarwen »

The following type definition was accepted by Rel 1.07 beta:

type time possrep { c char constraint LENGTH(c) = 5 AND IS_DIGITS(SUBSTRING(c,0,2)) AND IS_DIGITS(SUBSTRING(c,3,2)) AND SUBSTRING(c,2,1) = ':'};

However, time('17:52') results in

ERROR: Failure executing external function: java.lang.reflect.InvocationTargetException

Line 1, column 6 near '"17:32"'


Hugh Darwen
HughDarwen
Posts: 124
Joined: Sat May 24, 2008 4:49 pm

Re: spurious error on selector invocation for a UDT value

Post by HughDarwen »

Since I reported this "bug" a few minutes ago I discovered that SUBSTRING(CHAR, INTEGER, INTEGER) takes an end position rather than a length as the third operand. So this is in fact a user error and not a bug. However, can I change this into a suggestion for a more explanatory error message. I can understand why this might be too tricky, though.

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

Re: spurious error on selector invocation for a UDT value

Post by Dave »

I'll see what I can do to provide a more meaningful error message when Java-based user-defined operators fail internally.

At the very least, I'll change the provided SUBSTRING definition so that it can't fail in this manner.
Post Reply