[sqlite] Invitation to connect on LinkedIn

2009-12-16 Thread Neelamegam Appadurai
LinkedIn I'd like to add you to my professional network on LinkedIn. - Neelamegam Neelamegam Appadurai sss at Zoho Corporation India Confirm that you know Neelamegam Appadurai https://www.linkedin.com/e/isd/936554437/zokwXfFf/ -- (c) 2009, LinkedIn Corporation

Re: [sqlite] a possible bug of select min(id) from...

2009-12-16 Thread Igor Tandetnik
nick huang wrote: > Say a table named "url" is created with "id" as primary key. Then a > query like this "select min(id) from url". > > Quite unexpectedly, the result of query returns "SQLITE_ROW" and the > min(id) is 0. However, my table is still empty which confuses

Re: [sqlite] a possible bug of select min(id) from...

2009-12-16 Thread nick huang
hi, I am a sort of new to sqlite. I include sqlite in my project and then encounter such a problem. Say a table named "url" is created with "id" as primary key. Then a query like this "select min(id) from url". Quite unexpectedly, the result of query returns "SQLITE_ROW" and the

[sqlite] Bug report and simple patch to fix: crash with ICU REGEXP() function

2009-12-16 Thread Chris Evans
Hi, Here is a simple fix to prevent a crash with a function call such as REGEXP() or REGEXP('abc') when using the icu extension. In both cases, an unexpectedly short number of arguments causes a crash. We're using this patch in Chromium. It was reviewed by Scott Hess. Cheers Chris === ---

[sqlite] valgrind report (uninitialized byte) while committing large transaction

2009-12-16 Thread Vincent Cridlig
Hi, I am seeing the valgrind error below using sqlite 3.6.18. It seems to always happens while committing a transaction having 100 INSERT(s). all INSERT are done in one single table. Is this a known issue? Thanks Vincent ==15065== ==15065== Thread 71: ==15065== Syscall param

Re: [sqlite] sqlite3_complete always returning 1?

2009-12-16 Thread Jay A. Kreibich
On Wed, Dec 16, 2009 at 04:52:16PM -0500, Nicolas Rivera scratched on the wall: > Thanks for your reply Dr. Hipp. > > I just ran those, and they do return 0. > > But I am confused. The documentation says: > "These routines return 1 if the input string appears to be a complete > SQL statement.

Re: [sqlite] sqlite3_complete always returning 1?

2009-12-16 Thread Nicolas Rivera
Thanks for your reply Dr. Hipp. I just ran those, and they do return 0. But I am confused. The documentation says: "These routines return 1 if the input string appears to be a complete SQL statement. A statement is judged to be complete if it ends with a semicolon token and is not a prefix of

Re: [sqlite] sqlite3_complete always returning 1?

2009-12-16 Thread D. Richard Hipp
On Dec 16, 2009, at 4:10 PM, Nicolas Rivera wrote: > Hi, > > I think I am missing something really simple (some macro or > something), > because I cannot make sqlite3_complete() to return anything other > than 1. > > Even when I pass it "" (an empty string), it still returns 1. I even >

[sqlite] sqlite3_complete always returning 1?

