Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-20 Thread Darko Volaric
0

I roll my own.


> On Mar 16, 2018, at 4:37 PM, Richard Hipp  wrote:
> 
> This is a survey, the results of which will help us to make SQLite faster.
> 
> How many tables in your schema(s) use AUTOINCREMENT?
> 
> I just need a single integer, the count of uses of the AUTOINCREMENT
> in your overall schema.  You might compute this using:
> 
>   sqlite3 yourfile.db '.schema --indent' | grep -i autoincrement | wc -l
> 
> Private email to me is fine.  Thanks for participating in this survey!
> -- 
> D. Richard Hipp
> d...@sqlite.org
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [EXTERNAL] R*Trees query data cached?

2018-03-20 Thread David Ashman - Zone 7 Engineering, LLC
Thank you for the quick reply Hick.  I've implemented your script file in C 
since I'm running this application in the embedded world with no OS.  I don't 
see a .describe in the SQLite documentation.  I've tried to use .schema but 
that returns an error.  Do you have another suggestion to obtain the table 
information you had in mind?





  From: Hick Gunter 
 To: 'SQLite mailing list'  
 Sent: Tuesday, March 20, 2018 9:04 AM
 Subject: Re: [sqlite] [EXTERNAL] R*Trees query data cached?
   
SQLite does not have "query caching". It does have a "page cache" that will 
keep heavily used pages iin memory. There is also the possibility of a 
file-system/os-level cache. To break down the 1.6 seconds required for the 
first query, try executing an sql script. In linux this would be along the 
lines of:

> date; sqlite3 file.db < script.sql;date

With script.sql containing:

Select strftime('%Y-%m-%d %H:%M:%S.%f');
Select strftime('%Y-%m-%d %H:%M:%S.%f');
.describe adas_link_geometry
Select strftime('%Y-%m-%d %H:%M:%S.%f');
.describe idx_adas_link_geometry
Select strftime('%Y-%m-%d %H:%M:%S.%f');
Select ;
Select strftime('%Y-%m-%d %H:%M:%S.%f');
Select ;
Select strftime('%Y-%m-%d %H:%M:%S.%f');
Select ;
Select strftime('%Y-%m-%d %H:%M:%S.%f');

This should give you an idea of where the time is being spent.


-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von David Ashman - Zone 7 Engineering, LLC
Gesendet: Dienstag, 20. März 2018 16:34
An: sqlite-users@mailinglists.sqlite.org
Betreff: [EXTERNAL] [sqlite] R*Trees query data cached?

Hello -
I have a question on SQLite query data buffering.
I'm successfully using SQLite v3.22.0 on an embedded ARM processor from ST with 
SD card.  The database file size is about 750MB.  The file system is Segger 
emFile FAT32.  I've configured SQLite to use 6MB RAM for heap.  I've done some 
query time benchmarking and found that the very first R*Trees query takes about 
1.6 seconds to complete.  Each successive R*Trees query (same query string with 
slightly different search parameters) takes about 11ms to complete.  Being new 
to SQLite and spatial queries, I'm trying to understand the substantial query 
time differences... does SQLite cache data from each query for future queries? 
The initial query:SELECT LINK_ID, FROM_REF_ELEVATION, TO_REF_ELEVATION FROM 
adas_link_geometry, idx_adas_link_geometry WHERE adas_link_geometry.ROWID = 
idx_adas_link_geometry.id AND minLat > 454760320 AND maxLat < 454800320 AND 
minLong > -1226807072 AND maxLong < -1226767072;

Thanks in advance,Dave
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


   
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-20 Thread petern
Regarding SQLite "next_val()", the following works with or without "NOT
NULL":

CREATE TABLE t(rowid INTEGER PRIMARY KEY NOT NULL);
INSERT INTO t VALUES (NULL),(NULL);
SELECT * FROM t;
--rowid
--1
--2
DELETE FROM t WHERE rowid=1;
INSERT INTO t VALUES (NULL);
SELECT * FROM t;
--rowid
--2
--3

