Re: [sqlite] sqlite3_close == library routine called out of sequence

2010-02-24 Thread Simon Davies
On 23 February 2010 17:44, newlog newlog2...@yahoo.fr wrote: OK, With the following code : - sqlite3        *db = NULL;  if( sqlite3_open( D:\Test3.db, db) != SQLITE_OK )       {        // Exit if error while opening.        wxMessageBox(

Re: [sqlite] sqlite3_close == library routine called out of sequence

2010-02-24 Thread Jean-Denis Muys
On 2/24/10 9:36 , Simon Davies simon.james.dav...@googlemail.com wrote: On 23 February 2010 17:44, newlog newlog2...@yahoo.fr wrote: OK, I really don't understand Rogue semicolon on line  if( sqlite3_close( db ) != SQLITE_OK ); Regards, Simon I have been bitten by such

[sqlite] Question about protected/unprotected 'value' objects

2010-02-24 Thread WClark
Hi, I understand from reading http://www.sqlite.org/c3ref/value.html that there is a distinction between protected and unprotected value objects, and that some api interfaces, notably sqlite3_value*, require the former and others, notably sqlite3_column*, provide the latter. What I would

[sqlite] [VB.Net] Working with SQLite?

2010-02-24 Thread Gilles Ganault
Hello I'm only getting started with VB.Net, and I need a way to work with an SQLite 3 database. According to the wiki, the following solutions seem to be currently supported: = System.Data.SQLite http://sqlite.phxsoftware.com/ Devart dotConnect for SQLite

Re: [sqlite] Question about protected/unprotected 'value' objects

2010-02-24 Thread Igor Tandetnik
wcl...@gfs-hofheim.de wrote: What I would really like to be able to do would be to cache objects returned by sqlite3_column_value(...) and process them later, even after the statement that generated them is finalised You can't. The only thing you can reliably do with the result of

Re: [sqlite] sqlite3_close == library routine called out of sequence

2010-02-24 Thread newlog
I CAN'T BELIEVE I'VE DONE THIS !!! I must be so stupid that I've spent days wondering why. Thank you so much Simon for your very advised look on my code. I deeply apologize for polluting that forum with such a silly mistake. Regards Very well done Simon !! On Feb 24, 9:54 am, Jean-Denis

[sqlite] SQLite 3.6.22 assert (p-selFlags SF_HasTypeInfo)==0 fails with virtual tables

2010-02-24 Thread Hick Gunter
Consider a query of the form UPDATE table1 SET field1 = (SELECT field2 FROM table2 WHERE field3 != 0) WHERE field4 = value; If both tables are native tables, the function selectAddSubqueryTypeInfo() gets called exactly once for the subquery. However, if both tables are virtual tables, the

[sqlite] Fwd: Sqlite files in temp folder

2010-02-24 Thread D. Richard Hipp
Begin forwarded message: From: Anita Asken markani...@yahoo.co.uk Date: February 24, 2010 6:04:35 AM EST To: d...@hwaci.com Subject: Sqlite files in temp folder Dear Sir, I have been contacted by a friend who has the above files appearing in her Temp folder on a daily

Re: [sqlite] [VB.Net] Working with SQLite?

2010-02-24 Thread Nick Shaw
You could just import the required DLL functions from sqlite3.dll? Not very object-oriented, I admit - you'd need to write your own class wrapper around the functions if you wanted that - but I'd think that importing the functions was the quickest method, and then you're not reliant on 3rd party

Re: [sqlite] Fwd: Sqlite files in temp folder

2010-02-24 Thread Nick Shaw
I'd suggest Anita uses a file monitoring app (like SysInternals' DiskMon, if she's using Windows) to see what is writing those files. Then stop the app from doing it. Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of D.

Re: [sqlite] [VB.Net] Working with SQLite?

2010-02-24 Thread Gilles Ganault
On Wed, 24 Feb 2010 13:17:23 -, Nick Shaw nick.s...@citysync.co.uk wrote: You could just import the required DLL functions from sqlite3.dll? Not very object-oriented, I admit - you'd need to write your own class wrapper around the functions if you wanted that - but I'd think that importing

Re: [sqlite] Question about protected/unprotected 'value' objects

2010-02-24 Thread WClark
Igor Tandetnik wrote on 24/02/2010: Well, too bad. Ha! Nothing's that bad!!! Protected means a mutex is held while the value is outstanding. If such a hypothetical API existed, it would mean you could instruct SQLite to hold a mutex for an indefinite period of time, thus blocking all

Re: [sqlite] [VB.Net] Working with SQLite?

2010-02-24 Thread Nick Shaw
Ah ok, in that case a 3rd party interface would probably be quickest for you. :) Good luck! Nick. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Gilles Ganault Sent: 24 February 2010 13:20 To: sqlite-users@sqlite.org

