On Mon, Sep 21, 2015 at 8:23 PM, Richard Hipp <drh at sqlite.org> wrote:

> On 9/21/15, Hugues Bruant <hugues at aerofs.com> wrote:
> > On Mon, Sep 21, 2015 at 6:49 PM, Richard Hipp <drh at sqlite.org> wrote:
> >
> >> On 9/21/15, Hugues Bruant <hugues at aerofs.com> wrote:
> >> > Table schema:
> >> >
> >> > CREATE TABLE cv (cv_s integer not null, cv_o blob not null, cv_t
> >> > integer
> >> > not null, primary key(cv_s, cv_o));
> >> >
> >> > Prepared statement:
> >> >
> >> > UPDATE cv SET cv_t=? where cv_s=? and cv_o=?;
> >>
> >> My guess is that the WHERE clause matches no rows.  So it isn't
> >> silently failing, it is doing exactly what it is suppose to do:
> >> Update only those rows you have specified.
> >>
> > I wish it where that simple.
> >
> > The where clause should match, as evidenced by the fact that:
> >
> > SELECT cv_t from cv where cv_s=? and cv_o=?;
> >
> > returns the correct value both before and after the failing UPDATE.
> >
> > If that's not convincing enough, I should mention that the code checks
> the
> > change count and falls back to an INSERT if the UPDATE reports that no
> > rows where updated. This results in a SQLITE_CONSTRAINT error, which
> > is how we discovered that the update was failing in the first place.
>
> If you can tell us how to reproduce the problem, we'll work on it for
> you.  But until then, there isn't much we can do.
>
I've been trying to isolate the issue but that's unfortunately non-trivial.

I would be happy to build and test a patched sqlite with extra logging,
some sort of vdbe execution tracing or really anything that would allow
more information to be gathered from the full application. If nothing of
the sort is possible I'll work on extracting a minimal reproducer but that
will probably take a while.

Which version of SQLite is this, btw?   What OS?  Are you compiling
> SQLite yourself, or using a library that somebody has built for you?
> What programming language are you using?
>
As mentioned in the first email of the thread:
OS: OS X (we use Linux and Windows as well but so far haven't reproduced
the issue on these environments)
SQLite version: both 3.8.7 and 3.8.11.1 exhibit the issue
We build native code ourselves and access the db through the sqlite-jdbc
java wrapper ( https://github.com/xerial/sqlite-jdbc ).

Reply via email to