Subject | Re: Database corruption if server is not properly shutdown |
---|---|
Author | Adam |
Post date | 2005-09-05T00:08:23Z |
--- In firebird-support@yahoogroups.com, Federico Tello Gentile
<fgentile@s...> wrote:
well be your issue.
Your foreign key is defined as on delete set null, BUT you have a not
NULL constraint on the table. First thing you need to understand is
that constraints are internally implemented as triggers. Infact check
the RDB$CHECK_CONSTRAINTS, that will return the trigger name, then
check RDB$TRIGGERS
Depending on which order these constraints are processed, the NULL
value may be able to be stored in a NOT NULL field. This IMO would be
a bug.
You could do some experimenting and get rid of the not null
constraint, and see if this corruption goes away. If this is the bug,
then Firebird ideally should not allow you to create both
constraints, but it should be not too hard to come up with a work
around.
Adam
<fgentile@s...> wrote:
> Mensaje citado por Adam <s3057043@y...>:case it
>
> > I doubt it. Unless you have turned off forced writes in which
> > is your own fault. Real corruption on that sort of frequency ismore
> > likely to be a hardware related.case this is a
>
> I don't know how to disable that, so I guess I didn't do it. In
> system thing I use ubuntu Linux (kernel 2.6.10-5-386), Firebird1.5.1
> (superserver), JayBird 1.5.5 (latest). I created the database withall
> defaults, using UNICODE_FSS charset. I use the java client andFlamerobin
> 0.2.5.2 or 3 rows
> As I'm still in developement phase, the tables don't have more than
> and I'm the only user.if you
>
> >
> > Bogus errors could mean you have an incorrect message file, but
> > want assistance with diagnosing these errors you will need to beas a
> > specific with versions etc.
> >
> > How did you "drop and re create" the database? What sort of
> > "referential integrity" was broken, ie a declared constraint such
> > foreign key, or was it some action that a trigger you wrote ismeant
> > to prevent?driver) the
>
> Well, when I clicked on the tree view in Squirrel (it uses the java
> operation failed and no tables were shown after accepting the errormessage.
> The DBMS alowed me to delete a record leaving a child record(created as
> references ... on delete no action on update no action) with a nullvalue in
> the foreing key column. I recreated that foreign key with on deleteset null
> and I expected to fail because of the not null constraint, but thesame
> happened after I did the delete again.consistency
> I algo had an error when updating, telling "internal gds software
> check (partner index description not found (175)", but I didn't seehow this
> could be my wrong SQL code.Hopefully someone can confirm this or prove it is ok, but this may
well be your issue.
Your foreign key is defined as on delete set null, BUT you have a not
NULL constraint on the table. First thing you need to understand is
that constraints are internally implemented as triggers. Infact check
the RDB$CHECK_CONSTRAINTS, that will return the trigger name, then
check RDB$TRIGGERS
Depending on which order these constraints are processed, the NULL
value may be able to be stored in a NOT NULL field. This IMO would be
a bug.
You could do some experimenting and get rid of the not null
constraint, and see if this corruption goes away. If this is the bug,
then Firebird ideally should not allow you to create both
constraints, but it should be not too hard to come up with a work
around.
Adam
> I pasted the log at the end.creating a new DB
>
> I fixed the problem by shuting down, deleting the fdb file,
> with the same name and running again the DDL statements to createmy schema.
> The exact same updates that were failing, worked again. Thereferential
> integrity worked as I exected it, and all seemed great again.reboot and I
> Now I have FB as a service and it is properly shutdown every time I
> dont see any problems, so I guess it had to be that.description not
>
>
> Here's the log
>
> localhost (Server) Fri Sep 2 00:33:26 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Fri Sep 2 00:35:04 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Fri Sep 2 00:35:29 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Fri Sep 2 00:35:32 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Fri Sep 2 00:41:16 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Fri Sep 2 00:43:17 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
>
> And before that day I had the same errors.
>
>
> localhost (Server) Sun Aug 28 14:37:09 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Sun Aug 28 14:39:37 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Sun Aug 28 14:40:24 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Sun Aug 28 14:44:09 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))description not
>
> localhost (Server) Sun Aug 28 14:44:55 2005
> Database: /var/db/cobranzas.fdb
> internal gds software consistency check (partner index
> found (175))
>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.