Re: [sqlite] [VB.Net] Working with SQLite?

2010-02-24 Thread Gilles Ganault
On Wed, 24 Feb 2010 13:31:52 -, Nick Shaw nick.s...@citysync.co.uk wrote: Ah ok, in that case a 3rd party interface would probably be quickest for you. :) Thanks. For those interested, using the above open-source wrapper, here's how to 1) create a new SQLite database file, 2) create a new

Re: [sqlite] Question about protected/unprotected 'value' objects

2010-02-24 Thread Igor Tandetnik
wcl...@gfs-hofheim.de wrote: Igor Tandetnik wrote on 24/02/2010: Well, too bad. Ha! Nothing's that bad!!! Protected means a mutex is held while the value is outstanding. If such a hypothetical API existed, it would mean you could instruct SQLite to hold a mutex for an indefinite period

Re: [sqlite] Question about protected/unprotected 'value' objects

2010-02-24 Thread WClark
Igor Tandetnik wrote on 24/02/2010: I must admit I have no idea what you are talking about, you lost me thoroughly. In any case, mutex or no mutex, the pointer returned by sqlite3_column_value is only valid until you step away from that row or reset the statement. You can't hold onto the

Re: [sqlite] Fwd: Sqlite files in temp folder

2010-02-24 Thread Griggs, Donald
Mark, Can you offer any advice on how to stop the files being written, and remove the programme(s) that are writing these files. Hello, I'm (simply) a member of the sqlite mailing list. As you probably know, it is not sqlite itself that is creating these files, but some program on the

Re: [sqlite] Bug in porter stemmer

2010-02-24 Thread James Berry
Can somebody please clarify the bug reporting process for sqlite? My understanding is that it's not possible to file bug reports directly, and that the advise is to write to the user list first. I've done that (below) but have no response so far and am concerned that this means the bug report

Re: [sqlite] Bug in porter stemmer

2010-02-24 Thread D. Richard Hipp
We got the Porter stemmer code directly from Martin Porter. I'm sorry it does not work like you want it to. Unfortunately, we cannot change it now without introducing a serious incompatibility with the millions and millions of applications already in the field that are using the existing

Re: [sqlite] Bug in porter stemmer

2010-02-24 Thread Shane Harrelson
Additionally, your algorithm reference for step1c is from the Snowball English (Porter2) algorithm. The implementation used in SQLite is for the original Porter algorithm discussed here: http://tartarus.org/~martin/PorterStemmer/ HTH. -SHane On Wed, Feb 24, 2010 at 10:05 AM, D. Richard Hipp

[sqlite] reset BEGIN/COMMIT as prepared statements

2010-02-24 Thread Mike Goins
I use BEGIN TRANSACTION and COMMIT as prepared statements in a C application. I originally was not resetting these types of non-binding prepared statements that only return SQLITE_DONE. http://www.sqlite.org/c3ref/step.html states: SQLITE_DONE means that the statement has finished executing

Re: [sqlite] SQLite BUSY error - single-threaded app

2010-02-24 Thread Pavel Ivanov
If you're sure that there's no other threads or processes accessing the database then I'd suggest you to look for help somewhere among Windows gurus because it sounds like an issue with file system which somehow tries to execute some tasks in background returning to the caller immediately. Maybe

