Subject Re: Database corruption after alter table
Author c_pradelli
Hello,

I have a similar problem two times, but with varchar fields.
I don't know why but suddenly apears values bigger that the field can
hold. So after a backup, you can't restore it.
It was a customer table, and the field was the name of the customer.

Before somebody add a comment:
I never, never change a field definition directly from system tables,
I every time use ALTER TABLE.
I did't made any change the table of my example in the time when the
error apear.

To fix the problem I did UPDATE table SET field=substr(field,1,size)
and every thing ok.

With best regards
Christian

--- In ib-support@yahoogroups.com, Carsten Schäfer <ca_schaefer@g...>
wrote:
> Thomas,
> after my alter table i can do a select where f_id_ma_beleg != 0 and
i get no result,
> so it seems that everything ist alright.
> The error message during restore is:
> Arithmetic overflow or division by zero has occurred.
> arithmetic exception, numeric overflow, or string truncation.
> (the last message before this is:
> gbak: restoring data for table T_ERGEBNIS
> I don't understand this, because t_eregbnis has no connection to
the problem)
>
> If i do a
> update t_einfachangebot set f_id_ma_beleg = 0;
> (although the select before this update has shown that all values
are 0)
> and than make the backup it is restorable and everything is OK.
>
>
> gruß
> Carsten
>
> ----- Original Message -----
> From: "Thomas Steinmaurer" <ts@i...>
> To: <ib-support@yahoogroups.com>
> Sent: Thursday, March 06, 2003 12:49 PM
> Subject: RE: [ib-support] Re: Database corruption after alter table
>
>
> > Carsten,
> >
> > > Alexander,
> > > i think it is all right, what you have written, but it's not
relevant for my case.
> > > (there was no data insertet in the database after my updates)
> > > I forget to define a default value.
> > > Why is there no error raised from the database, if this leads
to unrestorable backups ?
> >
> > When I insert a new field with NOT NULL but without a DEFAULT
> > value, then dependent on the used data type a value is inserted
> > for existing records automatically. e.g. 0 for Integer, empty
> > string for VARCHAR, ... so this shouldn't be the problem.
> >
> > I'm using Firebird 1.0 Build 796.
> >
> > What exact error message do you get during the restore?
> >
> > Regards,
> > Thomas.
> >
> >
> >
> >
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > ib-support-unsubscribe@egroups.com
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
> >
> >