Re: [sqlite] SQL Logic error or missing database

2013-04-07 Thread Pavel Ivanov
Do you know that VS2012 has known optimizer bugs? Pavel On Apr 6, 2013 5:01 AM, "ibrahim" wrote: > On 05.04.2013 17:01, Dan Kennedy wrote: > >> On 04/05/2013 09:08 PM, Rob Collie wrote: >> >>> Yeap, I'm on Visual Studio 2012. I've created a console app: >>> >>> >>>

Re: [sqlite] How to achieve fastest possible write performance for a strange and limited case

2013-03-29 Thread Pavel Ivanov
On Fri, Mar 29, 2013 at 12:17 PM, Jeff Archer wrote: > I have previously made an apparently bad assumption about this so now I > would like to go back to the beginning of the problem and ask the most > basic question first without any preconceived ideas. > > This

Re: [sqlite] Efficient way to store counters

2013-03-13 Thread Pavel Ivanov
On Wed, Mar 13, 2013 at 11:48 AM, David King wrote: >> BTW, in case you don't do that yet your best performance will be if >> you prepare your UPDATE and INSERT statements only once and then do >> bind + step + reset in that 100k times loop. > > > In principle I agree, but

Re: [sqlite] Efficient way to store counters

2013-03-13 Thread Pavel Ivanov
On Tue, Mar 12, 2013 at 11:03 PM, David King wrote: >> > At first I was just doing something like this pseducode: >> > update_counter(k1, k2, count=count+1, expires=now+count*1day) >> > if rows_updated != 1: insert_counter(k1, k2, count=1, expires=now+1day) >> >> Assuming

Re: [sqlite] Efficient way to store counters

2013-03-13 Thread Pavel Ivanov
>> First of all in the statement above you don't gain benefit from >> uniqueness and replace about 10k rows twice. > > Are you sure? The SELECT in the INSERT OR UPDATE selects "FROM > trans_counters_v AS c", the grouped temporary view. So it should only see any > given key pair once before it

Re: [sqlite] Efficient way to store counters

2013-03-12 Thread Pavel Ivanov
On Tue, Mar 12, 2013 at 8:29 PM, David King wrote: > I'm trying to find an efficient way to store simple incrementing integers but > I'm having trouble finding an efficient way to do it > > My database looks like: > > CREATE TABLE counters > k1, k2, > count, -- how many

Re: [sqlite] inner vs. outer join inconsistency

2013-03-04 Thread Pavel Ivanov
On Sun, Mar 3, 2013 at 11:48 AM, Tom Matrix wrote: > Hello, > > I’ve encountered a problem, which is hardly reproducable on arbitrary > databases, therefore I attached one. > The problem is that inner join omits the result on large datasets. But > again, ’large’ does not

Re: [sqlite] update the same record in multiple segments at once

2013-02-28 Thread Pavel Ivanov
On Thu, Feb 28, 2013 at 10:50 PM, Gert Van Assche wrote: > All, I don't know if this is possible. > > A segment in table "Files" contains a record "Content" with a fields like > this "XXX " > Needs to become "XXX 123 456 78 90" > > Based

Re: [sqlite] SQLite equivalent to Oracle's MERGE INTO

2013-02-26 Thread Pavel Ivanov
On Tue, Feb 26, 2013 at 2:29 PM, Igor Tandetnik wrote: > On 2/26/2013 5:13 PM, anydacdev anydacdev wrote: >> >> I am struggling with SQLite's support for Oracle's DUAL table. >> >> The updated statement, now including Oracle's DUAL looks like. >> >> MERGE INTO x TGT >> USING

Re: [sqlite] Memory DB - Query does not return all records after Update

2013-02-26 Thread Pavel Ivanov
> Example, If I insert 10 records and loop a query I receive > 10, 10, 10, 10, results > But, if I change one of the records during the loop I get > 10, 10, update record, 9, 10, This sounds gibberish. Could you please post your database schema and exact queries you issue in the exact

Re: [sqlite] Question about aggregate returning empty row

2013-02-22 Thread Pavel Ivanov
That's SQL standard -- query with aggregate functions always return at least one row. Pavel On Fri, Feb 22, 2013 at 12:06 PM, Pierre Chatelier wrote: > Hello, > > [tested under 3.6.12 and 3.7.15.2] > > I have a question regarding the use of aggregate functions. > > Let's

Re: [sqlite] SQLite error near "16": syntax error

2013-02-19 Thread Pavel Ivanov
On Tue, Feb 19, 2013 at 1:39 AM, mikkelzuuu wrote: > Hey guys, I'm getting this error (see title) > I'm using C# by the way. > > string StrQuery = @"INSERT INTO Test VALUES (" + > dataGridView1.Rows[i].Cells["Column1"].Value + ", " + >

Re: [sqlite] Strange eviction or bypass of Linux page cache

