Subject Re: Proposal to add SQLState to Vulcan
Author Bill Oliver
> Is this really a problem? I mean, it can be solved with the current
> functionality. Just append more information at the point where the
error is
> generated.
> if (divisor == 0)
> ERR_post(isc_arith_except, 0);
> =>
> if (divisor == 0)
> ERR_post(isc_arith_except,
> isc_arg_gds, isc_zero_div,
0);
>

Claudio is right - I think the problem here is simply that we just
don't call the right error for divide by zero. There is
exception_integer_divide_by_zero and exception_float_divide_by_zero
that aren't used in jrd/evl.cpp where they should be.

> > Here's a case where we don't generate a specific error, but
should. We
> > should map error below to SQLSTATE 42S21, "Column already
exists."
> >
> > SQL> create table test (i integer) ;
> > SQL> alter table test add i integer ;
> > Statement failed, SQLCODE = -607
> > unsuccessful metadata update
> > -STORE RDB$RELATION_FIELDS failed
> > -attempt to store duplicate value (visible to active
transactions) in
> > unique index "RDB$INDEX_15"
>
> IMHO, this just requires more work in DYN. These messages refer to
raw
> operations on system tables.
>
> C.
>

Yes, i think that is the right answer.