Subject Re: Database corruption after alter table
Author Alexander V.Nevsky
--- In ib-support@yahoogroups.com, Carsten Schäfer <ca_schaefer@g...>
wrote:
> Hi,
>
> i'm doing the following statements to add a column to a table (with
IBExpert PE,Firebird 1.02, Win2KSP3):
>
> ALTER TABLE T_EINFACHANGEBOT ADD f_id_ma_beleg INTEGER NOT NULL;
> ALTER TABLE T_EINFACHANGEBOT ADD CONSTRAINT "EA_MA_BELEG" FOREIGN
KEY ("F_ID_MA_BELEG") REFERENCES T_MITARBEITER ("ID_MITARBEITER") ON
UPDATE NO ACTION ON DELETE CASCADE;
>
> There is no error reportet from ibexpert, though i forget to define
a default value for the new column.
> A select shows me that 0 is insertet, which would be correct.
>
> But after this updates restore is not working anymore.
> The backup of this database shows no errors but with a restore of
this backup i get an aritmetic overflow ... error.
>
> Does anybody know why there is no error reportet for my updates,
though it corrupts the database ?

Carsten,
1. It is always recommended to commit any DDL statement before further
usage of changed object.
2. It is not recommended to mix usage quoted and unquoted the same
identifiers.
3. If your specify DEFAULT ... NOT NULL, server use default if column
is not filled, if not and table contain data and you don't fill new
column manually - you get unrestorable gbk.

Best regards, Alexander.