You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> on 2011/06/25 21:16:31 UTC

Subversion does not work with SQLite 3.7.7

Subversion does not work with SQLite 3.7.7:

$ svn co https://svn.apache.org/repos/asf/subversion/trunk subversion
subversion/svn/checkout-cmd.c:168: (apr_err=200030)
subversion/libsvn_client/checkout.c:229: (apr_err=200030)
subversion/libsvn_client/checkout.c:65: (apr_err=200030)
subversion/libsvn_wc/adm_files.c:403: (apr_err=200030)
subversion/libsvn_wc/adm_files.c:403: (apr_err=200030)
subversion/libsvn_wc/adm_files.c:403: (apr_err=200030)
subversion/libsvn_wc/wc_db.c:1438: (apr_err=200030)
subversion/libsvn_wc/wc_db.c:1390: (apr_err=200030)
subversion/libsvn_wc/wc_db_util.c:126: (apr_err=200030)
subversion/libsvn_subr/sqlite.c:930: (apr_err=200030)
subversion/libsvn_subr/sqlite.c:144: (apr_err=200030)
svn: E200030: database schema has changed, executing statement 'PRAGMA case_sensitive_like=1;PRAGMA synchronous=OFF;PRAGMA recursive_triggers=ON;'

Subversion works after downgrade of SQLite to 3.7.6.3.

-- 
Arfrever Frehtes Taifersar Arahesis

Re: Subversion does not work with SQLite 3.7.7

Posted by Greg Stein <gs...@gmail.com>.
On Sun, Jun 26, 2011 at 15:20, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Greg Stein wrote on Sun, Jun 26, 2011 at 15:11:43 -0400:
>> On Jun 26, 2011 9:45 AM, "Daniel Shahaf" <d....@daniel.shahaf.name> wrote:
>> >
>> > Daniel Shahaf wrote on Sun, Jun 26, 2011 at 16:21:00 +0300:
>> > > Running it:
>> > > [[[
>> > > % for i in foo-*; do echo ./$i; ./$i; done
>> > > ./foo-3.7.6.3
>> > > ./foo-3.7.7
>> > > Error 17: database schema has changed
>> > > %
>> > > ]]]
>> > >
>> >
>> > Correction:
>> >
>> > [[[
>> > % for i in foo-*; do rm foo.db && echo $i && ./$i; done
>> > foo-3.7.6.3
>> > foo-3.7.7
>> > Error 17: database schema has changed
>> > ]]]
>>
>> Wait a second. You rm the database?
>
> Yes, so that both foo-3.7.6.3 and foo-3.7.7 start with "foo.db"
> non-existing.  Comparing a run of foo-3.7.6.3 with "foo.db" not
> preexisting to a run of foo-3.7.7 with "foo.db" yes preexisting
> would be bogus.
>
>> I thought this was a bug with carrying
>> databases over to the new release?
>>
>
> The reproductions so far are about creating databases, not about
> upgrading them.
>
> It seems that sqlite-3.7.7 requires a "PRAGMA case_sensitive_like=1;" to
> be in the same transaction as a "PRAGMA user_version = user_version+1;".
> Since svn_sqlite__open() doesn't change USER_VERSION, it fails to create
> the database.

Gotcha.

I've replicated/confirmed the problem locally (on Mac OS X). Thanks
for the short reproduction script!

I'm going to take this to sqlite.org now.

<insert rant about their mailing lists/>

Cheers,
-g

Re: Subversion does not work with SQLite 3.7.7

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Greg Stein wrote on Sun, Jun 26, 2011 at 15:11:43 -0400:
> On Jun 26, 2011 9:45 AM, "Daniel Shahaf" <d....@daniel.shahaf.name> wrote:
> >
> > Daniel Shahaf wrote on Sun, Jun 26, 2011 at 16:21:00 +0300:
> > > Running it:
> > > [[[
> > > % for i in foo-*; do echo ./$i; ./$i; done
> > > ./foo-3.7.6.3
> > > ./foo-3.7.7
> > > Error 17: database schema has changed
> > > %
> > > ]]]
> > >
> >
> > Correction:
> >
> > [[[
> > % for i in foo-*; do rm foo.db && echo $i && ./$i; done
> > foo-3.7.6.3
> > foo-3.7.7
> > Error 17: database schema has changed
> > ]]]
> 
> Wait a second. You rm the database?

Yes, so that both foo-3.7.6.3 and foo-3.7.7 start with "foo.db"
non-existing.  Comparing a run of foo-3.7.6.3 with "foo.db" not
preexisting to a run of foo-3.7.7 with "foo.db" yes preexisting
would be bogus.

> I thought this was a bug with carrying
> databases over to the new release?
> 

The reproductions so far are about creating databases, not about
upgrading them.

It seems that sqlite-3.7.7 requires a "PRAGMA case_sensitive_like=1;" to
be in the same transaction as a "PRAGMA user_version = user_version+1;".
Since svn_sqlite__open() doesn't change USER_VERSION, it fails to create
the database.

> Cheers,
> -g

Re: Subversion does not work with SQLite 3.7.7

Posted by Greg Stein <gs...@gmail.com>.
On Jun 26, 2011 9:45 AM, "Daniel Shahaf" <d....@daniel.shahaf.name> wrote:
>
> Daniel Shahaf wrote on Sun, Jun 26, 2011 at 16:21:00 +0300:
> > Running it:
> > [[[
> > % for i in foo-*; do echo ./$i; ./$i; done
> > ./foo-3.7.6.3
> > ./foo-3.7.7
> > Error 17: database schema has changed
> > %
> > ]]]
> >
>
> Correction:
>
> [[[
> % for i in foo-*; do rm foo.db && echo $i && ./$i; done
> foo-3.7.6.3
> foo-3.7.7
> Error 17: database schema has changed
> ]]]

