Soooo, as far as I can tell, this behaviour changed in October, with
http://www.sqlite.org/cvstrac/chngview?cn=3470 .  Which is before fts2
even existed!  So fts2 has been broken in this way essentially
forever.  *sigh*.  [I'm not entirely clear why that change introduced
this difference, but it did, so be it.]

Anyhow, moving on...  anyone have opinions on how to handle this?  The
patches to fix fts1/2 are simple, but mean that older code will break
if it tries to read the database created by the patched version.
Older code is already broken, but only if you use vacuum.  My
inclination is to add code to fts2 and fts1 to upgrade tables, and put
a prominent disclaimer somewhere.

-scott


On 7/17/07, Scott Hess <[EMAIL PROTECTED]> wrote:
[Forwarding gist of an offline conversation with Joe.]

Looks about like what my patch looks like.  Needs to additionally
handle %_segments.rowid (same problem, but you need to insert more
than 16 docs to see it).

I'm also tossing in some test cases.  My patch should be ready this
afternoon.  I'm not going to check it in, yet, because there's the
question of backwards/forwards compatibility to be addressed.

-scott


On 7/17/07, Joe Wilson <[EMAIL PROTECTED]> wrote:
> Scott, I've attached a possible patch to the ticket.
> It seems to work, but I may have missed some something.
> Tell me what you think.
>
> --- Scott Hess <[EMAIL PROTECTED]> wrote:
> > I've updated the bug with an example of how this breaks fts tables
> > (fts1 or fts2).  I'm thinking on the problem.
> > http://www.sqlite.org/cvstrac/tktview?tn=2510
> >
> > Summary: In sqlite 3.4, running vacuum with fts2 or fts1 tables can
> > break the table if you've done any deletions.
> >
> > I'll try to add more constraints to the summary today,
> >
> > -scott
> >
> >
> > On 7/17/07, Scott Hess <[EMAIL PROTECTED]> wrote:
> > > WTH!  Wow, this is a very unexpected change.  I must have not been
> > > paying attention at some point.
> > >
> > > -scott
> > >
> > >
> > > On 7/17/07, Ralf Junker <[EMAIL PROTECTED]> wrote:
> > > >
> > > > >>The standard way to have non-TEXT information associated with rows in
> > > > >>an fts table would be a separate table which joins with the fts table
> > > > >>on rowid.
> > > > >
> > > > >I have not tested this, but if the FTS2 rowid is the standard SQLite 
rowid, I believe that
> > it will be affected by VACUUM change of rowids recently reported on this 
list? If so, could this
> > be fixed?
> > > >
> > > > VACUUM does modify FTS2 rowids. Here is the test:
> > > >
> > > >   drop table if exists a;
> > > >
> > > >   create virtual table a using fts2 (t);
> > > >
> > > >   insert into a (t) values ('one');
> > > >   insert into a (t) values ('two');
> > > >   insert into a (t) values ('three');
> > > >
> > > >   select rowid, * from a;
> > > >
> > > >   delete from a where t = 'two';
> > > >   vacuum;
> > > >
> > > >   select rowid, * from a;
> > > >
> > > > Unfortunately there is no workaround since table a is auto-generated by 
the FTS2 module.
> > Created ticket #2510.
> > > >
> > > >
> > > > 
-----------------------------------------------------------------------------
> > > > To unsubscribe, send email to [EMAIL PROTECTED]
> > > > 
-----------------------------------------------------------------------------
> > > >
> > > >
> > >
> >
> > 
-----------------------------------------------------------------------------
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > 
-----------------------------------------------------------------------------
> >
> >
>
>
>
>
> 
____________________________________________________________________________________
> Looking for a deal? Find great prices on flights and hotels with Yahoo! 
FareChase.
> http://farechase.yahoo.com/
>
> -----------------------------------------------------------------------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> -----------------------------------------------------------------------------
>
>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to