Re: [sqlite] (no subject)

2017-10-06 Thread Jim Dodgen
Thanks I needed a Laugh, try clicking on one of the links at the bottom of your emails and unsubscribe. *Jim Dodgen* On Fri, Oct 6, 2017 at 7:41 PM, cindy estepp wrote: > stop emailing me i do not know you > ___ >

[sqlite] (no subject)

2017-10-06 Thread cindy estepp
stop emailing me i do not know you ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] The IS operator

2017-10-06 Thread Richard Hipp
On 10/6/17, J. King wrote: > Are there any other > reasons I might perhaps want to use = rather than IS that I'm not aware > of? "NULL IS NULL" is true, but "NULL = NULL" is not true (it is null). Other than that, the IS operator and the = operator are the same. "IS" in

Re: [sqlite] TR: Database base disk is malformed issue

2017-10-06 Thread Joe Mistachkin
Jean-François RIGHI wrote: > > 1) We were working with an old version of System.data.sqlite.dll (1.0.66) > wich was prety stable. But we needed to work with concat index (CREATE > INDEX IDX ON TABLE_1 (FIELD1 || FIELD2) to upgrade performance. Since we > changed the dll we often got a Database

Re: [sqlite] PRAGMA optimize; == no busy handler?

2017-10-06 Thread Keith Medcalf
This is no different that any other xDBMS that permits access to "row" numbers. If you fail to tell the database engine that your "rowid" is a persistent meaningful value (and not just the current "row number" of the row in some storage somewhere) then you ought not be surprised if its value

[sqlite] The IS operator

2017-10-06 Thread J. King
I've been using the IS operator to the exclusion of = in my application's queries so that I'm not surprised by some input being null and giving unexpected results. My rationale is that if I'm consistent, my software will be as well (all else being equal, anyway...). The IS operator is

Re: [sqlite] PRAGMA optimize; == no busy handler?

2017-10-06 Thread Jens Alfke
> On Oct 6, 2017, at 3:13 PM, Roman Fleysher > wrote: > > Vacuuming seems to belong to a different thread, but let me say that it is > not always warranted. Vacuuming may change/reassign ROWIDs. The docs say "The VACUUM command may change the ROWIDs of

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Jens Alfke
> On Oct 6, 2017, at 1:32 PM, Kent Williams wrote: > > Instead of > > aMatchinfo = (unsigned int *)sqlite3_value_blob(apVal[0]); > > Something like: > > if((aMatchinfo = (unsigned int *)sqlite3_value_blob(apVal[0])) == 0) { > sqlite3_result_error(pCtx, >

Re: [sqlite] PRAGMA optimize; == no busy handler?

2017-10-06 Thread Roman Fleysher
Dear SQLiters, Vacuuming seems to belong to a different thread, but let me say that it is not always warranted. Vacuuming may change/reassign ROWIDs. If you have two databases (backup and production?) that used to be linked via such a key, it will break. Roman

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Kent Williams
I like that it checks aMatchinfo for internal consistency. The one thing that isn't in the new rankfunk. Instead of aMatchinfo = (unsigned int *)sqlite3_value_blob(apVal[0]); Something like: if((aMatchinfo = (unsigned int *)sqlite3_value_blob(apVal[0])) == 0) {

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Dan Kennedy
A few corrections on this page about FTS (hopefully not too nit-picky): 1) === BEGIN QUOTE === -- ("driver" may also appear in the title, but this alone will not satisfy the. -- query criteria). === END QUOTE === There should not be a dot in "the." 2) === BEGIN QUOTE === putting the keyword

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Dominique Pellé
Dan Kennedy wrote: On 10/06/2017 11:58 PM, Richard Hipp wrote: > >> On 10/6/17, Jens Alfke wrote: >> >>> Thanks for posting this — my adaptation of that sample code in my project >>> had the same bug. >>> >>> I’m not sure how the SQL in your

Re: [sqlite] Please remove multiple warnings from compiler about optimisation, variable conversion, signed overflow and many more potential errors.

2017-10-06 Thread Richard Damon
If a given macro is sometimes tested with #if defined(FOO) and other times with #if FOO, then that would be an error unless it is intended that the two respond differently to a #define FOO 0 statement (perhaps to enable but not advertise an option). My comments were about reasons why it makes

Re: [sqlite] PRAGMA optimize; == no busy handler?

2017-10-06 Thread Darko Volaric
In the case of a database that ran hot all the time a better strategy would be to have an online backup of the database running at all time and then run analyze on that periodically, then update the stats table in the live database when that was finished. I'm not sure what the rules are for

Re: [sqlite] PRAGMA optimize; == no busy handler?

2017-10-06 Thread Toby Dickenson
Thats problematic. It means I have to guess how long my analyze might take, and guess at a suitable time when that scan wont block other clients. Its a good reason to never call analyze. Does it have to be so? It seems to me (possibly naively) that the scan could be performed in one long read

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Dan Kennedy
On 10/06/2017 11:58 PM, Richard Hipp wrote: On 10/6/17, Jens Alfke wrote: Thanks for posting this — my adaptation of that sample code in my project had the same bug. I’m not sure how the SQL in your application gets generated, but if you allow untrusted SQL, it’s still

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Richard Hipp
On 10/6/17, Kent Williams wrote: > > As for 'untrusted SQL' -- if you open your databases (or our clients' > databases) to unrestricted queries, you wouldn't need a malicious use of > full-text search to ruin everybody's day ;-) > That was my thinking too, for a long

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Kent Williams
Luckily, any SQL we generate is done by our own developers, and runs through QA.  Not only that, we've got a guy who likes to find exploits for our backend software. As for 'untrusted SQL' -- if you open your databases (or our clients' databases) to unrestricted queries, you wouldn't need a

Re: [sqlite] How to handle such situation

2017-10-06 Thread Igor Korot
Hi Keith, On Oct 6, 2017 12:59 PM, "Keith Medcalf" wrote: The return code will tell you the cause of the failure Love them. Check them. Every time. I'm checking them. But if there is a ROLLBACK failure I will tell the user and when the app will close sqlite3_close()

Re: [sqlite] How to handle such situation

2017-10-06 Thread Keith Medcalf
The return code will tell you the cause of the failure  Love them.  Check them.  Every time. Original message From: Simon Slavin Date:2017-10-05 09:50 (GMT-07:00) To: SQLite mailing list Subject: Re: [sqlite] How

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Richard Hipp
On 10/6/17, Jens Alfke wrote: > Thanks for posting this — my adaptation of that sample code in my project > had the same bug. > > I’m not sure how the SQL in your application gets generated, but if you > allow untrusted SQL, it’s still possible to create a query that can cause

Re: [sqlite] How to handle such situation

2017-10-06 Thread Keith Medcalf
Check your return codes.  They will usually tell you thr cause of yhe faiure. Original message From: Jens Alfke Date:2017-10-05 09:32 (GMT-07:00) To: SQLite mailing list Cc: General Discussion of SQLite Database

Re: [sqlite] XOR operator

2017-10-06 Thread Jens Alfke
> On Oct 6, 2017, at 9:25 AM, Alex Henrie wrote: > > Still, it would be a little nicer if I > could write a == b XOR c == d instead of (a == b) != (c == d). You can easily implement an “xor(a, b)” function in C. It’s maybe 20 lines of code including registering it.

Re: [sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Jens Alfke
Thanks for posting this — my adaptation of that sample code in my project had the same bug. I’m not sure how the SQL in your application gets generated, but if you allow untrusted SQL, it’s still possible to create a query that can cause the rank function to crash. For example (assuming I have

Re: [sqlite] XOR operator

2017-10-06 Thread Alex Henrie
2017-10-06 1:28 GMT-06:00 Clemens Ladisch : > Alex Henrie wrote: >> I wanted to use the XOR operator in a query today, but then found out >> that SQLite doesn't support it. > > For boolean values, "a XOR b" = "a <> b". > For binary values, "a XOR b" = "(a | b) - (a & b)".

Re: [sqlite] Fossil: ERROR: SQL error: no such table: ticketchng

2017-10-06 Thread Richard Hipp
On 10/6/17, Domingo Alvarez Duarte wrote: > Richard told me to issue a command that > somehow upgraded the fossil database, this time I tried "fossil > reconstruct" ... I don't remember what I said before, but I suspect it was "fossil rebuild". -- D. Richard Hipp

[sqlite] Fossil: ERROR: SQL error: no such table: ticketchng

2017-10-06 Thread Domingo Alvarez Duarte
Hello ! I'm using fossil and went through it's pages to have an overview of it and when viewing a ticket it shows this error message: ERROR: SQL error: no such table: ticketchng I had a problem before and Richard told me to issue a command that somehow upgraded the fossil database, this

Re: [sqlite] PRAGMA optimize; == no busy handler?

2017-10-06 Thread Keith Medcalf
Android sucks badly.  Dont knpw who it is designed for but it sure aint me ... Anyway, "offline maintenance" is for IT Shops to annoy their customers.  I think everywhere I worked for the past 40 years has been a 25 by 8 by 366 operation. So scheduling something for "idle hours" meant knowing

Re: [sqlite] 'database disk image is malformed' only on the mac

2017-10-06 Thread Simon Slavin
On 6 Oct 2017, at 1:55pm, Fahad wrote: > I can now reliably corrupt my database - and this happens only when some > other process is writing to the database while I perform sqlite3_close_v2 on > the connections. Reliable corruption will help investigation tremendously. To

Re: [sqlite] XOR operator

2017-10-06 Thread Richard Hipp
On 10/6/17, R Smith wrote: > I'd also like to see a Unary NOT operator, such that you can say: a = !b In SQL and SQLite that would be: a = NOT b > But, I guess that's only feasible in a strongly typed language. (1) I object to the characterization of SQLite not being

Re: [sqlite] 'database disk image is malformed' only on the mac

2017-10-06 Thread Fahad
I can now reliably corrupt my database - and this happens only when some other process is writing to the database while I perform sqlite3_close_v2 on the connections. I'll explain what I'm doing. Since the last I wrote, I've disabled all the flags other than these: #define SQLITE_ENABLE_FTS3 1

[sqlite] TR: Database base disk is malformed issue

2017-10-06 Thread Jean-François RIGHI
Hello everyone, Following this Issue we would like to rollback from the last version (1.0.105.2) to the version 1.0.66. We’re going to drop the special index wich are not compatibles with this version. But we would like to know if both version are compatible (structures,syntaxe, etc) or we

[sqlite] custom rank function with FTS3/FTS4: potential crash.

2017-10-06 Thread Kent Williams
I'll send a note to the git repo owner as well, but it's worth mentioning to any potential writer of custom ranking function. Background here: We implemented a custom ranking function, let's call it XRank.  An end user complained that a query along these lines was crashing Sqlite: CREATE

Re: [sqlite] XOR operator

2017-10-06 Thread R Smith
On 2017/10/06 11:31 AM, Simon Slavin wrote: On 6 Oct 2017, at 9:12am, Rowan Worth wrote: On 6 October 2017 at 15:42, wrote: On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: For boolean values, "a XOR b" = "a <> b". Is the <> operator documented

Re: [sqlite] XOR operator

2017-10-06 Thread Darko Volaric
> However, '&' and '|' and '<<' and '>>' do not seem to be defined, either > there or in Almost none of the operators are defined. All that section needs is a sentence at the start saying "The operators have the same meaning as ANSI C except as described below." > On Oct 6, 2017, at 11:31

Re: [sqlite] XOR operator

2017-10-06 Thread Andy Ling
On 6 Oct 2017, at 9:12am, Rowan Worth wrote: > On 6 October 2017 at 15:42, wrote: > >> On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: >>> >>> For boolean values, "a XOR b" = "a <> b". >> >> Is the <> operator documented somewhere? I can't find it

Re: [sqlite] XOR operator

2017-10-06 Thread Simon Slavin
On 6 Oct 2017, at 9:12am, Rowan Worth wrote: > On 6 October 2017 at 15:42, wrote: > >> On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: >>> >>> For boolean values, "a XOR b" = "a <> b". >> >> Is the <> operator documented somewhere? I can't

Re: [sqlite] XOR operator

2017-10-06 Thread Rowan Worth
On 6 October 2017 at 15:42, wrote: > On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: > > > > For boolean values, "a XOR b" = "a <> b". > > Is the <> operator documented somewhere? I can't find it in either of > these places: > <> is SQL for "not equal to" (shout

Re: [sqlite] XOR operator

2017-10-06 Thread nomad
On Fri Oct 06, 2017 at 09:28:08AM +0200, Clemens Ladisch wrote: > > For boolean values, "a XOR b" = "a <> b". Is the <> operator documented somewhere? I can't find it in either of these places: https://sqlite.org/search?s=d=%3C%3E https://sqlite.org/datatype3.html#comparison_expressions

Re: [sqlite] XOR operator

2017-10-06 Thread Clemens Ladisch
Alex Henrie wrote: > I wanted to use the XOR operator in a query today, but then found out > that SQLite doesn't support it. For boolean values, "a XOR b" = "a <> b". For binary values, "a XOR b" = "(a | b) - (a & b)". Regards, Clemens ___