Subject Re: [firebird-support] Unknown value after insert
Author Helen Borrie
At 01:38 AM 24/05/2008, Jacek Borowski wrote:
> -----Original Message-----
> From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of Jacek Borowski
> Sent: 23. mai 2008 14:32
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Unknown value after insert
>
> Hi,
>
> From about 2 months ago, from time to time (10-15 times) We have wrong field value after insert.
>
> Server: Firebird CS 1.5.5.4926
> Database ~18GB working from 7 years, backed up regullary
> Linux RedHat Exterprise, kernel 2.6.18
> TABLE ~20k records
>
> First example:
>
> TABLE (fld1 varchar(2),fld2 integer,fld3 integer,fld4 varchar(1),fld5 integer)
>
> insert into TABLE (fld1, fld2, fld3) values ('AA',2,1) ;
> Table, has no triggers.
>
> select * from TABLE where fld4 is null - no results
> select * from TABLE where fld4 is not null - no results
> select strlen(fld4) from TABLE where fld1='AA' and fld2=2 and fld3=1 - result 0
> select Ascii_val(fld4) from TABLE where fld1='AA' and fld2=2 and fld3=1 - result 32 (space ???)
>
> after backup/restore
>
> select * from TABLE where fld4 is null - correct result
>
> Second example:
>
> insert into TABLE (fld1, fld2, fld3, fld5) values ('AA',2,1,1) ;
> select * from TABLE - I see in grid | AA | 2 | 1 | null | 1 |
> select * from TABLE where fld5=1 - no results
> select * from TABLE where fld5>1 - no results
> select * from TABLE where fld5<1 - no results
>
> backup/restore - selects are OK
>
> After few days we have new records with problem as shown above.
>
> Whats wrong ?

Possibly stating the obvious....but are you trying to do these selects from the table from a different transaction while the new inserts remain uncommitted? One transaction cannot see the uncommitted work of another - even if the two transactions are running within the same connection...and you will see the same kind of behaviour if you are using COMMIT RETAINING with snapshot transactions.

./heLen