Re: [sqlite] [regression] SQLite 3.8.7 causes Evolution to crash

2014-10-22 Thread Richard Hipp
On Wed, Oct 22, 2014 at 5:14 PM, Paul Menzel <
paulepan...@users.sourceforge.net> wrote:

> Dear SQLite folks,
>
>
> after the upgrade of libsqlite3 from 3.8.6 to 3.8.7 Evolution crashes
> with a segmentation fault.
>
> pool[6371]: segfault at 0 ip   (null) sp a67d26ec error 14
>
> Several people have reproduced this [1].
>

The problem *might* be an incomplete VFS implementation in Evolution.  I
put a more detailed comment on the Bugzilla ticket.


-- 
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] Performance regression in Banshee with sqlite 3.8.7 on Arch Linux

2014-10-22 Thread Richard Hipp
Thanks for sending in the performance regression report.

On Wed, Oct 22, 2014 at 1:51 PM, Tomislav Ljubej  wrote:

> Hello,
>
> There is a performance regression in the media player Banshee on the
> query that is in the attachment. The query takes about 13 seconds on
> my i7 4770 processor. I tried the latest stable version before the
> current one which is 3.8.6.1 and the performance regression doesn't
> happen, the query completes in less than half a second.
>
> The query is run 3 times at Banshee startup so it slows down the
> startup of the application significantly.
>
> Also attached is the .schema output for the database Banshee uses. I'm
> not sure why the 'CoreCache' table isn't mentioned in the schema but
> I'm pretty sure it's actually referring to 'CoreCacheModels', I got
> the query from Banshee's debug output so it may not reflect the actual
> names in the database.
>

Several problems:

(1) Your "query" is actually two statements:  a DELETE followed by an
INSERT.  The INSERT is fed from a SELECT.  Would I be correct in assuming
that the SELECT is the problem?

(2) You are right that CoreCache is not in the schema, so the SELECT is not
valid.  I tried changing the name of the CoreCache table in the SELECT into
CoreCacheModels, but then it complains that CoreCacheModels has no ItemID
column.

(3) After you determine the correct schema and query, it would be helpful
to us if you can send us the output of ".fullschema".  The ".fullschema"
output includes the sqlite_stat1 and sqlite_stat4 tables (if they exist)
which contain histogram data used by the query planner.  Those table (if
they exist) are needed by us in order to reproduce the behavior your are
observing.

(4) If you are able to send us your complete database file, perhaps by
private email, that would be even more helpful, but is not absolutely
necessary.


>
> --
> Tomislav Ljubej
>
> ___
> 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


[sqlite] [regression] SQLite 3.8.7 causes Evolution to crash

2014-10-22 Thread Paul Menzel
Dear SQLite folks,


after the upgrade of libsqlite3 from 3.8.6 to 3.8.7 Evolution crashes
with a segmentation fault.

pool[6371]: segfault at 0 ip   (null) sp a67d26ec error 14

Several people have reproduced this [1].

Milan, one of the main developers of Evolution, analyzed the crash a
little [2]:


Am Montag, den 20.10.2014, 11:12 +0200 schrieb Milan Crha:

[…]

> If you are wondering, then according to the backtrace the sqlite 
> was executing "SELECT uid,flags FROM 'Inbox' order by dreceived" or 
> your ~/.local/share/evolution/mail/local/folders.db file, which you 
> can run outside of evolution too, with this command:
>$ sqlite3 ~/.local/share/evolution/mail/local/folders.db \
> "SELECT uid,flags FROM 'Inbox' order by dreceived;"
> It should return many lines or just crash like evolution did, when 
> you'll use "the affected" sqlite version.

It’d be great if you could open a bug report in the SQLite bug tracker
and help analyzing the bug.

Please find the backtrace pasted at the end of the message.


Thanks,

Paul


[1] https://bugzilla.gnome.org/show_bug.cgi?id=738965
[2] https://mail.gnome.org/archives/evolution-list/2014-October/msg00126.html


#0  0x in ?? ()