But these do not work at all:

CREATE TABLE t(rowid INT PRIMARY KEY);
INSERT INTO t VALUES (NULL),(NULL);
SELECT * FROM t;
--rowid
--
--

CREATE TABLE t(rowid INT PRIMARY KEY NOT NULL);
INSERT INTO t VALUES (NULL),(NULL);
--Error: NOT NULL constraint failed: t.rowid

CREATE TABLE t(rowid INTEGER PRIMARY KEY) WITHOUT ROWID;
INSERT INTO t VALUES (NULL),(NULL);
--Error: NOT NULL constraint failed: t.rowid


Peter


On Tue, Mar 20, 2018 at 9:44 AM, Chris Locke 
wrote:

> >  some people seem to think that an int primary key can be auto
> incrementing, it can't
>
> But it works in the same way  sort of.  Its auto incrementing, with the
> caveat that if the last row is deleted, the previous number will be used
> again.  Depending on the database schema, this may or may not cause issues.
>
>
> Thanks,
> Chris
>
>
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-20 Thread Chris Locke
>  some people seem to think that an int primary key can be auto
incrementing, it can't

But it works in the same way  sort of.  Its auto incrementing, with the
caveat that if the last row is deleted, the previous number will be used
again.  Depending on the database schema, this may or may not cause issues.


Thanks,
Chris


On Tue, Mar 20, 2018 at 9:45 AM, Paul Sanderson <
sandersonforens...@gmail.com> wrote:

>  I read that - but my point was more that some people seem to think that an
> int primary key can be auto incrementing, it can't.
>
>
> SQLite version 3.18.0 2017-03-28 18:48:43
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
> sqlite> create table test (id integer primary key autoincrement);
> sqlite> create table test2 (id int primary key autoincrement);
> Error: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY
> sqlite>
>
> Paul
> www.sandersonforensics.com
> skype: r3scue193
> twitter: @sandersonforens
> Tel +44 (0)1326 572786
> http://sandersonforensics.com/forum/content.php?195-SQLite-
> Forensic-Toolkit
> -Forensic Toolkit for SQLite
> email from a work address for a fully functional demo licence
>
> On 20 March 2018 at 08:48, R Smith  wrote:
>
> >
> > On 2018/03/20 10:24 AM, Paul Sanderson wrote:
> >
> >> Autoincrement can ONLY be used with an integer primary key
> >>
> >
> > I think Peter's shouting is more about the inability to distinguish via
> > SQL or Pragma between an INTEGER PRIMARY KEY and an INT PRIMARY KEY, both
> > of which are of course integer and can be auto-incrementing, but only one
> > of which is an alias for rowid.
> >
> >
> >
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-20 Thread David Raymond
select name
from sqlite_master
where
type = 'table'
and exists (
  select 1
  from pragma_table_info(sqlite_master.name)
  where pk > 0
)
and not exists (
  select 1
  from pragma_index_list(sqlite_master.name)
  where origin = 'pk'
)
order by name;

Tables which have a primary key, but no index created by a primary key clause.
I  that covers only integer primary key tables, but am not sure for 
things like extensions, virtual tables, etc.


SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> .timer off

sqlite> .eqp off

sqlite> .mode column

sqlite> create table ipk (id integer primary key, foo, bar);

sqlite> create table intpk (id int primary key, foo, bar);

sqlite> create table nopk (id integer, foo, bar);

sqlite> create table cpk (id1 integer, id2 integer, foo, bar, primary key (id1, 
id2));

sqlite> create table wri (id integer primary key, foo, bar) without rowid;

sqlite> create table ipkd (id integer primary key desc, foo, bar);

sqlite> select name
   ...> from sqlite_master
   ...> where
   ...> type = 'table'
   ...> and exists (
   ...>   select 1 from pragma_table_info(sqlite_master.name)
   ...>   where pk > 0
   ...> )
   ...> and not exists (
   ...>   select 1
   ...>   from pragma_index_list(sqlite_master.name)
   ...>   where origin = 'pk'
   ...> )
   ...> order by name;
