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
spurious error on selector invocation for a UDT value
-
- Posts: 124
- Joined: Sat May 24, 2008 4:49 pm
-
- Posts: 124
- Joined: Sat May 24, 2008 4:49 pm
Re: spurious error on selector invocation for a UDT value
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
Hugh
Re: spurious error on selector invocation for a UDT value
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.
At the very least, I'll change the provided SUBSTRING definition so that it can't fail in this manner.