Thread 49 (Thread 0xa20eab40 (LWP 10460)):
#0  0xb7fdcd4c in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7cb1c4b in pthread_cond_wait@@GLIBC_2.3.2 () at 
../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:187
No locals.
#2  0xb43d916e in std::condition_variable::wait(std::unique_lock&) 
() from /usr/lib/i386-linux-gnu/libstdc++.so.6
No symbol table info available.
#3  0xb3b8c3f4 in wait > 
(__p=..., __lock=..., this=0xa9f560c0)
at /usr/include/c++/4.9/condition_variable:98
No locals.
#4  JSC::GCThread::waitForNextPhase (this=0x88410be8) at 
../Source/JavaScriptCore/heap/GCThread.cpp:79
lock = {_M_device = 0xa9f560a8, _M_owns = true}
#5  0xb3b8c4f9 in JSC::GCThread::gcThreadMain (this=0x88410be8) at 
../Source/JavaScriptCore/heap/GCThread.cpp:97
enabler = {m_stack = @0x8847e7d8}
currentPhase = 
#6  0xb3b8c5ba in JSC::GCThread::gcThreadStartFunc (data=0x88410be8) at 
../Source/JavaScriptCore/heap/GCThread.cpp:133
thread = 0x88410be8
#7  0xb3e8805e in WTF::threadEntryPoint (contextData=0xa9f0dd48) at 
../Source/WTF/wtf/Threading.cpp:69
context = 0xa9f0dd48
entryPoint = 0xb3b8c5a0 
data = 0x88410be8
#8  0xb3e880f9 in WTF::wtfThreadEntryPoint (param=0xa9f0c030) at 
../Source/WTF/wtf/ThreadingPthreads.cpp:170
invocation = std::unique_ptr containing 
0xa9f0c030
#9  0xb7cadefb in start_thread (arg=0xa20eab40) at pthread_create.c:309
__res = 
pd = 0xa20eab40
now = 
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {-1211367424, -1576096960, 
4001536, -1576099288, 917005609, -1101589246}, mask_was_saved = 0}}, 
  priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 
0x0, canceltype = 0}}}
not_first_call = 
pagesize_m1 = 
sp = 
freesize = 
__PRETTY_FUNCTION__ = "start_thread"
#10 0xb51c0d4e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129
No locals.

Thread 48 (Thread 0xa30ecb40 (LWP 10459)):
#0  0xb7fdcd4c in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7cb1c4b in pthread_cond_wait@@GLIBC_2.3.2 () at 
../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:187
No locals.
#2  0xb43d916e in std::condition_variable::wait(std::unique_lock&) 
() from /usr/lib/i386-linux-gnu/libstdc++.so.6
No symbol table info available.
#3  0xb3b8aefb in JSC::BlockAllocator::blockFreeingThreadMain (this=0xa9f5103c) 
at ../Source/JavaScriptCore/heap/BlockAllocator.cpp:143
lock = {_M_device = 0xa9f51130, _M_owns = true}
regionLocker = {lock_ = 0xa9f5112c}
desiredNumberOfEmptyRegions = 
#4  0xb3b8b12a in JSC::BlockAllocator::blockFreeingThreadStartFunc 
(blockAllocator=0xa9f5103c)
at ../Source/JavaScriptCore/heap/BlockAllocator.cpp:119
No locals.
#5  0xb3e8805e in WTF::threadEntryPoint (contextData=0xa9f0dd70) at 
../Source/WTF/wtf/Threading.cpp:69
context = 0xa9f0dd70
entryPoint = 0xb3b8b110 

data = 0xa9f5103c
#6  0xb3e880f9 in WTF::wtfThreadEntryPoint (param=0xa9f0c010) at 
../Source/WTF/wtf/ThreadingPthreads.cpp:170
invocation = std::unique_ptr containing 
0xa9f0c010
#7  0xb7cadefb in start_thread (arg=0xa30ecb40) at pthread_create.c:309
__res = 
pd = 0xa30ecb40
now = 
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {-1211367424, -1559311552, 
4001536, -1559313880, 912811307, -1101589246}, mask_was_saved = 0}}, 
  priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 
0x0, canceltype = 0}}}
not_first_call = 
pagesize_m1 = 
sp = 
freesize 

[sqlite] [regression] SQLite 3.8.7 causes Evolution to crash

2014-10-22 Thread Paul Menzel
Dear SQLite folks,


after the upgrade of libsqlite3 from 3.8.6 to 3.8.7 Evolution crashes
with a segmentation fault.