name
--
ipk

sqlite>


-Original Message-
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Peter Halasz
Sent: Tuesday, March 20, 2018 2:50 AM
To: SQLite mailing list
Subject: Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

When needed I use a declared INTEGER PRIMARY KEY.
>
>
MAYBE THAT WOULD HAVE BEEN IN THE SURVEY TOO BUT I GUESS THERE WAS NO WAY
TO INCLUDE A SMALL PIECE OF SQL TO RELIABLY CHECK FOR INTEGER PRIMARY KEY

YES I AM SHOUTING
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [EXTERNAL] R*Trees query data cached?

2018-03-20 Thread Hick Gunter
SQLite does not have "query caching". It does have a "page cache" that will 
keep heavily used pages iin memory. There is also the possibility of a 
file-system/os-level cache. To break down the 1.6 seconds required for the 
first query, try executing an sql script. In linux this would be along the 
lines of:

> date; sqlite3 file.db < script.sql;date

With script.sql containing:

Select strftime('%Y-%m-%d %H:%M:%S.%f');
Select strftime('%Y-%m-%d %H:%M:%S.%f');
.describe adas_link_geometry
Select strftime('%Y-%m-%d %H:%M:%S.%f');
.describe idx_adas_link_geometry
Select strftime('%Y-%m-%d %H:%M:%S.%f');
Select ;
Select strftime('%Y-%m-%d %H:%M:%S.%f');
Select ;
Select strftime('%Y-%m-%d %H:%M:%S.%f');
Select ;
Select strftime('%Y-%m-%d %H:%M:%S.%f');

This should give you an idea of where the time is being spent.


-Ursprüngliche Nachricht-
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von David Ashman - Zone 7 Engineering, LLC
Gesendet: Dienstag, 20. März 2018 16:34
An: sqlite-users@mailinglists.sqlite.org
Betreff: [EXTERNAL] [sqlite] R*Trees query data cached?

Hello -
I have a question on SQLite query data buffering.
I'm successfully using SQLite v3.22.0 on an embedded ARM processor from ST with 
SD card.  The database file size is about 750MB.  The file system is Segger 
emFile FAT32.  I've configured SQLite to use 6MB RAM for heap.  I've done some 
query time benchmarking and found that the very first R*Trees query takes about 
1.6 seconds to complete.  Each successive R*Trees query (same query string with 
slightly different search parameters) takes about 11ms to complete.  Being new 
to SQLite and spatial queries, I'm trying to understand the substantial query 
time differences... does SQLite cache data from each query for future queries? 
The initial query:SELECT LINK_ID, FROM_REF_ELEVATION, TO_REF_ELEVATION FROM 
adas_link_geometry, idx_adas_link_geometry WHERE adas_link_geometry.ROWID = 
idx_adas_link_geometry.id AND minLat > 454760320 AND maxLat < 454800320 AND 
minLong > -1226807072 AND maxLong < -1226767072;

Thanks in advance,Dave
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] R*Trees query data cached?

2018-03-20 Thread David Ashman - Zone 7 Engineering, LLC
Hello -
I have a question on SQLite query data buffering.
I'm successfully using SQLite v3.22.0 on an embedded ARM processor from ST with 
SD card.  The database file size is about 750MB.  The file system is Segger 
emFile FAT32.  I've configured SQLite to use 6MB RAM for heap.  I've done some 
query time benchmarking and found that the very first R*Trees query takes about 
1.6 seconds to complete.  Each successive R*Trees query (same query string with 
slightly different search parameters) takes about 11ms to complete.  Being new 
to SQLite and spatial queries, I'm trying to understand the substantial query 
time differences... does SQLite cache data from each query for future queries?  
The initial query:SELECT LINK_ID, FROM_REF_ELEVATION, TO_REF_ELEVATION FROM 
adas_link_geometry, idx_adas_link_geometry WHERE adas_link_geometry.ROWID = 
idx_adas_link_geometry.id AND minLat > 454760320 AND maxLat < 454800320 AND 
minLong > -1226807072 AND maxLong < -1226767072;

