Subject Re: [firebird-support] Gbak 1.5.2 fails
Author Helen Borrie
At 09:21 AM 5/02/2005 +0000, you wrote:

>In article <5.2.0.9.2.20050205121322.073b3dc8@...>, Helen Borrie
>wrote:
> > Did you change the table's definition between the original restore and the
> > second one? It can only be MATTYPE or ASPECT.
>
>No changes to the entire database
>
> > Maybe, since ASPECT is a char(8), it might be that an insert in between
> > times, that applied the default, has caused it (guessing wildly...the
> > default value has only 6 characters..., so it's recognised on restore as
> > "truncated"...?)
>
>So does a default need to use the entire width of the field?
A char type is fixed length. I haven't heard of this problem with
too-short char defaults before and I never use char types when I'm not
expecting fixed length data so haven't bumped into it.

But then, DSQL pads chars out to their full length before storing
them. The engine doesn't know it needs to use a default until the request
has already passed through DSQL, so maybe it writes 6 chars for the default
and doesn't pad.

I'd suggest testing this theory by running an update on that column,
update...set aspect = '-none- ' where aspect = '-none-' and see whether
that fixes the problem.

If it does, it's an inconsistency that needs to be known about. DDL should
probably refuse to accept a char type default that is shorter than the
field specification.

./heLen