pool[6371]: segfault at 0 ip   (null) sp a67d26ec error 14

Several people have reproduced this [1].

Milan, one of the main developers of Evolution, analyzed the crash a
little [2]:


Am Montag, den 20.10.2014, 11:12 +0200 schrieb Milan Crha:

[…]

> If you are wondering, then according to the backtrace the sqlite 
> was executing "SELECT uid,flags FROM 'Inbox' order by dreceived" or 
> your ~/.local/share/evolution/mail/local/folders.db file, which you 
> can run outside of evolution too, with this command:
>$ sqlite3 ~/.local/share/evolution/mail/local/folders.db \
> "SELECT uid,flags FROM 'Inbox' order by dreceived;"
> It should return many lines or just crash like evolution did, when 
> you'll use "the affected" sqlite version.

It’d be great if you could open a bug report in the SQLite bug tracker
and help analyzing the bug.

Please find the backtrace pasted at the end of the message.


Thanks,

Paul


[1] https://bugzilla.gnome.org/show_bug.cgi?id=738965
[2] https://mail.gnome.org/archives/evolution-list/2014-October/msg00126.html


#0  0x in ?? ()

Thread 49 (Thread 0xa20eab40 (LWP 10460)):
#0  0xb7fdcd4c in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7cb1c4b in pthread_cond_wait@@GLIBC_2.3.2 () at 
../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:187
No locals.
#2  0xb43d916e in std::condition_variable::wait(std::unique_lock&) 
() from /usr/lib/i386-linux-gnu/libstdc++.so.6
No symbol table info available.
#3  0xb3b8c3f4 in wait > 
(__p=..., __lock=..., this=0xa9f560c0)
at /usr/include/c++/4.9/condition_variable:98
No locals.
#4  JSC::GCThread::waitForNextPhase (this=0x88410be8) at 
../Source/JavaScriptCore/heap/GCThread.cpp:79
lock = {_M_device = 0xa9f560a8, _M_owns = true}
#5  0xb3b8c4f9 in JSC::GCThread::gcThreadMain (this=0x88410be8) at 
../Source/JavaScriptCore/heap/GCThread.cpp:97
enabler = {m_stack = @0x8847e7d8}
currentPhase = 
#6  0xb3b8c5ba in JSC::GCThread::gcThreadStartFunc (data=0x88410be8) at 
../Source/JavaScriptCore/heap/GCThread.cpp:133
thread = 0x88410be8
#7  0xb3e8805e in WTF::threadEntryPoint (contextData=0xa9f0dd48) at 
../Source/WTF/wtf/Threading.cpp:69
context = 0xa9f0dd48
entryPoint = 0xb3b8c5a0 
data = 0x88410be8
#8  0xb3e880f9 in WTF::wtfThreadEntryPoint (param=0xa9f0c030) at 
../Source/WTF/wtf/ThreadingPthreads.cpp:170
invocation = std::unique_ptr containing 
0xa9f0c030
#9  0xb7cadefb in start_thread (arg=0xa20eab40) at pthread_create.c:309
__res = 
pd = 0xa20eab40
now = 
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {-1211367424, -1576096960, 
4001536, -1576099288, 917005609, -1101589246}, mask_was_saved = 0}}, 
  priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 
0x0, canceltype = 0}}}
not_first_call = 
pagesize_m1 = 
sp = 
freesize = 
__PRETTY_FUNCTION__ = "start_thread"
#10 0xb51c0d4e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129
No locals.

Thread 48 (Thread 0xa30ecb40 (LWP 10459)):
#0  0xb7fdcd4c in __kernel_vsyscall ()
No symbol table info available.
#1  0xb7cb1c4b in pthread_cond_wait@@GLIBC_2.3.2 () at 
../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:187
No locals.
#2  0xb43d916e in std::condition_variable::wait(std::unique_lock&) 
() from /usr/lib/i386-linux-gnu/libstdc++.so.6
No symbol table info available.
#3  0xb3b8aefb in JSC::BlockAllocator::blockFreeingThreadMain (this=0xa9f5103c) 
at ../Source/JavaScriptCore/heap/BlockAllocator.cpp:143
lock = {_M_device = 0xa9f51130, _M_owns = true}
regionLocker = {lock_ = 0xa9f5112c}
desiredNumberOfEmptyRegions = 
#4  0xb3b8b12a in JSC::BlockAllocator::blockFreeingThreadStartFunc 
(blockAllocator=0xa9f5103c)
at ../Source/JavaScriptCore/heap/BlockAllocator.cpp:119
No locals.
#5  0xb3e8805e in WTF::threadEntryPoint (contextData=0xa9f0dd70) at 
../Source/WTF/wtf/Threading.cpp:69
context = 0xa9f0dd70
entryPoint = 0xb3b8b110 

