Re: [sqlite] Importing date string 'YYYYMMDD'

2012-03-31 Thread Simon Slavin

On 1 Apr 2012, at 3:05am, John  wrote:

> Can the date time functions in SQLite correctly interpret a date string like 
> '20120331'? Is there a format or modifier that will help the function 
> interpret/convert that as '2012-03-31'?
> 
> I don't see anything myself at the moment but thought I should ask before 
> working out other solutions.

I assume you've found

<http://www.sqlite.org/lang_datefunc.html>

You can deal very well with the '2012-03-31' format, converting between it and 
Julian and epoch numbers.  If you have strings in the format '20120331' stored, 
you can use a combination of the concatenate operator '||' and the 
substr(X,Y,Z) function to convert that to the format with the hyphens in.  It's 
not pretty but it works.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Importing date string 'YYYYMMDD'

2012-03-31 Thread Igor Tandetnik
John  wrote:
> Can the date time functions in SQLite correctly interpret a date string
> like '20120331'?

No. Recognized formats are documented here:

http://sqlite.org/lang_datefunc.html

> Is there a format or modifier that will help the function interpret/convert 
> that as '2012-03-31'?

Well, you could write something like

select substr(d, 1, 4) || '-' || substr(d, 5, 2) || '-' || substr(d, 7)
from (select '20120331' as d);

-- 
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Importing date string 'YYYYMMDD'

2012-03-31 Thread John

Hi

Can the date time functions in SQLite correctly interpret a date string 
like '20120331'? Is there a format or modifier that will help the 
function interpret/convert that as '2012-03-31'?


I don't see anything myself at the moment but thought I should ask 
before working out other solutions.


John

--
Regards
   John McMahon
  li...@jspect.fastmail.fm


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] System.Data.SQLite version 1.0.80.0 released

2012-03-31 Thread Joe Mistachkin

System.Data.SQLite version 1.0.80.0 (with SQLite 3.7.11) is now available on
the System.Data.SQLite website:

 http://system.data.sqlite.org/

Further information about this release can be seen at

 http://system.data.sqlite.org/index.html/doc/trunk/www/news.wiki

Please post on the SQLite mailing list (sqlite-users at sqlite.org) if you
encounter any problems with this release.

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug - Aborted statement by a nested savepoint

2012-03-31 Thread Richard Hipp
On Sat, Mar 31, 2012 at 12:07 PM, Lukas Gebauer  wrote:

> Hi all!
>
> Sqlite version 3.7.11 on Windows cause error in my program. Some of my
> pending statements are aborted by a nested savepoint transaction. See:
>
> SAVEPOINT x1;
> SELECT * FROM sometable; //just open statement and left it opened!
> SAVEPOINT x2;
> RELEASE x2;
> ... call sqlite3_step on previously opened statement - I got SQLITE_ABORT
> error, even I not see any Rollback.
>
> When I omit savepoint x1, then statement working well. If I omit nested
> x2 savepoint, statement working fine too.
>
> Is it bug or I missed something?
>

It is a bug.  It has now been fixed on the
trunk
.


>
> Thank you very much!
>
>
> --
> Lukas Gebauer.
>
> http://synapse.ararat.cz/ - Synapse Delphi and Kylix TCP/IP Library
> http://geoget.ararat.cz/ - Geocaching solution
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [patch] sqlite-3.7.11: valgrind errors in testsuite

2012-03-31 Thread Yuriy Kaminskiy
Dan Kennedy wrote:
> On 03/31/2012 04:04 PM, Yuriy Kaminskiy wrote:
>> valgrind ./testfixture test/trigger7.test
>>
>> Note: line numbers below are off-by-2.
>>
>> trigger7-2.1... Ok
>> trigger7-2.2...==11533== Invalid read of size 1
>>
>> Seems always reproducible.
> 
> Thanks for reporting this.
> 
> These tests are run with valgrind as part of the release process.
> But this error only shows up when you build with SQLITE_OMIT_LOOKASIDE
> (or disable the lookaside allocator some other way). I think this is
> probably better - perhaps we should disable lookaside when running
> valgrind tests during release testing too.

Yep, I usually prefer lookaside allocator enabled, just disabled it for better
valgrind interaction.
[But there are some major SQLITE_OMIT_LOOKASIDE users in the wild - IIRC,
debian, ubuntu and firefox ships sqlite3 with SQLITE_OMIT_LOOKASIDE]

