On Mon, Oct 4, 2010 at 1:53 AM, Roger Binns <rog...@rogerbinns.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 10/03/2010 10:01 PM, Max Vlasov wrote:
> > On Sun, Oct 3, 2010 at 7:21 PM, Roger Binns <rog...@rogerbinns.com>
> wrote:
> >
> >>
> >> Also note that xTruncate may be called to make a file longer.
> >>
> >>
> > Roger, are you sure about that?
>
> That has certainly been stated in the past.  Unfortunately the current
> io_methods documentation doesn't say anything about xTruncate.
>
> Looking through the source, the vast majority of cases would indeed result
> in a shorter file with writes used to extend.  But there may be lengthening
> from walCheckpoint() and possibly as part of the backup process.
>
> In any event unless there is an explicit guarantee from the SQLite authors
> that xTruncate will never be called to lengthen a file (including in future
> versions) then it should be something that should be checked for and
> errored
> or implemented as appropriate.
>

I'm not willing to say we will support this forever, but recent versions of
SQLite do work correctly if xTruncate is a no-op.  I think the support for
this began with version 3.7.0.

If xTruncate is a no-op, then the VACUUM command will not actually reduce
the size of the database file, of course.  But everything else should work
as expected.

The xTruncate=noop support was added for a popular consumer gadget that uses
SQLite on an operating system that does not support file truncation.


>
> Roger
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkypa/EACgkQmOOfHg372QRugwCguKqqfXhf2+/jrwDYnYwid7CY
> mjkAn1JnTYIhlKey7YW6QumIWe4oLwJR
> =5hwL
> -----END PGP SIGNATURE-----
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to