Re: [sqlite] sqlite3_close == library routine called out of sequence

2010-02-24 Thread Mike Shal
On 2/24/10, Jean-Denis Muys jdm...@kleegroup.com wrote: On 2/24/10 9:36 , Simon Davies simon.james.dav...@googlemail.com wrote: Rogue semicolon on line if( sqlite3_close( db ) != SQLITE_OK ); Regards, Simon I have been bitten by such silly mistakes often enough! This

Re: [sqlite] sqlite3_close == library routine called out of sequence

2010-02-24 Thread D. Richard Hipp
On Feb 24, 2010, at 1:12 PM, Mike Shal wrote: This compiler is llvm. Check it out at http://llvm.org You can test for this mistake on the demo page at http://llvm.org/ demo FWIW, there are currently two places in SQLite where we have had to complicate the code in order to work around

Re: [sqlite] reset BEGIN/COMMIT as prepared statements

2010-02-24 Thread Igor Tandetnik
Mike Goins mike.go...@adtecservices.net wrote: I use BEGIN TRANSACTION and COMMIT as prepared statements in a C application. I originally was not resetting these types of non-binding prepared statements that only return SQLITE_DONE. http://www.sqlite.org/c3ref/step.html states:

Re: [sqlite] Bug in porter stemmer

2010-02-24 Thread James Berry
drh, Thanks for the response: it's nice to know that the report was actually seen. It would be hubris indeed to claim to fix an implementation bug in Porter's code. The code in sqlite didn't match any of Porter's code I could find, so I assumed it came from elsewhere: but maybe I missed

Re: [sqlite] Bug in porter stemmer