>> It seems patch below fixes it (but I'm not sure if it is
>> correct/sufficient;
>> codepath seems common, why it is only triggered by this test is not
>> clear).
> 
> The patch looks correct and safe to me. The only possible problem
> is that the modification adds (a tiny amount of) code to one of
> the most performance sensitive functions in the library.
> 
> I think the reason this hasn't shown up before is that Mem.z is
> not valid unless either the MEM_Str or MEM_Blob flag is set on
> the memory cell. So accessing it when these flags are both clear
> is a bug in sqlite3VdbeMemGrow(). The bug is only triggered when
> the 'preserve' argument to sqlite3VdbeMemGrow() is true.
> 
> And the only place where sqlite3VdbeMemGrow() is called with
> the preserve flag set to true and a memory cell that does not
> have either the MEM_Str or MEM_Blob is from the code to do
> EXPLAIN listing of trigger programs.
> 
> This fix changes the EXPLAIN listing code so that it doesn't do
> that:
> 
> http://www.sqlite.org/src/info/c9342ca581?sbs=0

Thank you! That's certainly better.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Bug - Aborted statement by a nested savepoint

2012-03-31 Thread Lukas Gebauer
Hi all!

Sqlite version 3.7.11 on Windows cause error in my program. Some of my 
pending statements are aborted by a nested savepoint transaction. See:

SAVEPOINT x1;
SELECT * FROM sometable; //just open statement and left it opened!
SAVEPOINT x2;
RELEASE x2;
... call sqlite3_step on previously opened statement - I got SQLITE_ABORT 
error, even I not see any Rollback.

When I omit savepoint x1, then statement working well. If I omit nested 
x2 savepoint, statement working fine too.

Is it bug or I missed something?

Thank you very much!


--
Lukas Gebauer.

http://synapse.ararat.cz/ - Synapse Delphi and Kylix TCP/IP Library
http://geoget.ararat.cz/ - Geocaching solution


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] about sqlite3_exec function

2012-03-31 Thread Black, Michael (IS)
Arrrgghhh...that's what I get for coding off the top of my head.



As somebody else pointed out Window escapes are different than Unix.



So these work (and have been tested now on Windows XP and Redhat).



Windows

main()
{
   system("echo ^ >mm.html");
}



Unix

system("echo \"\" > mm.html");





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Simon Slavin [slav...@bigfraud.org]
Sent: Saturday, March 31, 2012 7:50 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] about sqlite3_exec function


On 31 Mar 2012, at 12:48pm, "Black, Michael (IS)"  
wrote:

> What you want is the system() function which will execute a shell command.
>
>
>
> But you still need to add your own HTML around it to be displayed by a 
> browser as it's missing the "rest of the story".
>
>
>
> system("echo  >mm.html");  // first one creates mm.html

There's a problem with this  The normal operating system command shell 
recognises the '>' character as meaning that the output should go to a file.  
But that's okay: you can write your system() function to do the same thing.  
But if you do that, the system() function will recognise the '>' at the end of 
'' as an output directive too.

I don't know what OS or shell the OP is using.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] about sqlite3_exec function

2012-03-31 Thread Simon Slavin

On 31 Mar 2012, at 12:48pm, "Black, Michael (IS)"  
wrote:

> What you want is the system() function which will execute a shell command.
> 
> 
> 
> But you still need to add your own HTML around it to be displayed by a 
> browser as it's missing the "rest of the story".
> 
> 
> 
> system("echo  >mm.html");  // first one creates mm.html

There's a problem with this  The normal operating system command shell 
recognises the '>' character as meaning that the output should go to a file.  
But that's okay: you can write your system() function to do the same thing.  
But if you do that, the system() function will recognise the '>' at the end of 
'' as an output directive too.

I don't know what OS or shell the OP is using.

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] covering indices are preferred over indices covering more terms in a join

2012-03-31 Thread Richard Hipp
On Fri, Mar 30, 2012 at 9:42 AM, Reinco Hof  wrote:

> Hello,
>
>
>
> I would like to report a sqlite problem:
>
>
>
> Covering indices are preferred over indices covering more terms in a join.
>
> This leads to a suboptimal query plan.
>

I think that in this case, SQLite is choosing the correct query plan based
on what it iknows about the data in the tables.  If it really is more
efficient to use the index that covers more terms of the join condition,
and you make that fact known to SQLite by running ANALYZE on the data, then
SQLite will choose that plan.  But without ANALYZE, SQLite must guess at
the effectiveness of the various indices, and at the number of entries in
each table, and based on those guesses, the covering index really is a
better way to go.