data = 0xa9f5103c
#6  0xb3e880f9 in WTF::wtfThreadEntryPoint (param=0xa9f0c010) at 
../Source/WTF/wtf/ThreadingPthreads.cpp:170
invocation = std::unique_ptr containing 
0xa9f0c010
#7  0xb7cadefb in start_thread (arg=0xa30ecb40) at pthread_create.c:309
__res = 
pd = 0xa30ecb40
now = 
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {-1211367424, -1559311552, 
4001536, -1559313880, 912811307, -1101589246}, mask_was_saved = 0}}, 
  priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 
0x0, canceltype = 0}}}
not_first_call = 
pagesize_m1 = 
sp = 
freesize 

[sqlite] Performance regression in Banshee with sqlite 3.8.7 on Arch Linux

2014-10-22 Thread Tomislav Ljubej
Hello,

There is a performance regression in the media player Banshee on the
query that is in the attachment. The query takes about 13 seconds on
my i7 4770 processor. I tried the latest stable version before the
current one which is 3.8.6.1 and the performance regression doesn't
happen, the query completes in less than half a second.

The query is run 3 times at Banshee startup so it slows down the
startup of the application significantly.

Also attached is the .schema output for the database Banshee uses. I'm
not sure why the 'CoreCache' table isn't mentioned in the schema but
I'm pretty sure it's actually referring to 'CoreCacheModels', I got
the query from Banshee's debug output so it may not reflect the actual
names in the database.

-- 
Tomislav Ljubej
DELETE FROM CoreCache WHERE ModelID = 9;
INSERT INTO CoreCache (ModelID, ItemID) SELECT 9, 
CoreTracks.TrackID 
FROM (SELECT MIN(CoreTracks.TrackID) AS TrackID, 
CoreTracks.Year FROM CoreTracks GROUP BY CoreTracks.Year) AS CoreTracks
WHERE CoreTracks.Year IN
(SELECT CoreTracks.Year FROM CoreTracks, CoreCache
WHERE CoreCache.ModelID = 71 AND
  CoreCache.ItemID = CoreTracks.TrackID )