2010-02-24 Thread Scott Hess
Actually, I think a new version of the tokenizer would have to be a distinct tokenizer (ie, porter versus porter1 versus porter2, whatever). fts4 should not interpret the meaning of an explicit tokenizer differently from fts3, but it could use a different default tokenizer. [Don't take this as

[sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread Mark Brand
Hi, I've run into some puzzling behavior. I've tried to distill it to a minimal case. In the final SELECT query below, the last LEFT JOIN clause seems have the effect of an INNER JOIN in that its condition limits the rows returned. I can rewrite the query to get the desired result using a UNION

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread Pavel Ivanov
It's pretty strange how you try to join with some table not even mentioning any column of that table in the joining condition. I bet behavior is not defined for such cases in SQL standard and you're getting some interpretation of such query. Probably this query will return what you want: SELECT

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread Mark Brand
It's pretty strange how you try to join with some table not even mentioning any column of that table in the joining condition. I bet behavior is not defined for such cases in SQL standard and you're getting some interpretation of such query. I'm not aware of any requirement that a JOIN

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread Igor Tandetnik
Mark Brand mabr...@mabrand.nl wrote: --Gives unexpected results SELECT c1.cur cur1, c2.cur cur2, COALESCE(self.rate, x.rate) rate FROM currency c1 CROSS JOIN currency c2 LEFT JOIN exchange x ON x.cur1=c1.cur AND x.cur2=c2.cur LEFT JOIN (SELECT 1 rate) self ON c1.cur=c2.cur; /*

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread ve3meo
Igor Tandetnik itandet...@mvps.org wrote in message news:hm45gu$s5...@dough.gmane.org... Mark Brand mabr...@mabrand.nl wrote: --Gives unexpected results SELECT c1.cur cur1, c2.cur cur2, COALESCE(self.rate, x.rate) rate FROM currency c1 CROSS JOIN currency c2 LEFT JOIN exchange x ON

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread ve3meo
ve3meo holden_fam...@sympatico.ca wrote in message news:hm47t5$5l...@dough.gmane.org... Igor Tandetnik itandet...@mvps.org wrote in message news:hm45gu$s5...@dough.gmane.org... Mark Brand mabr...@mabrand.nl wrote: --Gives unexpected results SELECT c1.cur cur1, c2.cur cur2,

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread Pavel Ivanov
Does INDEX sqlite_autoindex_currency_1 contain only pointers to the identical currencies? First of all AFAIK 'PRIMARY KEY' implies uniqueness of the column. And second: I bet if you execute 'PRAGMA case_sensitive_like = true' then plans will be the same. See

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread D. Richard Hipp
On Feb 24, 2010, at 5:20 PM, Pavel Ivanov wrote: Does INDEX sqlite_autoindex_currency_1 contain only pointers to the identical currencies? First of all AFAIK 'PRIMARY KEY' implies uniqueness of the column. And second: I bet if you execute 'PRAGMA case_sensitive_like = true' then plans will

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread Igor Tandetnik
D. Richard Hipp d...@hwaci.com wrote: This problem has existed in SQLite forever and has never been seen before. So it is obscure. The simple fix is to put the ON clause on the CROSS JOIN where it belongs. Does CROSS JOIN allow an ON clause? That doesn't make much sense. I guess I'm missing

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread ve3meo
I posted the following and it didn't appear - I probably hit Reply to Sender instead of Reply Group: Does INDEX sqlite_autoindex_currency_1 contain only pointers to the identical currencies? Tom This little change also works: ON +c1.cur=c2.cur; or ON c1.cur=+c2.cur; Along with LIKE, that

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread D. Richard Hipp
On Feb 24, 2010, at 5:45 PM, Igor Tandetnik wrote: D. Richard Hipp d...@hwaci.com wrote: This problem has existed in SQLite forever and has never been seen before. So it is obscure. The simple fix is to put the ON clause on the CROSS JOIN where it belongs. Does CROSS JOIN allow an ON

Re: [sqlite] unexpected behavior with CROSS and LEFT JOIN together

2010-02-24 Thread Igor Tandetnik
D. Richard Hipp d...@hwaci.com wrote: On Feb 24, 2010, at 5:45 PM, Igor Tandetnik wrote: D. Richard Hipp d...@hwaci.com wrote: This problem has existed in SQLite forever and has never been seen before. So it is obscure. The simple fix is to put the ON clause on the CROSS JOIN where it

[sqlite] dynamic typing misunderstanding

2010-02-24 Thread eternelmangekyosharingan
Hello all, I create the following table: sqlite create table t1(a); sqlite insert into t1 values(123456789.123456789); I ran the following commands: sqlite select * from t1; 123456789.123457 sqlite select typeof(a) from t1; real What I expected to get is: sqlite select * from t1;

Re: [sqlite] dynamic typing misunderstanding

2010-02-24 Thread P Kishor
On Wed, Feb 24, 2010 at 5:22 PM, eternelmangekyosharingan eternelmangekyosharin...@gmail.com wrote: Hello all, I create the following table: sqlite create table t1(a); sqlite insert into t1 values(123456789.123456789); I ran the following commands: sqlite select * from t1;

Re: [sqlite] dynamic typing misunderstanding

2010-02-24 Thread Igor Tandetnik
eternelmangekyosharingan eternelmangekyosharin...@gmail.com wrote: I create the following table: sqlite create table t1(a); sqlite insert into t1 values(123456789.123456789); I ran the following commands: sqlite select * from t1; 123456789.123457 sqlite select typeof(a) from t1; real

Re: [sqlite] dynamic typing misunderstanding

2010-02-24 Thread eternelmangekyosharingan
I'm sorry but I don't get your answer. Can you provide further explanations, please ? On Thu, Feb 25, 2010 at 12:40 AM, P Kishor punk.k...@gmail.com wrote: On Wed, Feb 24, 2010 at 5:22 PM, eternelmangekyosharingan eternelmangekyosharin...@gmail.com wrote: Hello all, I create the

Re: [sqlite] dynamic typing misunderstanding

2010-02-24 Thread eternelmangekyosharingan
Igor, thanks for your reply. I read that too. But it does not make any sense to me as any number will be truncated according to this definition. Can you give me an example where an REAL is converted to a TEXT due to a conversion loss ? On Thu, Feb 25, 2010 at 12:54 AM,