>
>
>
> In the example below index idx_tableB_full is used instead of
> idx_tableB_partial,
>
> even though the partial index covers more terms of the join statement.
>
>
>
> example:
>
> CREATE TABLE tableA(Id1 INTEGER, Id2 INTEGER, data BLOB);
>
> CREATE TABLE tableB(Id1 INTEGER, Id2 INTEGER, ParentId INTEGER);
> CREATE INDEX idx_tableB_full ON tableB(Id1, ParentId, Id2);
> CREATE INDEX idx_tableB_partial ON tableB(Id1, Id2);
>
> explain query plan SELECT str.ParentId FROM tableA obj
> JOIN tableB str ON str.Id1 = obj.Id1 AND str.Id2 = obj.Id2;
>
> -- 0|0|0|SCAN TABLE tableA AS obj (~100 rows)
> -- 0|1|1|SEARCH TABLE tableB AS str USING COVERING INDEX idx_tableB_full
> (Id1=?)
>
>
>
>
>
> note: the expected query plan would be:
>
> --   0|0|0|SCAN TABLE tableA AS obj (~100 rows)
> --   0|1|1|SEARCH TABLE tableB AS str USING INDEX idx_tableB_partial
> (Id1=? AND Id2=?)
>
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how to wrie "" char in my html file?

2012-03-31 Thread Gabor Grothendieck
On Sat, Mar 31, 2012 at 2:55 AM, YAN HONG YE  wrote:
>>sqlite3 -html C:\mydatabase\mydzh.db "select ''">mm.html
> this command result is not  in the mm.html file, it's this following 
> text:
> 
> 
> not I wanted, how to wrie  char in my html file?

This seems to be the code I sent you privately except its been changed
from what I wrote so that it no longer works.  The original code did
not use -html .

Also for those who are more used to UNIX since we are on Windows here,
note that
 echo ""
and
 echo ''
do NOT work (the first outputs double quotes and the second does not
escape the angle brackets) but as an alternative this does work:
 echo ^
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] covering indices are preferred over indices covering more terms in a join

Hello,

 

I would like to report a sqlite problem:

 

Covering indices are preferred over indices covering more terms in a join.

This leads to a suboptimal query plan.

 

In the example below index idx_tableB_full is used instead of 
idx_tableB_partial,

even though the partial index covers more terms of the join statement.

 

example:

CREATE TABLE tableA(Id1 INTEGER, Id2 INTEGER, data BLOB);

CREATE TABLE tableB(Id1 INTEGER, Id2 INTEGER, ParentId INTEGER);
CREATE INDEX idx_tableB_full ON tableB(Id1, ParentId, Id2);
CREATE INDEX idx_tableB_partial ON tableB(Id1, Id2);

explain query plan SELECT str.ParentId FROM tableA obj
JOIN tableB str ON str.Id1 = obj.Id1 AND str.Id2 = obj.Id2;

-- 0|0|0|SCAN TABLE tableA AS obj (~100 rows)
-- 0|1|1|SEARCH TABLE tableB AS str USING COVERING INDEX idx_tableB_full (Id1=?)

 

 

note: the expected query plan would be:

--   0|0|0|SCAN TABLE tableA AS obj (~100 rows)
--   0|1|1|SEARCH TABLE tableB AS str USING INDEX idx_tableB_partial (Id1=? AND 
Id2=?)

 

 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] about sqlite3_exec function

What you want is the system() function which will execute a shell command.



But you still need to add your own HTML around it to be displayed by a browser 
as it's missing the "rest of the story".



system("echo  >mm.html");  // first one creates mm.html

system("echo  >>mm.html"); // 2nd and subsequent append mm.html

system("sqlite3 -html -header mydzh.db \"select * from dhq where ph15>10;\" 
>>mm.html");

system("echo  >>mm.html");

system("echo  >>mm.html");



Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems


From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of YAN HONG YE [yanhong...@mpsa.com]
Sent: Saturday, March 31, 2012 12:54 AM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] about sqlite3_exec function

sqlite3_exec( db, "???", 0, 0, &pErrMsg);

I wanna add this following command into sqlite3_exec func:
"sqlite3 -html -header mydzh.db \"select * from dhq where ph15>10;\" >mm.html"
 like this:
sqlite3_exec( db, "-html -header \"select * from dhq where ph15>10;\" 
>mm.html", 0, 0, &pErrMsg);

but it doesn't  work
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] System.Data.SQLite