ORDER BY YearCREATE TABLE CoreConfiguration (
EntryID INTEGER PRIMARY KEY,
Key TEXT,
Value   TEXT
);
CREATE TABLE CorePrimarySources (
PrimarySourceID INTEGER PRIMARY KEY,
StringIDTEXT UNIQUE,
CachedCount INTEGER,
IsTemporary INTEGER DEFAULT 0
);
CREATE TABLE CoreTracks (
PrimarySourceID INTEGER NOT NULL,
TrackID INTEGER PRIMARY KEY,
ArtistIDINTEGER,
AlbumID INTEGER,
TagSetIDINTEGER,
ExternalID  INTEGER,

MusicBrainzID   TEXT,

Uri TEXT,
MimeTypeTEXT,
FileSizeINTEGER,
BitRate INTEGER,
SampleRate  INTEGER,
BitsPerSample   INTEGER,
Attributes  INTEGER DEFAULT 5,
LastStreamError INTEGER DEFAULT 0,

Title   TEXT,
TitleLoweredTEXT,
TitleSort   TEXT,
TitleSortKeyBLOB,
TrackNumber INTEGER,
TrackCount  INTEGER,
DiscINTEGER,
DiscCount   INTEGER,
DurationINTEGER,
YearINTEGER,
Genre   TEXT,
ComposerTEXT,
Conductor   TEXT,
GroupingTEXT,
Copyright   TEXT,
LicenseUri  TEXT,

Comment TEXT,
Rating  INTEGER,
Score   INTEGER,
PlayCount   INTEGER,
SkipCount   INTEGER,
LastPlayedStamp INTEGER,
LastSkippedStampINTEGER,
DateAddedStamp  INTEGER,
DateUpdatedStampINTEGER,
MetadataHashTEXT,
BPM INTEGER,
LastSyncedStamp INTEGER,
FileModifiedStamp   INTEGER
);
CREATE INDEX CoreTracksPrimarySourceIndex ON CoreTracks(ArtistID, AlbumID, 
PrimarySourceID, Disc, TrackNumber, Uri);
CREATE INDEX CoreTracksAggregatesIndex ON CoreTracks(FileSize, Duration);
CREATE INDEX CoreTracksExternalIDIndex ON CoreTracks(PrimarySourceID, 
ExternalID);
CREATE INDEX CoreTracksUriIndex ON CoreTracks(PrimarySourceID, Uri);
CREATE INDEX CoreTracksCoverArtIndex ON CoreTracks (PrimarySourceID, AlbumID, 
DateUpdatedStamp);
CREATE TABLE CoreAlbums (
AlbumID INTEGER PRIMARY KEY,
ArtistIDINTEGER,
TagSetIDINTEGER,

MusicBrainzID   TEXT,

Title   TEXT,
TitleLoweredTEXT,
TitleSort   TEXT,
TitleSortKeyBLOB,

ReleaseDate INTEGER,
DurationINTEGER,
Year

[sqlite] strchrnul compilation error

2014-10-22 Thread Philippe Riand
Related to this issue,
http://www.sqlite.org/src/info/0fac2c045f47c7735af4eb68ced81d8b43622a1f,
sqlite 3.8.7 fails to compile on Android by default, plus there is a
suspicious warning. The compiled code is the amalgamation:

jni/sqlite/sqlite3.c: In function 'sqlite3VXPrintf':
jni/sqlite/sqlite3.c:20980:11: warning: assignment makes pointer from
integer without a cast [enabled by default]
[armeabi-v7a] SharedLibrary  : mylib-sqlite.so
c:/Android/NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../.
./arm-linux-androideabi/bin/ld.exe:
./obj/local/armeabi-v7a/objs/jsonstore-sqlite/sqlite/sqlite3.o: in function
sqlite3V
XPrintf:jni/sqlite/sqlite3.c:20980: error: undefined reference to
'strchrnul'
collect2: ld returned 1 exit status

Defining HAVE_STRCHRNUL 0 made it compile. The warning also disappears when
the flag is set to '0'.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Index on expressions

2014-10-22 Thread Nico Williams
On Wed, Oct 22, 2014 at 3:42 PM, Philippe Riand  wrote:
> Hello,
> If there any plan to get this in? (see:
> http://sqlite.org:8080/cgi-bin/mailman/private/sqlite-users/2014-September/055065.html
> )

You'll notice that the SQLite3 developers don't often discuss what
features they will be adding (nor when), unless they are ready to make
a public commitment.  That's how it looks to me anyways.  That said,
Richard Hipp did not reject your request, and qualified the "SQLite3
does not support that" reply with "(yet)".  Take that for what you
will, though it's clearly NOT a rejection.  We'll find out eventually.
(You can always watch the public parts of the Fossil repo for SQLite3,
but you shouldn't count on anything you see there being committed to.)

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


Re: [sqlite] JSON indexing

2014-10-22 Thread Nico Williams
On Tue, Oct 21, 2014 at 4:01 PM, Mike Jarmy  wrote:
> something like that seems like its probably a necessary first step to being
> able to build a JSON index on disk.

To be fair, there are other ways it could be done.  But I would prefer
a mechanism that allows for external plugins, and for that the
opaque-type-coercible-to-SQLite-datatype concept seems like the one
optimization that's needed.

Also, I'd prefer a mechanism that "extends syntax" only by adding
user-defined functions (and virtual tables) that implement a JSON
(XML, ...) query language with expressions passed as strings or
otherwise disambiguated from the surrounding SQL in an extensible way.
(I'm not a fan of the Postgres hstore operators.  Can you tell?)

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


[sqlite] Index on expressions

2014-10-22 Thread Philippe Riand
Hello,
If there any plan to get this in? (see:
http://sqlite.org:8080/cgi-bin/mailman/private/sqlite-users/2014-September/055065.html
)
Note that this seems implemented by several databases now, and this is a
bit different from virtual columns, which is what the previous discussion
ended with. Virtual columns force a table alteration (adding the columns)
why indexes on expressions eventually speed up the search on conditions
like f(x)='value', if the index exists. You add the index only if it makes
sense from a performance standpoint, and it is not required.

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


Re: [sqlite] Full outer joins

2014-10-22 Thread Stephen Chrzanowski
Saying I 'would like this type of join' is something I say very lightly.
By that I mean it'd be good to see them, but, really, I'm not going to put
any pressure on anyone to get it implemented.

I'd been using these joins in SQL2K for years before I found out about
SQLite and a lot of what I was doing in 2K couldn't be done in SQLite
because of the outer joins.  Fortunately, the apps for 2K are specifically
for 2K and will never be converted to SQLite, but with the lack of
capability, I just learned a new way to get my results, which I think was
basically make a few queries.  This was before I REALLY figured out the
unions (Even though it was part of my training back then)

On Wed, Oct 22, 2014 at 3:46 AM, Paul Sanderson <
sandersonforens...@gmail.com> wrote:

> Really!!
>
> I can accept that it would not be needed as often as other joins but I
> can imagine that anyone who wrtes software that populates databases
> and who subsequently changes their software or needs to benchmark
> against some other datasource would find this useful.
>
>
> Cheers
> Paul
>
>
> On 22 October 2014 00:58, Richard Hipp  wrote:
> > On Tue, Oct 21, 2014 at 7:12 PM, Paul Sanderson <
> > sandersonforens...@gmail.com> wrote:
> >
> >>  out of interest why are
> >> full out joins not supported?
> >>
> >
> > In 14 years, you are the first person to ask for them.  That tells me
> that
> > probably not many people would use them even if we did put them in.
> >
> > --
> > D. Richard Hipp
> > d...@sqlite.org
> > ___
> > 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
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Is msvcrt coupling now unavoidable (3.8.7)?

2014-10-22 Thread Max Vlasov
On Wed, Oct 22, 2014 at 4:50 PM, dave  wrote:

>
> > -Original Message-
> > From: sqlite-users-boun...@sqlite.org
> > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Max Vlasov
> > Sent: Wednesday, October 22, 2014 5:25 AM
> > To: General Discussion of SQLite Database
> > Subject: [sqlite] Is msvcrt coupling now unavoidable (3.8.7)?
> ...
> > my static linking with Delphi for 3.7.8 version now complains about
> > _beginthreadex_/_endthreadex_.
> ...
> ...
>
> It's a good question; and it doesn't look like there is a great way of
> turning off that feature other than SQLITE_THREADSAFE=0, which you might
> not
> want for other reasons.
>
>
Thanks, dave, Clemens,

I also did some researching/fixing.

The sources have some contradictory information in the comments to the
current state, I'm not sure whether I should mention them here
Overall if one don't wants msvcrt coupling, then
SQLITE_MAX_WORKER_THREADS=0 should be in options. In this case no
_beginthreadex/_endthreadex
linking will be required.

Wrapping calls mentioned by Clemens Ladisch works. I wrote them
independently, but they look char by char the same :). When I did   PRAGMA
threads=4 and set breakpoints for "SELECT ... Order By" query , they were
visited and no visible errors appeared.

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


Re: [sqlite] Is msvcrt coupling now unavoidable (3.8.7)?

2014-10-22 Thread Clemens Ladisch
Max Vlasov wrote:
> my static linking with Delphi for 3.7.8 version now complains about
> _beginthreadex_/_endthreadex_.
> Quick search shows than everywhere there's a recommendation to use these
> functions instead of API CreateThread if one plans to use Visual c run-time
> (msvcrt).

Well, by default, SQLite uses the C runtime.

> All my previous linking with sqlite was based on hand-made equivalent
> function for every static link to external (non-dll) functions so my
> programs never used msvcrt.

I just use the actual C compiler's functions for most of those, and
SQLITE_WIN32_MALLOC; very few wrappers remain.

_begin/endthreadex() are just thin wrappers about the Win32 functions;
whatever the C RTL does (for thread-local storage etc.) is not needed
by SQLite:

// untested
function __beginthreadex(security_attr: Pointer; stksize: Longword; start: 
Pointer; arg: Pointer; create_flags: Longword; out thread_id: Longword): 
Longword; cdecl;
begin
  Result := CreateThread(security_attr, stksize, start, arg, create_flags, 
thread_id);
end;

procedure __endthreadex(thread_retval: Longword); cdecl;
begin
  ExitThread(thread_retval);
end;


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


Re: [sqlite] Is msvcrt coupling now unavoidable (3.8.7)?

2014-10-22 Thread dave

> -Original Message-
> From: sqlite-users-boun...@sqlite.org 
> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Max Vlasov
> Sent: Wednesday, October 22, 2014 5:25 AM
> To: General Discussion of SQLite Database
> Subject: [sqlite] Is msvcrt coupling now unavoidable (3.8.7)?
...
> my static linking with Delphi for 3.7.8 version now complains about
> _beginthreadex_/_endthreadex_.
...
> programs never used msvcrt. Now probably I either have no choice to
> including msvcrt linking of make my own "de-wrapper" so some 
> function that
> accepts _beginthreadex_ and calls CreateThread. Or can sqlite 
> introduce
> some define that makes vs run time coupled by default, but by 
> disabling it,
> uses CreateThread api?
...

It's a good question; and it doesn't look like there is a great way of
turning off that feature other than SQLITE_THREADSAFE=0, which you might not
want for other reasons.

I would suggest to the maintainers, though, that CreateThread be used by
'default', unless _MSC_VER is defined, (which means msvc is being used to
compile), since this is a MSVC-specific concept.  I'm a little surprised
that  is not also giving you trouble, but I guess the other
compiler vendors targetting Windows made their own version of it.

I don't know what the feature is for, but a cursory scan seems to show it's
for a background sorter.  I'm also a little surprised there is not a
SQLITE_OMIT_XXX around it, as well.

Oh well, there's always 3.8.6 while you wait for a fix.

-dave


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


[sqlite] what is wrong with this query

2014-10-22 Thread Paul Sanderson
I have two versions of the same table with minor differences.

I open one database (test1) and attach the second (test2)

SELECT test2.table1.*
FROM test2.table1
  LEFT JOIN table1 table11 ON test2.table1.id = table11.id


Gives an error condition

near "*": syntax error.


provide an alias for the table and it works OK

SELECT testtab.*
FROM test2.table1 testtab
  LEFT JOIN table1 table11 ON testtab.id = table11.id

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


[sqlite] Is msvcrt coupling now unavoidable (3.8.7)?

2014-10-22 Thread Max Vlasov
Hi,

my static linking with Delphi for 3.7.8 version now complains about
_beginthreadex_/_endthreadex_.
Quick search shows than everywhere there's a recommendation to use these
functions instead of API CreateThread if one plans to use Visual c run-time
(msvcrt).

All my previous linking with sqlite was based on hand-made equivalent
function for every static link to external (non-dll) functions so my
programs never used msvcrt. Now probably I either have no choice to
including msvcrt linking of make my own "de-wrapper" so some function that
accepts _beginthreadex_ and calls CreateThread. Or can sqlite introduce
some define that makes vs run time coupled by default, but by disabling it,
uses CreateThread api?

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


Re: [sqlite] Full outer joins

2014-10-22 Thread Paul Sanderson
Really!!

I can accept that it would not be needed as often as other joins but I
can imagine that anyone who wrtes software that populates databases
and who subsequently changes their software or needs to benchmark
against some other datasource would find this useful.


Cheers
Paul


On 22 October 2014 00:58, Richard Hipp  wrote:
> On Tue, Oct 21, 2014 at 7:12 PM, Paul Sanderson <
> sandersonforens...@gmail.com> wrote:
>
>>  out of interest why are
>> full out joins not supported?
>>
>
> In 14 years, you are the first person to ask for them.  That tells me that
> probably not many people would use them even if we did put them in.
>
> --
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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


[sqlite] hot jounal and read-only

2014-10-22 Thread MeKa
Hi,

https://www.sqlite.org/wal.html says:


*It is not possible to open read-only WAL databases
. The opening process must have
write privileges for "-shm" wal-index
 shared memory file
associated with the database, if that file exists, or else write access on
the directory containing the database file if the "-shm**" file does not
exist*.



I found out that there is also a problem, if you use SQLite with journaling
and opens the database read-only ( and a hot journal-file exists). I think,
the link https://www.sqlite.org/c3ref/open.html should be updated.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users