2009-12-16 Thread Nicolas Rivera
Hi, I think I am missing something really simple (some macro or something), because I cannot make sqlite3_complete() to return anything other than 1. Even when I pass it "" (an empty string), it still returns 1. I even tried to call sqlite3_initialize() before (although to my knowledge this

Re: [sqlite] custom fts3 tokenizer, used in read-only?

2009-12-16 Thread Nick Hodapp
Ah, Thanks. That makes sense. My tokenizer extracts text-node values from XHTML content and delegates the tokenizing of each node value to the Porter tokenizer. Since the RHS of the MATCH operator will never be XHTML, I should be able to just defer the tokenizing of that input directly to the

Re: [sqlite] creating teams with random players

2009-12-16 Thread Simon Slavin
On 16 Dec 2009, at 5:32pm, Robert Citek wrote: > I can adjust the table to pick 6 random players by including > another column that holds a random integer: > > $ sqlite3 -init <( echo ' > alter table pool add tag INTEGER > ; > update pool set tag=random() After that UPDATE (that should be

Re: [sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Kurt D. Knudsen
Igor, Yes, I did read it and feel a little silly in retrospect. I assumed, foolishly, that he was specifically mentioning using BLOBs instead of other types. That's why I was confused. I will continue to research this to find the most future-proof, secure, and efficient method. I thank you all

Re: [sqlite] How do I handle special characters?

2009-12-16 Thread Igor Tandetnik
Joe Lanier wrote: > I am in the process of moving data from flat files to a sqlite > database. I first search through a row and replace ' with '' for > such occurrence as o'riley/joe's. My assumption was that for each > column I could bookend each column with

[sqlite] How do I handle special characters?

2009-12-16 Thread Joe Lanier
I am in the process of moving data from flat files to a sqlite database. I first search through a row and replace ' with '' for such occurrence as o'riley/joe's. My assumption was that for each column I could bookend each column with a ' like '123' and that will allow the data to pass to the

Re: [sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Igor Tandetnik
Kurt D. Knudsen wrote: > Thanks for the prompt reply. It seems sqlite3_mprintf() is exactly > what > I was looking for. I do have to ask, though, what is the benefit of > using the blob binding? I have my tables defined either using VARCHARs > or TEXTs. I've never used

Re: [sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Martin Engelschalk
Hi Kurt, The Link i copied is named .#sqlite3_bind_blob, but points at 9 different functions to bind values of diferent types, especially sqlite3_bind_text. Using Google, i found this page: http://www.adp-gmbh.ch/blog/2004/october/6.html, where the rationale behind binding is explained

Re: [sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Kurt D. Knudsen
Hi Martin, Thanks for the prompt reply. It seems sqlite3_mprintf() is exactly what I was looking for. I do have to ask, though, what is the benefit of using the blob binding? I have my tables defined either using VARCHARs or TEXTs. I've never used the BLOB type before and am unsure of the

Re: [sqlite] custom fts3 tokenizer, used in read-only?

2009-12-16 Thread D. Richard Hipp
On Dec 16, 2009, at 11:15 AM, D. Richard Hipp wrote: > > On Dec 16, 2009, at 11:12 AM, Nick Hodapp wrote: > >> I wrote a custom tokenizer for fts3, and I intend it to be used >> when I >> populate my database. >> >> I'd rather not ship the tokenizer in my embedded application which >> accesses

Re: [sqlite] custom fts3 tokenizer, used in read-only?

2009-12-16 Thread D. Richard Hipp
On Dec 16, 2009, at 11:12 AM, Nick Hodapp wrote: > I wrote a custom tokenizer for fts3, and I intend it to be used when I > populate my database. > > I'd rather not ship the tokenizer in my embedded application which > accesses > the database in read-only mode. But it seems that fts3 checks

[sqlite] custom fts3 tokenizer, used in read-only?

2009-12-16 Thread Nick Hodapp
I wrote a custom tokenizer for fts3, and I intend it to be used when I populate my database. I'd rather not ship the tokenizer in my embedded application which accesses the database in read-only mode. But it seems that fts3 checks for the existence of the tokenizer even when accessing a fts3

[sqlite] Request Feature

2009-12-16 Thread Sebastian Bermudez
I'm using Sqlite for develop...in a embebbed Web Environment ( WAPSqlite ). The production environment is LAMP... on some of my .PHP i need do SELECT * FROM TABLE FOR UPDATE in mysql to lock records but sqlite does not support "FOR UPDATE" then i need to change each

Re: [sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Simon Davies
2009/12/16 Kurt D. Knudsen : > Hi guys, > > I've been searching high and low for a solution to this, but haven't > found anything that I fully understand. Right now, I'm inserting text > into a database that contains single quotes and backslashes. Is there a > function that

Re: [sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Martin Engelschalk
Hi, The function "sqlite3_mprintf" is what you look for. see http://www.sqlite.org/capi3ref.html#sqlite3_mprintf Also, you might want to use bind variables instead of putting literals into your SQL text. see http://www.sqlite.org/capi3ref.html#sqlite3_bind_blob Martin Kurt D. Knudsen wrote: >

[sqlite] BUG: FTS3 in 3.6.21

2009-12-16 Thread Alexey Pechnikov
Hello! sqlite> select count(*) from file_text where file_text match 'content:мтс-коннект'; 162 sqlite> select count(*) from file_text where file_text match '"мтс-коннект"'; 112 sqlite> select count(*) from file_text where file_text match 'content:"мтс-коннект"'; Error: SQL logic error or

[sqlite] Escaping strings to be used in queries in C/C++

2009-12-16 Thread Kurt D. Knudsen
Hi guys, I've been searching high and low for a solution to this, but haven't found anything that I fully understand. Right now, I'm inserting text into a database that contains single quotes and backslashes. Is there a function that will properly escape these characters so they will be inserted

Re: [sqlite] BUG: the rowid column in view is autom a tically named as id

2009-12-16 Thread John Elrick
Alexey Pechnikov wrote: > Hello! > > On Monday 14 December 2009 11:33:32 Jens Miltner wrote: > >> ... >> > > You did not understand me. The manually named columns > may not be renamed automatically. But in the test the > column "id" was renamed to "id:1": > > sqlite> create table test

Re: [sqlite] BACK API Questions

2009-12-16 Thread Max Vlasov
> > For ex, If I ran for 200,000 inserts, first 20,000 inserts were done in 9 > secs, but last 20,000 inserts (from 180,000th to 200,000) took almost 110 > secs. It is more than 10 times than what it was initially. These results > were consistent across all iterations of simulation I did. > > I

Re: [sqlite] BACK API Questions

2009-12-16 Thread David Bicking
Raghu, Can you either use the backup API or a simple attach to copy the data from the memory database to a new file based db. A second process could then much more slowly poll to see if a new "temporary" file was available, and attach it, and insert its data albeit slowly in to the consolidated

Re: [sqlite] Bug in select from tables with unique constraint?

2009-12-16 Thread WClark
Hello again, I have also checked this with 3.6.17 (which works) and 3.6.18 (which doesn't), so it may be something that slipped in between these two versions. In case it is helpful, I'm running of the release checkouts from the fossil repository. The configure is called with

Re: [sqlite] Gauging interest in patches...

2009-12-16 Thread WClark
> - Message from Alexey Pechnikov on Tue, > 15 Dec 2009 22:14:07 +0300 - > > To: > > General Discussion of SQLite Database > > Subject: > > Re: [sqlite] Gauging interest in patches... > > Hello! > > On Tuesday 15 December 2009

[sqlite] Bug in select from tables with unique constraint?

2009-12-16 Thread WClark
Hi people, I think I may have found a bug in v3.6.21 of Sqlite, but would someone be able to kindly verify my findings for me. If I do the following... CREATE TABLE t1 (c1 TEXT UNIQUE); CREATE TABLE t2 (c2 TEXT UNIQUE); INSERT INTO t1(c1) SELECT "a" UNION ALL SELECT "b"; INSERT INTO t2(c2)

Re: [sqlite] BACK API Questions

2009-12-16 Thread Raghavendra Thodime
Max, I agree with what you are saying. To eliminate such stuff, this is what I have done: I created schema for multiple tables with no indexing, no joins, no foreign key constraints. Basically I wanted to keep it as simple as possible for inserts to be faster. Then I simulated the inserts

Re: [sqlite] EPC Based Search

2009-12-16 Thread Pavel Ivanov
> Is there any way out except create index on it. No. When working with databases one always has to choose: either you can insert very fast and don't have any indexes or your selects work fast and you have some indexes. But using only one index slows down inserts at so small fractions of

Re: [sqlite] EPC Based Search

2009-12-16 Thread Ram Mandavkar
readmode table gets updated on frequently basis so i can not create index on it. Is there any way out except create index on it. Pavel Ivanov-2 wrote: > >> Why not just make epc column "unique on conflict ignore"? >> i.e. >> CREATE TABLE readmode( epc text unique on conflict ignore, col2

Re: [sqlite] SQL questio

2009-12-16 Thread Michael Knigge
All, > (Disclaimer: I'm german and miss the right tone quite often.) I haven't followed this thread but just to be clear: We germans are not rude by nature :-) But we germans usualy tend to "say what we think", in exactly the words that we think (at least here in hannover, there was an

Re: [sqlite] sqlite-users Digest, Vol 24, Issue 16

2009-12-16 Thread Florian Schricker
Hello! > From: P Kishor > You did say in your original post that you are, "a starter on SQL / > SQLite and there is some problem (you would) solve in software but > (you) have the feeling this can be done using a query. If somebody can > help (you) out (you would) be glad -

Re: [sqlite] SQL questio

2009-12-16 Thread Florian Schricker
Hi list, sorry for being too blunt for this list. I would very much like to settle the "issue" people had or have with me here on sqlite-users. I am sorry if I came off rude myself. I apologize. (Disclaimer: I'm german and miss the right tone quite often.) Just one thing for Simon to think

Re: [sqlite] BACK API Questions

2009-12-16 Thread Max Vlasov
On Wed, Dec 16, 2009 at 9:30 AM, Raghavendra Thodime wrote: > I did try using batch of transactions with synchronous=OFF PRAGMA set. The > performance improved slightly. But as db file started to grow larger and > larger in size, the performance degraded considerably. Is it