On Mon, 08 Jul 2013 00:37:55 -0400
Igor Tandetnik <i...@tandetnik.org> wrote:

> I don't believe it's SQLite's job to ensure the programmer doesn't
> shoot herself in the foot. After all, you don't expect, say, the C++
> compiler to prevent you from destroying an object while another part
> of the program holds a pointer to it. This SQLite's behavior is little
> different.

Au contraire, mon ami: it is very much SQLite's job to prevent logical
programming errors from corrupting the data.  

The analogy to C++ is inapt. C++ makes very few guarantees about an
object's lifetime.  That is its design and definition.  SQLite OTOH is
a DBMS.  If used in a way that could cause it to return unreliable
results, its only alternative is to return an error.  

More apt would be if open(2), called with O_EXLOCK twice on the
same file, were to permit the second process to modify the file
as the first one reads it.  In fact, I'd be interested if you could
point to a single standard C library function that, when called
out-of-sequence, doesn't return an error but permits the process to
proceed destructively.  

> > An interface that "requires a detailed understanding of the
> > [internals]" is not simple; in effect the entire SQLite codebase
> > becomes "the interface".  And an undocumented one at that.
> 
> The documented behavior is - if you modify the data as you iterate
> over that same data, the results are unpredictable. 

Where does it say that?  I haven't been able to find any reference to
this behavior.  The documentation I have found contradicts what I
understand you to be saying:

        http://www.sqlite.org/c3ref/step.html

        "SQLITE_MISUSE means that the this routine was called
inappropriately. Perhaps it was called on a prepared statement that has
already been finalized or on one that had previously returned
SQLITE_ERROR or SQLITE_DONE. Or it could be the case that the same
database connection is being used by two or more threads at the same
moment in time."

There is no "SQLITE_OK_BUT_YOU_ARE_ON_YOUR_OWN" afaik.  

--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to