db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <de...@segel.com>
Subject RE: Record not found in some SQL - Bug?
Date Wed, 28 Jan 2009 19:36:43 GMT


> -----Original Message-----
> From: jrgchip [mailto:chip@datamology.com]
> Sent: Wednesday, January 28, 2009 10:10 AM
> To: derby-user@db.apache.org
> Subject: Re: Record not found in some SQL - Bug?
> 
> 
> I have reported the problem as
> https://issues.apache.org/jira/browse/DERBY-4032.
> 
> The problem is reproducible given the current state of the DB.  However,
> if
> I reload the data, the problem goes away.  So I conclude that use of the
> DB
> has altered its state in some way as to cause this problem to arise.
> 
> I do not know if it is a single row that has the problem.  The Java app
> failed when it processed this record (because the record was "not found")
> and my investigation into the failure led me to discovery of this anomaly.
> There may be others.  I have had two very similar failures over the last 3
> months which I did not investigate as deeply...instead rebuilding the DB
> from scratch.  So it appears the problem does arise occasionally...at
> least
> in 10.3.2.1.
> 
> It's clear the SQL returns incorrect results.  I am hoping someone else
> has
> seen similar behavior and can point me to a solution.
> 

Ok,

Something doesn't sound right.

If you reload the data, the problem goes away.

This would imply that it's a data issue.
How are you loading the data in to the database?
If the data is in a flat file, can you use od to see what's in the data
file? Is there some funky character at the end of the troubled row?

If you reload the data, can you still reproduce the problem?
If you can reproduce the problem does it always happen with the same
row/record?
If you cut and paste the record to a different location in your load file
(assuming that you're loading from a file) does the same row get screwed up
or does another row get screwed up?

If you are on unix, can you make a copy of the flat file and then using vi,
truncate the data at the end of the row? (Just in case there's an invisible
bad character hiding.)

How did you load the data? 

What character set(s) are you using? Latin-1 or UTF-8?

Just out of curiosity, if you are using UTF-8 and you have a 2 byte set of
characters, when you use the length() function, do you see the number of
bytes or the number of characters. By this I mean suppose you have 'cat' but
each character is 2 bytes wide. Does length() return 3 or does it return 6?

My guess is that you have some corruption in your load file. But that's only
a SWAG and you haven't presented enough info on this.

Since your database is in a 'broken' state, what happens if you create a
copy of the table and select the rows that match your like 'xxxx%' clause
and insert them in to your temp duplicate table.

When you query the bogus row, do you get it or do you still get an error?

I'm pretty hesitant to call this case a bug... 

In using other databases, I've had similar 'ghosts' but they all turned out
to be from corrupted input files.

HTH

-Mike




Mime
View raw message