On Tue, Jan 25, 2011 at 11:31 AM, Roger Binns <rog...@rogerbinns.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> The issues I have with this file control are:
>
> - - It is documented as "internal" but my code sees it hence it is now part
> of
> the external interface of SQLite
>

You are right.  This has been fixed.  New "draft" documentation is now
available at http://www.sqlite.org/draft/c2ref/c_fcntl_chunk_size.html


>
> - - None of the existing SQLite VFS code implement it
>

None of the existing *published* VFS code uses it.  We are working on a
specialized VFS for a client that does need it, however.


>
> - - It duplicates the existing xSync method
>

You are right.  We have changed the name to SQLITE_FCNTL_SYNC_OMITTED and
modifid the code so tha the new file-control is only issued when PRAGMA
synchronous=OFF, as a substitute for invoking xSync.  (The custom
VFS eluded to earlier needs to know when the sync would have been issued,
even if no syncs are issued.)


>
> - - It bypasses the normal error return mechanism, which is also not
> checked
>
> Behind the scenes it looks like it is being provided for VFS that are not
> in
> sync mode to let them know when a sync would have been done.


That is exactly the reason for this change.  I have updated the name of the
file-control, and its documentation, to better reflect this fact.  I also
modified the implementation so that the new file-control is issued in place
of, not in addition to, the xSync method, which better reflects its purpose.

Thanks for the helpful feedback.  Please let us know if you find this
solution inadequate or if you encounter other problems.



>  This is
> because an individual VFS does not itself know if it is in sync mode.  I'd
> argue that a far better approach is to let a VFS know if it is in sync mode
> or not rather than hiding that information from it, and always call its
> xSync method which it can choose to obey or ignore as appropriate.  (You
> could also have an xSync flag that indicates syncing is optional.)
>
> Changing things that way is a little more intrusive but is a better long
> term way of structuring things than the short term expedient way
> SQLITE_FCNTL_SYNC has been implemented.
>
> Roger
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk0++uIACgkQmOOfHg372QQuigCg1C+TQMI+Zq1ySBkzjMZBZfgq
> ybgAoMfuf8A7HH/sKMdb7Rx8utAxlhH1
> =LvHp
> -----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