J Decker wrote:
> 
> '1>LINK : fatal error LNK1181: cannot open input file
>
'M:\clapps\xperdex\SQLite\1.0.79.0\SQLite.Interop\..\bin\2010\DebugModule\bi
n\System.Data.SQLite.netmodule''
> 

In your new solution, the "SQLite.Interop.*" project(s) should have the
"System.Data.SQLite.Module.*" project checked in the "Project Dependencies"
settings dialog (i.e. because the interop project(s) "consume" the
.netmodule
when building the mixed-mode assembly).

> 
> '1>LINK : fatal error LNK1181: cannot open input file
>
'M:\clapps\xperdex\SQLite\1.0.79.0\SQLite.Interop\..\bin\2010\DebugModule\bi
n\System.Data.SQLite.netmodule''
> 

This may be caused by the solution platforms not being "Win32" and "x64".

Also, if you wish to build the separate managed and native assemblies,
you'll
need the configurations "DebugNativeOnly" and/or "ReleaseNativeOnly" defined
in your solution (i.e. otherwise the interop project will always default to
linking with the .netmodule).

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [patch] sqlite-3.7.11: valgrind errors in testsuite


On 03/31/2012 04:04 PM, Yuriy Kaminskiy wrote:

valgrind ./testfixture test/trigger7.test

Note: line numbers below are off-by-2.

trigger7-2.1... Ok
trigger7-2.2...==11533== Invalid read of size 1

Seems always reproducible.


Thanks for reporting this.

These tests are run with valgrind as part of the release process.
But this error only shows up when you build with SQLITE_OMIT_LOOKASIDE
(or disable the lookaside allocator some other way). I think this is
probably better - perhaps we should disable lookaside when running
valgrind tests during release testing too.


It seems patch below fixes it (but I'm not sure if it is correct/sufficient;
codepath seems common, why it is only triggered by this test is not clear).


The patch looks correct and safe to me. The only possible problem
is that the modification adds (a tiny amount of) code to one of
the most performance sensitive functions in the library.

I think the reason this hasn't shown up before is that Mem.z is
not valid unless either the MEM_Str or MEM_Blob flag is set on
the memory cell. So accessing it when these flags are both clear
is a bug in sqlite3VdbeMemGrow(). The bug is only triggered when
the 'preserve' argument to sqlite3VdbeMemGrow() is true.

And the only place where sqlite3VdbeMemGrow() is called with
the preserve flag set to true and a memory cell that does not
have either the MEM_Str or MEM_Blob is from the code to do
EXPLAIN listing of trigger programs.

This fix changes the EXPLAIN listing code so that it doesn't do
that:

http://www.sqlite.org/src/info/c9342ca581?sbs=0

Dan.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Typo in documentation


Hello!

I just found a typo in http://www.sqlite.org/fileformat.html

Search for "stored with the must significant byte first" that should read:
"stored with the most significant byte first".

A one letter typo, no big deal.

--
Barbu Paul - Gheorghe
Common sense is not so common - Voltaire
Visit My GitHub profile to see my open-source projects - 
https://github.com/paullik
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how to wrie "" char in my html file?


On 31 Mar 2012, at 7:55am, YAN HONG YE  wrote:

> how to wrie  char in my html file?

In Unix,

echo '' >> mm.html

In Windows it is something like

echo ' >> mm.html

Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] [patch] sqlite-3.7.11: valgrind errors in testsuite

valgrind ./testfixture test/trigger7.test

Note: line numbers below are off-by-2.