Thanks in advance,Dave
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE_CANTOPEN_ISDIR and other extended error codes

2018-03-20 Thread Deon Brewis
How do you actually get a SQLITE_CANTOPEN_ISDIR error?

In order to get an extended result code, we need to pass a sqlite3* connection, 
but you don't have that if the file can't be opened in the first place. Like... 
if it was a directory.

I see how this is implemented internally - it generally masks rc with 
db->errMask but in the case of openDatabase it returns just a hardcoded:
return rc & 0xff;

which truncates the 0x20e (SQLITE_CANTOPEN_ISDIR) error it had earlier into a 
SQLITE_CANTOPEN.

Is there some magic here that I'm missing? Shouldn't the default errMask be a 
DEFINE ?

- Deon


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE3 FTS5 prefix query get mismatch result

2018-03-20 Thread Dan Kennedy

On 03/20/2018 02:31 PM, zheng xiaojin wrote:

(I am not sure whether you have seen my message, so resend again)
Hi,
When I use FTS5, I have met that, there are some cases which will get mis-match 
results with prefix search.

Like "select * from tbl_fts where tbl_fts match 'lucy*';",which I want to get records like 
"lucya","lucyabc" etc, and

"lux" or "lulu" is not what I want but returned.

Such problems are not common, But I have tried to build such test case which 
can lead to this problem very easy.


Thanks for looking into and reporting this problem. Are you able to post 
the source for the program you used to execute the test described below?


Dan.



Here is how I generate it:

1) create an fts5 table. and insert some record like "lucya","lucyb".

2) prepare some records: a) lusheng b)lulu; c)lunix; d)luma; e) pengyu. a,b,c,d 
are have some same prefix(lu), e is some other random case.

3) before insert into the fts table with 2) records, appending some random 
letter to make each record different.

Like: "lulu","luluabc","luluefg", also "lunix","lunixabc",etc

4) for-loop insert, and each loop trying to lantch the query 'lucy*', \

check the match result will finding the mis-match result, the corrent results should be 
"lucya","lucyb", not "luluabc"...


When mis-match happen, I try to analyze the prefix search mechanism and find 
that, there are 2 points which I think have problems:

1) fts5LeafSeek, when search failed, and exec goto search_failed, in 
search_failed, the 2 if condition will not satisfy commonly. In my mind, I 
think it should return,

but not, and then the search_success logic exec.

2) fts5SetupPrefixIter, when gather results, the logic to set the flag bNewTerm 
has some leak, which will set bNewTerm=false,

but the record is not what we want indeed.


These 2 logic problems lead to mis-match results. I try to remove the bNewTerm 
logic directly, and make it compare every loog,

then, the mis-match results disappear.

// relevant code

Change below

if (bNewTerm) {

if (nTerm < nToken || memcmp(pToken, pTerm, nToken)) break;

}

to

if (nTerm < nToken || memcmp(pToken, pTerm, nToken)) break;


Need your help to recheck the FTS5 prefix search logic, thank you very much.

Yours,

xiaojin zheng


获取 Outlook for Android

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-20 Thread Paul Sanderson
 I read that - but my point was more that some people seem to think that an
int primary key can be auto incrementing, it can't.


SQLite version 3.18.0 2017-03-28 18:48:43
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table test (id integer primary key autoincrement);
sqlite> create table test2 (id int primary key autoincrement);
Error: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY
sqlite>

Paul
www.sandersonforensics.com
skype: r3scue193
twitter: @sandersonforens
Tel +44 (0)1326 572786
http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit
-Forensic Toolkit for SQLite
email from a work address for a fully functional demo licence

On 20 March 2018 at 08:48, R Smith  wrote:

>
> On 2018/03/20 10:24 AM, Paul Sanderson wrote:
>
>> Autoincrement can ONLY be used with an integer primary key
>>
>
> I think Peter's shouting is more about the inability to distinguish via
> SQL or Pragma between an INTEGER PRIMARY KEY and an INT PRIMARY KEY, both
> of which are of course integer and can be auto-incrementing, but only one
> of which is an alias for rowid.
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-20 Thread R Smith