Wait a second. You rm the database? I thought this was a bug with carrying
databases over to the new release?

Cheers,
-g

Re: Subversion does not work with SQLite 3.7.7

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Sun, Jun 26, 2011 at 16:21:00 +0300:
> Running it:
> [[[
> % for i in foo-*; do echo ./$i; ./$i; done
> ./foo-3.7.6.3
> ./foo-3.7.7
> Error 17: database schema has changed
> % 
> ]]]
> 

Correction:

[[[
% for i in foo-*; do rm foo.db && echo $i && ./$i; done
foo-3.7.6.3
foo-3.7.7
Error 17: database schema has changed
]]]

Re: Subversion does not work with SQLite 3.7.7

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Sun, Jun 26, 2011 at 15:40:04 +0300:
> Hyrum K Wright wrote on Sat, Jun 25, 2011 at 21:11:28 -0500:
> > On Sat, Jun 25, 2011 at 7:26 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > > Arfrever Frehtes Taifersar Arahesis wrote on Sat, Jun 25, 2011 at 21:16:31 +0200:
> > >> svn: E200030: database schema has changed, executing statement 'PRAGMA case_sensitive_like=1;PRAGMA synchronous=OFF;PRAGMA recursive_triggers=ON;'
> > >>
> > >
> > > client-test fails with the same error.
> > >
> > >> Subversion works after downgrade of SQLite to 3.7.6.3.
> > 
> > Can we come up with a reproducible minimum case to send upstream to
> > the SQLite devs?  I suspect they'd be interested, as this release
> > shouldn't have broken any kind of compatibility.  (I can work on it
> > Monday if nobody beats me to it.)
> 
> Dropping the CASE_SENSITIVE_LIKE pragma cases the issue to go away.
> 

Here's an example program:

[[[
#include <assert.h>
#include <stdio.h>

#include "sqlite3.h"


#define BUSY_TIMEOUT 10000

int main(void)
{
  sqlite3 *db3;

  const char *path = "foo.db";
  int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE;
#ifdef SQLITE_OPEN_NOMUTEX
  flags |= SQLITE_OPEN_NOMUTEX;
#endif

  assert(SQLITE_OK == sqlite3_open_v2(path, &db3, flags, NULL));
  assert(SQLITE_OK == sqlite3_busy_timeout(db3, BUSY_TIMEOUT));
  assert(SQLITE_OK == sqlite3_busy_timeout(db3, BUSY_TIMEOUT));
  {
    char *errmsg;
    int err = sqlite3_exec(db3, "PRAGMA case_sensitive_like=1;", NULL, NULL, &errmsg);
    if (err != SQLITE_OK)
      printf("Error %d: %s\n", err, errmsg), sqlite3_free(errmsg);
  }
  return 0;
}
]]]

Compiling it:
[[[
for i in 3.7.6.3 3.7.7; do
  gcc -I sqlite-$i -W -Wall -ldl -lpthread -o foo-$i foo.c sqlite-$i/sqlite3.c
done
]]]

Running it:
[[[
% for i in foo-*; do echo ./$i; ./$i; done
./foo-3.7.6.3
./foo-3.7.7
Error 17: database schema has changed
% 
]]]


> > 
> > -Hyrum

Re: Subversion does not work with SQLite 3.7.7

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Hyrum K Wright wrote on Sat, Jun 25, 2011 at 21:11:28 -0500:
> On Sat, Jun 25, 2011 at 7:26 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> > Arfrever Frehtes Taifersar Arahesis wrote on Sat, Jun 25, 2011 at 21:16:31 +0200:
> >> svn: E200030: database schema has changed, executing statement 'PRAGMA case_sensitive_like=1;PRAGMA synchronous=OFF;PRAGMA recursive_triggers=ON;'
> >>
> >
> > client-test fails with the same error.
> >
> >> Subversion works after downgrade of SQLite to 3.7.6.3.
> 
> Can we come up with a reproducible minimum case to send upstream to
> the SQLite devs?  I suspect they'd be interested, as this release
> shouldn't have broken any kind of compatibility.  (I can work on it
> Monday if nobody beats me to it.)

Dropping the CASE_SENSITIVE_LIKE pragma cases the issue to go away.

> 
> -Hyrum

Re: Subversion does not work with SQLite 3.7.7

Posted by Hyrum K Wright <hy...@hyrumwright.org>.
On Sat, Jun 25, 2011 at 7:26 PM, Daniel Shahaf <d....@daniel.shahaf.name> wrote:
> Arfrever Frehtes Taifersar Arahesis wrote on Sat, Jun 25, 2011 at 21:16:31 +0200:
>> svn: E200030: database schema has changed, executing statement 'PRAGMA case_sensitive_like=1;PRAGMA synchronous=OFF;PRAGMA recursive_triggers=ON;'
>>
>
> client-test fails with the same error.
>
>> Subversion works after downgrade of SQLite to 3.7.6.3.

Can we come up with a reproducible minimum case to send upstream to
the SQLite devs?  I suspect they'd be interested, as this release
shouldn't have broken any kind of compatibility.  (I can work on it
Monday if nobody beats me to it.)

-Hyrum

Re: Subversion does not work with SQLite 3.7.7

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Arfrever Frehtes Taifersar Arahesis wrote on Sat, Jun 25, 2011 at 21:16:31 +0200:
> svn: E200030: database schema has changed, executing statement 'PRAGMA case_sensitive_like=1;PRAGMA synchronous=OFF;PRAGMA recursive_triggers=ON;'
> 

client-test fails with the same error.

> Subversion works after downgrade of SQLite to 3.7.6.3.
> 
> -- 
> Arfrever Frehtes Taifersar Arahesis