trigger7-2.1... Ok
trigger7-2.2...==11533== Invalid read of size 1
==11533==at 0x401FD90: memcpy (mc_replace_strmem.c:482)
==11533==by 0x8098EE2: sqlite3VdbeMemGrow (vdbemem.c:90)
==11533==by 0x80CD503: sqlite3VdbeList (vdbeaux.c:1240)
==11533==by 0x80CD968: sqlite3_step (vdbeapi.c:407)
==11533==by 0x8077181: dbEvalStep (tclsqlite.c:1425)
==11533==by 0x8079905: DbObjCmd (tclsqlite.c:2275)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40AA7E8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40A866C: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x4067EA0: TclEvalObjEx (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40F0B09: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==  Address 0x4f4f6c3 is 3 bytes inside a block of size 32 free'd
==11533==at 0x401D79C: free (vg_replace_malloc.c:325)
==11533==by 0x807C0BA: sqlite3_free (malloc.c:473)
==11533==by 0x808CAE2: releaseMemArray (vdbeaux.c:1091)
==11533==by 0x80C96A0: sqlite3VdbeHalt (vdbeaux.c:1643)
==11533==by 0x80C9F94: sqlite3VdbeReset (vdbeaux.c:2344)
==11533==by 0x80CA085: sqlite3_reset (vdbeapi.c:102)
==11533==by 0x80771A8: dbEvalStep (tclsqlite.c:1432)
==11533==by 0x8079905: DbObjCmd (tclsqlite.c:2275)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40AA7E8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40A866C: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x4067EA0: TclEvalObjEx (in /usr/lib/libtcl8.5.so.0)
==11533==
==11533== Invalid read of size 1
==11533==at 0x401FD98: memcpy (mc_replace_strmem.c:482)
==11533==by 0x8098EE2: sqlite3VdbeMemGrow (vdbemem.c:90)
==11533==by 0x80CD503: sqlite3VdbeList (vdbeaux.c:1240)
==11533==by 0x80CD968: sqlite3_step (vdbeapi.c:407)
==11533==by 0x8077181: dbEvalStep (tclsqlite.c:1425)
==11533==by 0x8079905: DbObjCmd (tclsqlite.c:2275)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40AA7E8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40A866C: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x4067EA0: TclEvalObjEx (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40F0B09: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==  Address 0x4f4f6c2 is 2 bytes inside a block of size 32 free'd
==11533==at 0x401D79C: free (vg_replace_malloc.c:325)
==11533==by 0x807C0BA: sqlite3_free (malloc.c:473)
==11533==by 0x808CAE2: releaseMemArray (vdbeaux.c:1091)
==11533==by 0x80C96A0: sqlite3VdbeHalt (vdbeaux.c:1643)
==11533==by 0x80C9F94: sqlite3VdbeReset (vdbeaux.c:2344)
==11533==by 0x80CA085: sqlite3_reset (vdbeapi.c:102)
==11533==by 0x80771A8: dbEvalStep (tclsqlite.c:1432)
==11533==by 0x8079905: DbObjCmd (tclsqlite.c:2275)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40AA7E8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40A866C: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x4067EA0: TclEvalObjEx (in /usr/lib/libtcl8.5.so.0)
==11533==
==11533== Invalid read of size 1
==11533==at 0x401FD9F: memcpy (mc_replace_strmem.c:482)
==11533==by 0x8098EE2: sqlite3VdbeMemGrow (vdbemem.c:90)
==11533==by 0x80CD503: sqlite3VdbeList (vdbeaux.c:1240)
==11533==by 0x80CD968: sqlite3_step (vdbeapi.c:407)
==11533==by 0x8077181: dbEvalStep (tclsqlite.c:1425)
==11533==by 0x8079905: DbObjCmd (tclsqlite.c:2275)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40AA7E8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40A866C: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x4067EA0: TclEvalObjEx (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40F0B09: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==  Address 0x4f4f6c1 is 1 bytes inside a block of size 32 free'd
==11533==at 0x401D79C: free (vg_replace_malloc.c:325)
==11533==by 0x807C0BA: sqlite3_free (malloc.c:473)
==11533==by 0x808CAE2: releaseMemArray (vdbeaux.c:1091)
==11533==by 0x80C96A0: sqlite3VdbeHalt (vdbeaux.c:1643)
==11533==by 0x80C9F94: sqlite3VdbeReset (vdbeaux.c:2344)
==11533==by 0x80CA085: sqlite3_reset (vdbeapi.c:102)
==11533==by 0x80771A8: dbEvalStep (tclsqlite.c:1432)
==11533==by 0x8079905: DbObjCmd (tclsqlite.c:2275)
==11533==by 0x40668D8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40AA7E8: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x40A866C: ??? (in /usr/lib/libtcl8.5.so.0)
==11533==by 0x4067EA0: TclEvalObjEx (in /usr/lib/libtcl8.5.so.0)
==11533==
==11533== Invalid read of size 1
==11533==at 0x401FDA6: memcpy (mc_replace_strmem.c:482)
==11533==by 0x8098EE2: sqlite3VdbeMemGrow (vdbemem.c:90)
==11533==by 0x80CD503: sqlite3VdbeList (vdbeaux.c:1240)
==11533==by 0x80CD968: sql

[sqlite] updating config.guess and config.sub

Hi, while compiling for Android, I ran into the issue where
arm-linux-androideabi is not recognized as a host.  Apparently there is an
updated version of config.guess and config.sub (from AutoTools) that
addresses this issue. Recommend an update of these two files in the next
version.

In case anyone runs into this the bleeding edge is available here:
http://git.savannah.gnu.org/gitweb/?p=config.git;a=tree

Respectfully,
Tim
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Crash (c0000005 - Access Violation) in sqlite3.exe

Yuriy Kaminskiy wrote:
> Richard Hipp wrote:
>> On Thu, Feb 23, 2012 at 12:29 PM, Petite Abeille
>> wrote:
>>
>>> On Feb 23, 2012, at 6:21 PM, Levi Haskell wrote:
>>>
 sqlite> select 1 from (select *);
>>> Wow, wicked :)
>>>
>>> Confirmed on sqlite3 -version
>>> 3.7.10 2012-01-16 13:28:40 ebd01a8deffb5024a5d7494eef800d2366d97204
>>>
>>
>> Fixed here:  http://www.sqlite.org/src/info/c8c7846fb9
> 
> This fix triggers SQLITE_NOMEM and test/select1.test select1-16.1 failure when
> lookaside allocation failed (or sqlite compiled with SQLITE_OMIT_LOOKASIDE):
>> select1-16.1...
>> Expected: [1 {no tables specified}]
>>  Got: [1 {out of memory}]
> Maybe sqlite3Malloc() should be changed to NOT return NULL when called with 
> n==0.
Conservative fix:

Index: sqlite3-3.7.11/src/select.c
===
--- sqlite3-3.7.11.orig/src/select.c2012-03-31 12:32:12.0 +0400
+++ sqlite3-3.7.11/src/select.c 2012-03-31 12:34:42.0 +0400
@@ -1258,7 +1258,11 @@ static int selectColumnsFromExprList(
   char *zName;/* Column name */
   int nName;  /* Size of name in zName[] */

-  *pnCol = nCol = pEList ? pEList->nExpr : 0;
+  if( !pEList ){
+*pnCol = 0; *paCol = NULL;
+return SQLITE_OK;
+  }
+  *pnCol = nCol = pEList->nExpr;
   aCol = *paCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol);
   if( aCol==0 ) return SQLITE_NOMEM;
   for(i=0, pCol=aCol; ihttp://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Crash (c0000005 - Access Violation) in sqlite3.exe

Richard Hipp wrote:
> On Thu, Feb 23, 2012 at 12:29 PM, Petite Abeille
> wrote:
> 
>> On Feb 23, 2012, at 6:21 PM, Levi Haskell wrote:
>>
>>> sqlite> select 1 from (select *);
>> Wow, wicked :)
>>
>> Confirmed on sqlite3 -version
>> 3.7.10 2012-01-16 13:28:40 ebd01a8deffb5024a5d7494eef800d2366d97204
>>
> 
> 
> Fixed here:  http://www.sqlite.org/src/info/c8c7846fb9

This fix triggers SQLITE_NOMEM and test/select1.test select1-16.1 failure when
lookaside allocation failed (or sqlite compiled with SQLITE_OMIT_LOOKASIDE):
> select1-16.1...
> Expected: [1 {no tables specified}]
>  Got: [1 {out of memory}]
Maybe sqlite3Malloc() should be changed to NOT return NULL when called with 
n==0.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Crash in icuOpen()

On Fri, Mar 30, 2012 at 07:38:11PM -0400, Richard Hipp wrote:
> It is easy enough for use to just put a patch in the code to fix this.  But
> we would rather understand what is happening first.  Can you recreate the
> problem?  Can you give us any clues what you are doing in order to make
> this happen?

Please see my email "Segfault with FTS and tokenize=icu", it's from 2010
but this seems to be the same scenario. Then steps to reproduce were:

CREATE VIRTUAL TABLE f USING fts3 (t TEXT, tokenize=icu);
insert into f (docid) values (1);
insert into f (docid) values (2);
insert into f (docid) values (3);
insert into f (docid) values (4);
update f set t = 'test' where docid = 3;

-- 
Damian Pietras

http://www.linuxprogrammingblog.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] how to wrie "" char in my html file?

[YAN HONG YE]

>>sqlite3 -html C:\mydatabase\mydzh.db "select ''">mm.html
> this command result is not  in the mm.html file, it's this following 
> text:
> 
> > not I wanted, how to wrie char in my html file? That would create invalid html. "
" will be displayed as "" by the html parser. -- Steinar ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users