2013-02-07 Thread Pavel Ivanov
> Anyone out there know how to correct this undesirable behaviour? > > PS. This only happens over NFS - local DB files behave as expected and fill > the OS page cache. Don't write your database to NFS. I'd guess that your problem is that NFS driver for some reason thinks that the file was

Re: [sqlite] Deletion slow?

2013-02-07 Thread Pavel Ivanov
> Don't know if the index is updated after each row delete or after the whole > delete transaction is commited. For the first you can try: > > time sqlite3 trip.db "PRAGMA automatic_index= FALSE; delete from trip where > key<=1400;PRAGMA automatic_index= TRUE; reindex trip" PRAGMA

Re: [sqlite] I suspect not - but is the database separator configurable?

2013-02-01 Thread Pavel Ivanov
On Fri, Feb 1, 2013 at 6:42 AM, message adams wrote: > Greetings; > > I've recently started using sqlite within Python, to help unit-test my > applications. > > My applications actually run against sybase, but I'd love to use a > connection to an in-memory sqlite to carry

Re: [sqlite] [sqlite-dev] Can I safely use the pragma synchronization = OFF?

2013-01-27 Thread Pavel Ivanov
PM, Shuki Sasson <gur.mons...@gmail.com> wrote: > Pick up any book about UFS and read about the journal... > > Shuki > > On Sun, Jan 27, 2013 at 7:56 PM, Pavel Ivanov <paiva...@gmail.com> wrote: > >> > So in any file system that supports journaling fwri

Re: [sqlite] [sqlite-dev] Can I safely use the pragma synchronization = OFF?

2013-01-27 Thread Pavel Ivanov
> makes a lot of sense as data blocks are not protected by the journal, > however with more robust File System that have full journal for metadata as > well as data it makes all the sense in the world to run with > synchronization = OFF and gain the additional performance benefits. > >

Re: [sqlite] Can I safely use the pragma synchronization = OFF?

2013-01-26 Thread Pavel Ivanov
On Sat, Jan 26, 2013 at 6:50 PM, Shuki Sasson wrote: > > Hi all, I read the documentation about the synchronization pragma. > It got to do with how often xSync method is called. > With synchronization = FULL xSync is called after each and every change to > the DataBase file

Re: [sqlite] Problem whit sqlite_prepare_v2() in 3.7.5 version and later

2013-01-09 Thread Pavel Ivanov
On Wed, Jan 9, 2013 at 6:06 AM, wrote: > > > > > Mensaje original > > De: Clemens Ladisch > > Para: sqlite-users@sqlite.org > > Fecha: Wed, 09 Jan 2013 14:25:31 +0100 > > Asunto: Re: [sqlite] Problem whit sqlite_prepare_v2() in 3.7.5 version >

Re: [sqlite] SQLite - Dropping TEMP table doesn't free allocated memory

