Re: [sqlite] Weird out of memory problem a prepare

2014-03-05 Thread RSmith
On 2014/03/04 22:05, Eduardo Morras wrote: The tables have 4 rows each one, that's why I got suprised with the Out of Memory error. The biggest row has 12KB and with the join I do, shouldn't use more than 200KB. Changing the ',' with the join you propose, gives Out of Memory too. It happens

Re: [sqlite] Weird out of memory problem a prepare

2014-03-05 Thread Dan Kennedy
On 03/05/2014 03:05 AM, Eduardo Morras wrote: On Tue, 4 Mar 2014 15:19:24 + Simon Slavin wrote: On 4 Mar 2014, at 3:15pm, Simon Slavin wrote: On 4 Mar 2014, at 3:09pm, Eduardo Morras wrote: zSql= "SELECT r.name,

Re: [sqlite] Weird out of memory problem a prepare

2014-03-04 Thread Simon Slavin
On 4 Mar 2014, at 8:05pm, Eduardo Morras wrote: > The tables have 4 rows each one, Hahahaha. Hah. That changes things. You have something wrong. Either the database is corrupt (check it with a PRAGMA or make another one) or your code is messed up somehow. As a test,

Re: [sqlite] Weird out of memory problem a prepare

2014-03-04 Thread mm.w
Hello, what's your SharedSection value? [heap limitation] Best Regards. On Tue, Mar 4, 2014 at 12:16 PM, Clemens Ladisch wrote: > Eduardo Morras wrote: > > Trying simple "SELECT r.name FROM resource AS r WHERE r.name = ?" gets > "Out of memory" too calling preparev2. > >

Re: [sqlite] Weird out of memory problem a prepare

2014-03-04 Thread Clemens Ladisch
Eduardo Morras wrote: > Trying simple "SELECT r.name FROM resource AS r WHERE r.name = ?" gets "Out > of memory" too calling preparev2. This has nothing to do with the query itself. If you aren't doing something funny with the memory allocator, it's likely that SQLite's database object got

Re: [sqlite] Weird out of memory problem a prepare

2014-03-04 Thread Eduardo Morras
On Tue, 4 Mar 2014 15:19:24 + Simon Slavin wrote: > > On 4 Mar 2014, at 3:15pm, Simon Slavin wrote: > > > On 4 Mar 2014, at 3:09pm, Eduardo Morras wrote: > > > >> zSql= "SELECT r.name, s.content FROM resource AS r, static AS

Re: [sqlite] Weird out of memory problem a prepare

2014-03-04 Thread Simon Slavin
On 4 Mar 2014, at 3:15pm, Simon Slavin wrote: > On 4 Mar 2014, at 3:09pm, Eduardo Morras wrote: > >> zSql= "SELECT r.name, s.content FROM resource AS r, static AS s WHERE (r.ids >> = s.ids AND r.name = ?);"; >> >> [snip] >> >> Error on query: out of

Re: [sqlite] Weird out of memory problem a prepare

2014-03-04 Thread Simon Slavin
On 4 Mar 2014, at 3:09pm, Eduardo Morras wrote: > zSql= "SELECT r.name, s.content FROM resource AS r, static AS s WHERE (r.ids > = s.ids AND r.name = ?);"; > > [snip] > > Error on query: out of memory I think this might require comparing every row in resource with every

[sqlite] Weird out of memory problem a prepare

2014-03-04 Thread Eduardo Morras
Hi, I have this code that fails always with the error output next: = zSql= "SELECT r.name, s.content FROM resource AS r, static AS s WHERE (r.ids = s.ids AND r.name = ?);"; stmt = NULL; rc = sqlite3_prepare_v2(db, zSql, strlen(zSql), , NULL); if ( rc != SQLITE_OK ){ dprintf(