FWIW, we don't have auto-vaccuum enabled, unless that is a default setting.

My diagnostic information for when the situation happened (which is very
random) was:

Called:
  rc = ftruncate(((unixFile*)id)->h, (off_t)nByte);

Values:
  rc = 0
  (off_t)nByte = 44032
  nByte = 4317821136  <-- I haven't been able to figure out why this is...
  errno = EINVAL
  
After error, I called:
  rc = fstat(((unixFile*)id)->h, &buf);

Values:
  buf.st_size = 25600

HTH,
Mark

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 29, 2007 11:26 AM
> To: [email protected]
> Subject: Re: [sqlite] ftruncate() for values greater than file size
> 
> 
> Joe Wilson <[EMAIL PROTECTED]> wrote:
> > > On Nov 29, 2007, at 9:19 PM, Mark Brown wrote:
> > > > I have finally tracked down a bug that has plagued by vxWorks  
> > > > port.  It
> > > > appears that our file system's implementation of 
> ftruncate() does  
> > > > not like
> > > > to "truncate" a file larger than its current size, and returns  
> > > > EINVAL for
> > > > this operation.
> > 
> > This is interesting - ftruncate's behavior is not defined by POSIX
> > in this case.  SQLite shouldn't rely on the commonly implemented 
> > zero-fill extension.
> > 
> 
> It doesn't.  In fact we didn't realize the ftruncate() was
> being called with values larger than the current file size.
> 
> I have been looking into the problem.  It apparently only
> occurs when you have autovacuum enabled.
> 
> It looks like attempt to ftruncate() to a larger size can
> simply be ignored and everything continues to work.  We will
> make sure that ftruncate() does not get called with a size
> larger than the current file size in future releaes.
> 
> --
> D. Richard Hipp <[EMAIL PROTECTED]>
> 
> 
> --------------------------------------------------------------
> ---------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> --------------------------------------------------------------
> ---------------
> 
> 



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to