2012-12-28 Thread Pavel Ivanov
You may be hitting the memory fragmentation issue. Try to run your application with different memory managers (Hoard is my favorite - http://www.hoard.org/) and see if the memory consumption is the same. Also if you close all connections to your database (and other SQLite databases too) does

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-26 Thread Pavel Ivanov
On Wed, Dec 26, 2012 at 9:55 PM, Daniel Colascione <dan...@dancol.org> wrote: > On 12/26/12 9:54 PM, Pavel Ivanov wrote: >> I believe you can get this functionality now by compiling SQLite code >> using cygwin compiler, not a Win32 one (and not downloading dll >> libr

Re: [sqlite] Bug in Cygwin SQLite: temporary table creation fails

2012-12-26 Thread Pavel Ivanov
I believe you can get this functionality now by compiling SQLite code using cygwin compiler, not a Win32 one (and not downloading dll library from sqlite.org website). Pavel On Wed, Dec 26, 2012 at 9:19 PM, Daniel Colascione wrote: > Creating temporary tables fails in Cygwin

Re: [sqlite] Trigger blocks a single transaction?

2012-12-23 Thread Pavel Ivanov
hat view > doesn't return any row affected value. Well it makes sense somehow.. It > cannot know how many view's visible rows were affected. It lowers the > coolnes of views and instead of trigs. > > Thanx > > On Mon, Dec 24, 2012 at 12:15 AM, Pavel Ivanov <paiva...@gmail.c

Re: [sqlite] Trigger blocks a single transaction?

2012-12-23 Thread Pavel Ivanov
Do you execute all updates as one call to sqlite_exec? Or as separate calls to sqlite_exec or sqlite_prepare/sqlite_step? If separate then do you check return value from the calls? And do you execute BEGIN/COMMIT somewhere? Pavel On Sun, Dec 23, 2012 at 2:37 PM, Alem Biscan

Re: [sqlite] Database locked after read

2012-12-01 Thread Pavel Ivanov
> I have found that when using SQLite under Windows if you execute an update > statement and then a select statement, the database is locked until the > select statement is finished. How can I stop this from happening? Note that you don't have to execute UPDATE before the SELECT to reproduce

Re: [sqlite] Confusion on 'foreign key mismatch' errors

2012-11-11 Thread Pavel Ivanov
> # http://answers.oreilly.com/topic/1955-how-to-use-full-text-search-in-sqlite/ > Unlike traditional tables, the ROWID of an FTS table is stable through > a vacuum (VACUUM in Appendix C), so it can be reliably referenced > through a foreign key. I'm not sure who wrote that but this page

Re: [sqlite] Performance of sparse sqlite tables

2012-11-04 Thread Pavel Ivanov
I'd say generally speaking your way of storing data has no significant downsides. There's just one "but": if each row in your table stores pretty significant amount of data (blobs, long text fields or just lots of different fields) you'd better not make your ItemID INTEGER PRIMARY KEY. Because

Re: [sqlite] sqlite3_column_name() contains quotes for views

2012-10-29 Thread Pavel Ivanov
This problem was fixed here http://www.sqlite.org/src/info/5526e0aa3c. It will appear in the next version of SQLite. Pavel On Mon, Oct 29, 2012 at 5:41 AM, NSRT Mail account. wrote: > In the example, I just realized something that makes matters worse. > > sqlite> SELECT

Re: [sqlite] sqlite versus MySQL automatic defragmentation on SSDs?

2012-10-28 Thread Pavel Ivanov
nd by extension would give > us better performance on the same hardware. I'd like to know more about > it, which is why I've asked. Thanks! > > -david > > [1] http://permalink.gmane.org/gmane.comp.db.sqlite.general/71868 > > > On Sun, Oct 28, 2012 at 2:12 PM, Pavel Ivan

Re: [sqlite] sqlite versus MySQL automatic defragmentation on SSDs?

2012-10-28 Thread Pavel Ivanov
the wide and varied differences. I'm just *also* > interested in this very specific issue. > > -david > > On Sun, Oct 28, 2012 at 12:38 PM, Pavel Ivanov <paiva...@gmail.com> wrote: > >> > That said, I'd still welcome any quick summary of the differences b

Re: [sqlite] sqlite versus MySQL automatic defragmentation on SSDs?

2012-10-27 Thread Pavel Ivanov
> That said, I'd still welcome any quick summary of the differences between > sqlite and mysql when it comes to fragmentation. This is far from main differences between sqlite and mysql that you should consider if you want to choose between them unless of course your question is just about an

Re: [sqlite] transaction commit is successful despite I/O error

2012-10-25 Thread Pavel Ivanov
I guess this can stand as one more argument for not using SQLite over NFS. Another argument could be found here: http://www.sqlite.org/lockingv3.html#how_to_corrupt. Pavel On Wed, Oct 24, 2012 at 2:01 PM, Efim Dyadkin wrote: > I was probably not quite specific. So I

Re: [sqlite] SQLite could not open db in WinRT issue

2012-10-24 Thread Pavel Ivanov
SQLite expects all paths to be in UTF-8 (non-standard for Win but the same for all platforms). Is your path in UTF-8 or in some other system encoding? Pavel On Tue, Oct 23, 2012 at 6:28 AM, Václav Jirovský wrote: > Hello, > > I tried to use SQLite 3.7.14.1 with

Re: [sqlite] Question about foreign key

2012-10-21 Thread Pavel Ivanov
On Sat, Oct 20, 2012 at 10:41 PM, Igor Korot wrote: > Hi, ALL, > According to http://www.sqlite.org/foreignkeys.html the FOREIGN KEY > support is disabled by default. > In order to enable it I need to compile SQLITE with 2 defines undefined. Which also undefined by default.

Re: [sqlite] A question about prepared statements

2012-10-19 Thread Pavel Ivanov
>> Var Alice := Db.SelectRecord('SELECT * FROM client WHERE client_name = ?', [ >> 'alice' ]); >> >> 1. If I drop record for "alice" from db and then access column data in >> prepared stmt will it work OK? > > If the select statement wasn't reset or finalized, you won't be able to > delete a

Re: [sqlite] Begin immediate transaction -> SQLITE_BUSY (database is locked)

2012-10-18 Thread Pavel Ivanov
On Thu, Oct 18, 2012 at 6:32 AM, Daniel Polski wrote: >> The SELECT statement, including the _prepare() stage and all the _step()s >> until you've reached the last row, and then the _finalize(), is all one >> process. They're all part of the statement and you can assume

Re: [sqlite] Begin immediate transaction -> SQLITE_BUSY (database is locked)

2012-10-17 Thread Pavel Ivanov
The problem is you are starting read-only transaction by executing SELECT and then try to convert this transaction into writing one by executing BEGIN IMMEDIATE. If in such situation SQLITE_BUSY is returned you have to finish the transaction and start it again. In your code solution is easy:

Re: [sqlite] SQLite VM questions

2012-10-14 Thread Pavel Ivanov
On Sun, Oct 14, 2012 at 12:07 PM, Ryan Johnson <ryan.john...@cs.utoronto.ca> wrote: > On 14/10/2012 2:26 PM, Pavel Ivanov wrote: >>> >>> What kind of interpreter does the query executor uses? How important is >>> the >>> interpreter's speed,

Re: [sqlite] SQLite VM questions

2012-10-14 Thread Pavel Ivanov
> What kind of interpreter does the query executor uses? How important is the > interpreter's speed, to SQLite's speed ? SQLite doesn't have interpreter, it has parser. I guess this makes the rest of your email inapplicable. Pavel On Sun, Oct 14, 2012 at 4:38 AM, Elefterios Stamatogiannakis

Re: [sqlite] light weight write barriers

2012-10-12 Thread Pavel Ivanov
Well, an article on write barriers published in May 2007 can't contradict the statement that barriers don't exist these days. :) Pavel On Fri, Oct 12, 2012 at 5:38 AM, Black, Michael (IS) wrote: > There isn't Somebody sure wasted their time on this article then... >

Re: [sqlite] Ordering of fields in a join

2012-10-11 Thread Pavel Ivanov
On Thu, Oct 11, 2012 at 7:09 AM, Hamish Symington wrote: >> Note that I was mistaken earlier when I said that "X=Y" and "Y=X" should >> result in the same answer. If X and Y have different default collating >> sequences, then X=Y does not mean the same thing as Y=X

Re: [sqlite] how to open a tickect with an issue?

2012-10-01 Thread Pavel Ivanov
See http://www.sqlite.org/src/wiki?name=Bug+Reports . Pavel On Mon, Oct 1, 2012 at 3:10 AM, Álvaro García wrote: > I Have a problem with Entity framework and SQLite and I would like to open a > ticket to expose my problem, but I don't see the way to open the ticket. > >

Re: [sqlite] How much disk space is required to checkpoint?

2012-09-26 Thread Pavel Ivanov
On Wed, Sep 26, 2012 at 5:55 AM, Simon Slavin wrote: > > On 26 Sep 2012, at 5:42am, Dan Kennedy wrote: > >> So when SQLite requires a temporary >> file, it normally creates and opens a file with a randomized name >> in /tmp then calls unlink() on it

Re: [sqlite] SQL:2003 -- Window Functions

2012-09-19 Thread Pavel Ivanov
On Wed, Sep 19, 2012 at 7:10 PM, Mohd Radzi Ibrahim wrote: > On Thu, Sep 20, 2012 at 12:58 AM, Igor Tandetnik wrote: > >> On 9/19/2012 12:51 PM, joe.fis...@tanguaylab.com wrote: >> >>> Too bad SQLite doesn't yet support SQL Window Functions. >>> >>> Are

Re: [sqlite] Getting query results as new records are added

2012-09-14 Thread Pavel Ivanov
On Fri, Sep 14, 2012 at 8:57 AM, Igor Tandetnik <itandet...@mvps.org> wrote: > On 9/14/2012 10:36 AM, Pavel Ivanov wrote: >> >> On Fri, Sep 14, 2012 at 5:58 AM, Igor Tandetnik <itandet...@mvps.org> >> wrote: >>> >>> Wait a minute. If &qu

Re: [sqlite] Getting query results as new records are added

2012-09-14 Thread Pavel Ivanov
On Fri, Sep 14, 2012 at 5:58 AM, Igor Tandetnik <itandet...@mvps.org> wrote: > Pavel Ivanov <paiva...@gmail.com> wrote: >> There's another way how it could make sense - if you read that excerpt >> in context. ;-) The "statement-level read consistenc

Re: [sqlite] Getting query results as new records are added

2012-09-14 Thread Pavel Ivanov
On Thu, Sep 13, 2012 at 9:29 PM, Igor Tandetnik <itandet...@mvps.org> wrote: > Pavel Ivanov <paiva...@gmail.com> wrote: >> On Thu, Sep 13, 2012 at 3:36 PM, Igor Tandetnik <itandet...@mvps.org> wrote: >>> On 9/13/2012 4:39 PM, Petite Abeille wrote: >>>&

Re: [sqlite] Getting query results as new records are added

2012-09-13 Thread Pavel Ivanov
On Thu, Sep 13, 2012 at 3:36 PM, Igor Tandetnik wrote: > On 9/13/2012 4:39 PM, Petite Abeille wrote: >> >> >> On Sep 13, 2012, at 10:24 PM, Igor Tandetnik wrote: >> In other words, a select should only ever see what existed at the beginning of

Re: [sqlite] Possible bug - journal_mode DELETE/TRUNCATE

2012-09-09 Thread Pavel Ivanov
Note: attachments are stripped out of this list. So if you want for anybody else to see your zip file you need to put it on some website and post link here. About the problem you have: I wonder how are you sure that there should be 50 rows in the database and not 49? If you are resetting the OS

Re: [sqlite] sqlite3DbMallocRaw problem

2012-09-09 Thread Pavel Ivanov
If pBuf points to an invalid memory it's possible that you use already closed connection or already finalized statement. Or maybe your application corrupts SQLite's memory. Try to run your program under a memory debugger. Pavel On Sat, Sep 8, 2012 at 10:11 AM, David Levinson

Re: [sqlite] bus error on sparc machines

2012-09-09 Thread Pavel Ivanov
> However, bus errors are often the result of something in your own code, or of > not checking the result codes returned by all your previous SQLite3 calls. Simon, You are confusing bus errors with segmentation faults. They are different things and bus errors inside SQLite can never be caused

Re: [sqlite] [64bits server] The underlying provider failed on Open

2012-09-04 Thread Pavel Ivanov
Maybe you have 32-bit SQLite.Interop.dll and don't have 64-bit SQLite.Interop.dll? Pavel On Tue, Sep 4, 2012 at 2:49 PM, Joe Mistachkin wrote: > >> >> After few tries, I've finally downloaded the 64 bits zip ( >> sqlite-netFx40-static-binary-bundle-x64-2010-1.0.81.0.zip)

Re: [sqlite] [sqlite-announce] SQLite Version 3.7.14

2012-09-04 Thread Pavel Ivanov
There's a documentation bug on the Release Notes page: "Enhancements to PRAGMA integrity_check and PRAGMA quick_check so that they can optionally check just a single attached database >install< of all attached databases." Should be "instead" instead of "install". Pavel On Tue, Sep 4, 2012 at

Re: [sqlite] some questions about sqlite

2012-09-01 Thread Pavel Ivanov
> thanks a lot, > but about the second question,I write java code,and find if the connection > exceeds 17990,then will throws exception This probably happened because your OS restricts number of open file descriptors or something like that. Pavel On Sat, Sep 1, 2012 at 7:52 PM,

Re: [sqlite] Pragma Synchronous=OFF is not working

2012-08-28 Thread Pavel Ivanov
If all your inserts are in one transaction then pragma synchronous = OFF won't affect your transaction speed too much. To understand whether this pragma works or not you should measure how long it takes to execute COMMIT (just this one statement). With synchronous = OFF COMMIT will be executed

Re: [sqlite] [BUG] sqlite3_exec "BEGIN; ROLLBACK" corrupts statement already running

2012-08-23 Thread Pavel Ivanov
This is a documented change. See http://www.sqlite.org/releaselog/3_7_11.html: "Pending statements no longer block ROLLBACK. Instead, the pending statement will return SQLITE_ABORT upon next access after the ROLLBACK." There was even some explanation of reasons for that somewhere on the list.

Re: [sqlite] SQLite - Database disk size difference when tables copied

2012-08-22 Thread Pavel Ivanov
> When I implement the same mechanism for saving the > memory database back to disk, the size of disk file is 4x of the original > disk file size. What is "original disk file size" here? Is it an empty database, database with some data, database with exactly the same data you are restoring? If

Re: [sqlite] How to find table names referenced in the query, not in the result set

2012-08-20 Thread Pavel Ivanov
You can try to use authorizer (http://www.sqlite.org/c3ref/set_authorizer.html) although it seems to me SQLite won't inform you about access to table2 in the first query. Pavel On Mon, Aug 20, 2012 at 2:18 AM, Bishwa Shrestha wrote: > Hi, > > I am creating an sqlite3

Re: [sqlite] Multi-Thread Reads to SQLite Database

2012-08-13 Thread Pavel Ivanov
> "There are four levels to the shared-cache locking model: transaction > level locking, table level locking, cache level locking, and schema > level locking. They are described in the following three sub-sections." This would be a bad way of documenting this because "cache level locking" works

Re: [sqlite] Multi-Thread Reads to SQLite Database

2012-08-13 Thread Pavel Ivanov
Another idea for you: > In our test, on the other hand, each thread queries its own set of > rows from the table. So, based on your explanation, here each thread > should end up with its own set of pages (more or less). However, even > in this case, I still observe a near sequential performance.

Re: [sqlite] Restore SQLite DB from WAL

2012-07-23 Thread Pavel Ivanov
> In each case the same thing happens, the messages briefly display, then > disappear I think your sms-controlling app has synced the whole sms database with some server. When you start your phone it shows you local data but then it sees that server has latest data (maybe using modification date

Re: [sqlite] C++ - Creating Table

2012-07-23 Thread Pavel Ivanov
As you don't have stmt defined anywhere this is apparently not the actual program you run. Seeing the full source code would be more helpful. If the whole source is too big try to reduce it to small program reproducing the problem. It's possible that while attempting to reduce program source

Re: [sqlite] Current Time in WHEN clause.

2012-07-22 Thread Pavel Ivanov
Keith, No SQL format can guarantee anything. And changing SQL format won't change its execution plan - SQL optimizer will decide that for you. And I don't know where did you take your information from but I can guarantee you that with your query SQLite will execute strftime many times and OP's

Re: [sqlite] Current Time in WHEN clause.

2012-07-22 Thread Pavel Ivanov
> I'm trying to convince myself that the subquery in latest_aliases only > executes once, and also that alias_info only runs latest_aliases once. > However, I'm not doing very well at convincing myself. Can someone confirm > this is true, or suggest a nice solution to get the current time

Re: [sqlite] matchinfo example does not work as documented

2012-07-21 Thread Pavel Ivanov
On Sat, Jul 21, 2012 at 7:35 PM, AJ ONeal wrote: >> >> Read the documentation carefully: >> http://www.sqlite.org/fts3.html#matchinfo. Right the first paragraph: >> >> The matchinfo function returns a blob value. If it is used within a >> query that does not use the full-text

Re: [sqlite] matchinfo example does not work as documented

2012-07-21 Thread Pavel Ivanov
On Sat, Jul 21, 2012 at 4:06 PM, AJ ONeal wrote: >> >> > Now I see a number which matches my expectations: >> > SELECT hex(matchinfo(t1)) FROM t1 WHERE t1 MATCH 'default transaction >> > "these semantics"'; >> > >> > >>

Re: [sqlite] How to compile and load the example fts4 rank function?

2012-07-21 Thread Pavel Ivanov
On Sat, Jul 21, 2012 at 3:36 AM, AJ ONeal wrote: > I naively tried > > wget > https://raw.github.com/gist/3154964/d570955d45580c095c99de6eb0c378395d4b076d/sqlite3-fts4-rank.c > gcc -c sqlite3-fts4-rank.c -o sqlite3-fts4-rank.o > > sqlite3 > .load sqlite3-fts4-rank.o > > But

Re: [sqlite] Getting occasional crashes with sqlite3_prepare_v2 and sqlite3_step in iOS app

2012-07-19 Thread Pavel Ivanov
On Thu, Jul 19, 2012 at 2:07 PM, Rick Maddy wrote: > Didn't mean to imply that failing to check the return value resulted in > memory corruption. I was wondering if it was possible that one of the many > calls to sqlite3_bind_* in my code may actually be causing some memory >

Re: [sqlite] EXT :Re: Getting occasional crashes with sqlite3_prepare_v2 and sqlite3_step in iOS app

2012-07-19 Thread Pavel Ivanov
There's no easy method of detecting memory corruption from inside your own application, especially the memory that your application don't control. You can use memory debuggers for that purpose. If you were on Linux I would recommend to use valgrind. But I don't know if there are any similar tools

Re: [sqlite] Getting occasional crashes with sqlite3_prepare_v2 and sqlite3_step in iOS app

2012-07-19 Thread Pavel Ivanov
> For quite some time now I've been getting reports of crashes in my iOS app. > Specifically these are caused by crashes in sqlite3_prepare_v2 and > sqlite_step. The associated code works fine most of the time. So I'm looking > for thoughts on how to find and fix the problem since there seems

Re: [sqlite] Selecting NULL

2012-07-11 Thread Pavel Ivanov
On Wed, Jul 11, 2012 at 2:00 PM, deltagam...@gmx.net wrote: > If mydetails contains a value, and I delete this value with "SQLite Database > Browser" > it seems not to be a "real NULL", has someone an explanation for this > behaviour ? It depends on your meaning of word

Re: [sqlite] Selecting NULL

2012-07-11 Thread Pavel Ivanov
> // here maybe NULL is returned ? > mydetails = (char*)sqlite3_column_text(stmt, 0 ); Check sqlite3_column_type() before calling sqlite3_column_text(). If it returns SQLITE_NULL then you have NULL. Pavel On Wed, Jul 11, 2012 at 1:40 PM, deltagam...@gmx.net wrote:

Re: [sqlite] Inserting from another table...

2012-07-06 Thread Pavel Ivanov
ight it be? Should I be casting them to the correct type first? > > Sam > > On Thu, Jul 5, 2012 at 11:24 PM, Pavel Ivanov <paiva...@gmail.com> wrote: > >> The insert statement below should insert one row into table >> PP_VIEWER_SETTINGS. Does it do that? Is i

Re: [sqlite] Bug regarding HAVING aggregation and typecast comparisons

2012-07-05 Thread Pavel Ivanov
> sqlite> SELECT test_base.id, SUM(test_join.value) FROM test_base LEFT > JOIN test_join ON test_join.base_id = test_base.id GROUP BY > test_base.id HAVING SUM(test_join.value)='0'; > sqlite> > > The last statement generates no results. There is no mention of a > special case for HAVING so I

Re: [sqlite] Database sharing across processes

2012-07-05 Thread Pavel Ivanov
On Thu, Jul 5, 2012 at 10:54 AM, Jonathan Haws wrote: > I am fairly new to database development and I am working on an embedded > system where we are utilizing SQLite to manage some files and other > information that is being shared between processes. What I am doing

Re: [sqlite] Inserting from another table...

2012-07-05 Thread Pavel Ivanov
The insert statement below should insert one row into table PP_VIEWER_SETTINGS. Does it do that? Is it what you called "does not work"? To insert several rows you need to write a huge join of dblookup to itself, so your insert statement should look like this: insert into PP_VIEWER_SETTINGS (...)

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Pavel Ivanov
ocking_blue2...@yahoo.com> wrote: > It returns 3.6.23.1 > > ________ > From: Pavel Ivanov <paiva...@gmail.com> > To: T Ü <shocking_blue2...@yahoo.com> > Cc: General Discussion of SQLite Database <sqlite-users@sqlite.org> > Sent: Thursday, J

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Pavel Ivanov
On Thu, Jul 5, 2012 at 8:37 AM, T Ü wrote: > By trying I found out that SQLiteConnection("Data > Source=:memory:;cache=shared"); worked. > In a single aspx.page at cs code, first I open an in-memory database > connection > SQLiteConnection conn = new

Re: [sqlite] Multiple connections to in-memory database

2012-07-05 Thread Pavel Ivanov
On Thu, Jul 5, 2012 at 7:46 AM, T Ü wrote: > I have an asp.net application. > I open a sqlite in-memory connection with SQLiteConnection conn = new > SQLiteConnection ( "Data Source=:memory:" ); command. > I read that by using cache=shared parameter, I can make that

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Pavel Ivanov
On Tue, Jul 3, 2012 at 10:55 AM, Jay A. Kreibich wrote: > On Tue, Jul 03, 2012 at 02:43:29PM +0200, Paul van Helden scratched on the > wall: > >> > The statement "UPDATE table SET column=NULL" updates every row in the >> > table. The fact that some rows may already have a

Re: [sqlite] Update trigger fires for all rows even if sqlite3_changes returns 0

2012-07-03 Thread Pavel Ivanov
On Tue, Jul 3, 2012 at 9:21 AM, Paul van Helden wrote: >> So rather than holding your breath for Oracle to change I'd recommend you >> do it the portable way. >> > I'm not waiting for anything. My last question was simple: which is > better? Since MySQL does it the "correct

Re: [sqlite] max size of a TEXT field

2012-07-02 Thread Pavel Ivanov
On Mon, Jul 2, 2012 at 4:02 PM, deltagam...@gmx.net wrote: > Hello, > > I couldnt find in the documentation what the max size of TEXT field/column > is. http://www.sqlite.org/limits.html#max_length By default it's 10^9 bytes and cannot be more than 2^31 - 1. Pavel

Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Pavel Ivanov
On Fri, Jun 29, 2012 at 4:55 PM, Jeff Archer wrote: >>Kevin Benson kevin.m.benson at gmail.com Fri Jun 29 16:32:55 EDT 2012 >> >>The mention of SQLITE_SCHEMA error and sqlite3VdbeExec() sounds like maybe >>you're fighting an expired statement??? > > Not likely.  I do Prepare,

Re: [sqlite] Not sure how to interrupt this

2012-06-28 Thread Pavel Ivanov
I think SQLITE_SCHEMA can happen even if you run things like CREATE TABLE or ALTER TABLE on the same connection. Also ATTACH DATABASE and DETACH DATABASE should invalidate all statements prepared before that. Pavel On Thu, Jun 28, 2012 at 9:58 AM, Marc L. Allen

Re: [sqlite] Load SQLite from InputStream in Java as ReadOnly

2012-06-28 Thread Pavel Ivanov
On Thu, Jun 28, 2012 at 9:54 AM, Hector Guilarte wrote: > I don't think it would. > > Connection conn = DriverManager.getConnection("jdbc:sqlite:sample.db", > config.toProperties()); > > is telling to open a connection to the file "sample.db" which is located in > the same

Re: [sqlite] I consider this a bug. Anyone else?

2012-06-26 Thread Pavel Ivanov
On Tue, Jun 26, 2012 at 8:48 PM, Stephen Chrzanowski wrote: > All; > > When you compile the amalgamation with your source code, doesn't the > compiler reject/not include/remove/doesn't consider the code that could > have been generated from the actual final build?  In other

Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Pavel Ivanov
On Tue, Jun 26, 2012 at 3:02 PM, Igor Tandetnik wrote: > On 6/26/2012 1:19 PM, Peter Haworth wrote: >> >> I still have the issue that, in order to be selected,  the rows in the >> groups containing two entries must have a different value in a specific >> column. > > > I'm not

Re: [sqlite] Selecting from a GROUP Select

2012-06-26 Thread Pavel Ivanov
t;http://www.lcsql.com> > > > > On Sat, Jun 23, 2012 at 9:00 AM, <sqlite-users-requ...@sqlite.org> wrote: > >> Message: 5 >> Date: Fri, 22 Jun 2012 19:17:39 -0400 >> From: Pavel Ivanov <paiva...@gmail.com> >> To: General Discussion

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Pavel Ivanov
ally create it for you after sqlite3_open(). Pavel On Tue, Jun 26, 2012 at 12:27 PM, deltagam...@gmx.net <deltagam...@gmx.net> wrote: > Am 26.06.2012 18:00, schrieb Pavel Ivanov: > >> On Tue, Jun 26, 2012 at 11:50 AM, deltagam...@gmx.net >> <deltagam...@gmx.net> wrot

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Pavel Ivanov
On Tue, Jun 26, 2012 at 11:50 AM, deltagam...@gmx.net <deltagam...@gmx.net> wrote: > Am 26.06.2012 17:08, schrieb Pavel Ivanov: > >> You are leaking stmt statement (re-preparing without finaliznig) and >> your call to sqlite3_close returns SQLITE_ERROR because of that, but

Re: [sqlite] access from 2 different programms to same sqlite3-db

2012-06-26 Thread Pavel Ivanov
You are leaking stmt statement (re-preparing without finaliznig) and your call to sqlite3_close returns SQLITE_ERROR because of that, but you don't even check that so you are leaking database connections as well. Pavel On Tue, Jun 26, 2012 at 11:01 AM, deltagam...@gmx.net

Re: [sqlite] How to know the memory usage of an in-memory database.

2012-06-25 Thread Pavel Ivanov
On Mon, Jun 25, 2012 at 10:05 PM, Bo Peng wrote: >> Are these multiple tables in a single database (file), or multiple databases >> (files)?  Multiple connections or a single connection? > > Right now there are multiple read-only processes to read the same > file. If I go with

Re: [sqlite] Problem with including sqlite3.c into c++ project

2012-06-25 Thread Pavel Ivanov
On Mon, Jun 25, 2012 at 4:15 PM, deltagam...@gmx.net wrote: > Hello, > > Im using MSVS 2010 for an c++ GUI project. > After including sqlite3.h and sqlite3.c from the amalgamation-3071200 > and with the Project Properties--> C/C++  --> Precompiled Headers --> > Precompiled

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 10:36 PM, Dennis Volodomanov <i...@psunrise.com> wrote: > On 24/06/2012 12:29 PM, Pavel Ivanov wrote: >> >> AFAIK, checkpoints are application-specific, but SQLite prohibits >> second writer until first one committed its transaction and re

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 10:18 PM, Dennis Volodomanov wrote: > It does raise an interesting question though - how is this handled in SQLite > internally? When there are two writers, both writing to the same DB (WAL > mode) and one of them crashes before reaching a checkpoint,

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 9:21 PM, Dennis Volodomanov wrote: > On 22/06/2012 9:48 AM, Dennis Volodomanov wrote: >> >> I'll see if the new compilation options still make this happen, but it >> takes a couple of hours for each test due to data volume and I'd need to run >> a few

Re: [sqlite] fetching rows

2012-06-23 Thread Pavel Ivanov
com> wrote: > Thank you(Pavel) for the prompt response. > > Sqlite does auto commit for every 25k insertions. Do I need to change the > number from 25k to x ( for ex: 100)? > > On Thu, Jun 21, 2012 at 7:54 AM, Pavel Ivanov <paiva...@gmail.com> wrote: > >> On Wed, Jun

Re: [sqlite] Different backend possible?

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 2:28 PM, Simon Slavin wrote: > On 23 Jun 2012, at 7:14pm, "Peter M. Friedrich" > wrote: > >> do you think it's possible to create a different backend? I want to >> develop a relational database system

Re: [sqlite] Selecting from a GROUP Select

2012-06-22 Thread Pavel Ivanov
I guess you need something like SELECT * from TableA WHERE z in ( SELECT z FROM TableA GROUP BY z HAVING count(*)=2 ); Pavel On Fri, Jun 22, 2012 at 6:43 PM, Peter Haworth wrote: > I have a situation where I need to select entries based on the count of the > number of entries

Re: [sqlite] SQLite database on the android phone

2012-06-22 Thread Pavel Ivanov
Ask this on Android-related mailing list. And if you include your populated database into application package before installation and don't see any data after installation check that you open your database with an absolute path otherwise you could be opening some other database file, not the one

  1   2   3   4   5   6   7   8   9   10   >