On 2018/03/20 10:24 AM, Paul Sanderson wrote:

Autoincrement can ONLY be used with an integer primary key


I think Peter's shouting is more about the inability to distinguish via 
SQL or Pragma between an INTEGER PRIMARY KEY and an INT PRIMARY KEY, 
both of which are of course integer and can be auto-incrementing, but 
only one of which is an alias for rowid.



___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-20 Thread Paul Sanderson
Autoincrement can ONLY be used with an integer primary key

https://sqlite.org/autoinc.html

On Tue, 20 Mar 2018 at 06:50, Peter Halasz  wrote:

> When needed I use a declared INTEGER PRIMARY KEY.
> >
> >
> MAYBE THAT WOULD HAVE BEEN IN THE SURVEY TOO BUT I GUESS THERE WAS NO WAY
> TO INCLUDE A SMALL PIECE OF SQL TO RELIABLY CHECK FOR INTEGER PRIMARY KEY
>
> YES I AM SHOUTING
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
-- 
Paul
www.sandersonforensics.com
skype: r3scue193
twitter: @sandersonforens
Tel +44 (0)1326 572786
http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit
-Forensic Toolkit for SQLite
email from a work address for a fully functional demo licence
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE3 FTS5 prefix query get mismatch result

2018-03-20 Thread zheng xiaojin
(I am not sure whether you have seen my message, so resend again)
Hi,
When I use FTS5, I have met that, there are some cases which will get mis-match 
results with prefix search.

Like "select * from tbl_fts where tbl_fts match 'lucy*';",which I want to get 
records like "lucya","lucyabc" etc, and

"lux" or "lulu" is not what I want but returned.

Such problems are not common, But I have tried to build such test case which 
can lead to this problem very easy. Here is how I generate it:

1) create an fts5 table. and insert some record like "lucya","lucyb".

2) prepare some records: a) lusheng b)lulu; c)lunix; d)luma; e) pengyu. a,b,c,d 
are have some same prefix(lu), e is some other random case.

3) before insert into the fts table with 2) records, appending some random 
letter to make each record different.

Like: "lulu","luluabc","luluefg", also "lunix","lunixabc",etc

4) for-loop insert, and each loop trying to lantch the query 'lucy*', \

check the match result will finding the mis-match result, the corrent results 
should be "lucya","lucyb", not "luluabc"...


When mis-match happen, I try to analyze the prefix search mechanism and find 
that, there are 2 points which I think have problems:

1) fts5LeafSeek, when search failed, and exec goto search_failed, in 
search_failed, the 2 if condition will not satisfy commonly. In my mind, I 
think it should return,

but not, and then the search_success logic exec.

2) fts5SetupPrefixIter, when gather results, the logic to set the flag bNewTerm 
has some leak, which will set bNewTerm=false,

but the record is not what we want indeed.


These 2 logic problems lead to mis-match results. I try to remove the bNewTerm 
logic directly, and make it compare every loog,

then, the mis-match results disappear.

// relevant code

Change below

if (bNewTerm) {

if (nTerm < nToken || memcmp(pToken, pTerm, nToken)) break;

}

to

if (nTerm < nToken || memcmp(pToken, pTerm, nToken)) break;


Need your help to recheck the FTS5 prefix search logic, thank you very much.

Yours,

xiaojin zheng


获取 Outlook for Android

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How many AUTOINCREMENT tables are in your schema?

2018-03-20 Thread Peter Halasz
When needed I use a declared INTEGER PRIMARY KEY.
>
>
MAYBE THAT WOULD HAVE BEEN IN THE SURVEY TOO BUT I GUESS THERE WAS NO WAY
TO INCLUDE A SMALL PIECE OF SQL TO RELIABLY CHECK FOR INTEGER PRIMARY KEY

YES I AM SHOUTING
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users