[sqlite] Upcoming Open Source Conference

2019-01-09 Thread Agustin G
Hi everyone!

I wanted to let the community know that the upcoming Percona Live Open
Source Database Conference will have a specific track for “Other Open
Source Databases”, in which anything SQLite-related will fit :)

If anyone is interested in presenting, you can use this link:
https://perconacfp.hubb.me/

Or let me know if you would like to discuss anything further.


Best,
Agustín.
-- 
Agustín Gallego, Support Engineer, Percona
agustin.gall...@percona.com
skype: percona.agustin
office: 1-919-794-5472
Montevideo, Uruguay (GMT -3)

https://percona.com
https://percona.com/blog

Join us at upcoming Percona Live MySQL conference
https://percona.com/live

Ask us how we can simplify monitoring your environment
https://percona.com/software/database-tools/percona-monitoring-and-management
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQlite.NET.chm

2019-01-09 Thread Mike King
From memory a file is marked as blocked by a hidden file stream attached to
the file. That’s why using cp removed the block as I guess it doesn’t
understand file streams.

Cheers

On Wed, 9 Jan 2019 at 21:49, Simon Slavin  wrote:

> On 9 Jan 2019, at 9:33pm, Don V Nielsen  wrote:
>
> > Is the chm file on a server? I remember this problem from years ago...I
>
> It's a long time ago, but I seem to remember being told that if I wanted
> to distribute a .chm file I should Zip it first.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQlite.NET.chm

2019-01-09 Thread Simon Slavin
On 9 Jan 2019, at 9:33pm, Don V Nielsen  wrote:

> Is the chm file on a server? I remember this problem from years ago...I

It's a long time ago, but I seem to remember being told that if I wanted to 
distribute a .chm file I should Zip it first.

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


Re: [sqlite] SQlite.NET.chm

2019-01-09 Thread Don V Nielsen
Is the chm file on a server? I remember this problem from years ago...I
haven't used a chm file in a long time. Unblocking did not fix it while it
resided on the server. However, copying it locally and unblocking it did
work.

Hope this helps,
dvn

On Wed, Jan 9, 2019 at 11:29 AM Rizzuto, Raymond 
wrote:

>
> When I download SQlite.NET.chm from the internet, and open it, I can see
> the table of content but not the actual content.  It appears to be due to a
> block caused by downloading from the internet.
>
> Googling came up with this:
> https://community.spiceworks.com/topic/1961503-solved-windows-10-chm-help-files-showing-up-blank
>
> However, my company has apparently set our pc's so we can neither see nor
> change the block status of a file from the internet.  As a work-around, I
> used cygwin's cp command to copy the file, and the copy is not blocked.
>
> Since .chm is a compiled html file, I would imagine the concern is that
> there can be embedded (and malicious) scripts in the html.  Would it be
> possible to provide documentation in a safer format, such as a .pdf?
>
> 
> Ray Rizzuto
> Susquehanna International Group
> (610)747-2336 (W)
> (856)617-1638 (C)
> Sent from Outlook
>
>
> 
>
> IMPORTANT: The information contained in this email and/or its attachments
> is confidential. If you are not the intended recipient, please notify the
> sender immediately by reply and immediately delete this message and all its
> attachments. Any review, use, reproduction, disclosure or dissemination of
> this message or any attachment by an unintended recipient is strictly
> prohibited. Neither this message nor any attachment is intended as or
> should be construed as an offer, solicitation or recommendation to buy or
> sell any security or other financial instrument. Neither the sender, his or
> her employer nor any of their respective affiliates makes any warranties as
> to the completeness or accuracy of any of the information contained herein
> or that this message or any of its attachments is free of viruses.
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Feedback on article about SQLITE_BUSY

2019-01-09 Thread rahul
> I have three points:

Thank you, appreciate the feedback. I've updated the article with the
changes you suggested.

Rahul



--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQlite.NET.chm

2019-01-09 Thread Rizzuto, Raymond

When I download SQlite.NET.chm from the internet, and open it, I can see the 
table of content but not the actual content.  It appears to be due to a block 
caused by downloading from the internet.

Googling came up with this:  
https://community.spiceworks.com/topic/1961503-solved-windows-10-chm-help-files-showing-up-blank

However, my company has apparently set our pc's so we can neither see nor 
change the block status of a file from the internet.  As a work-around, I used 
cygwin's cp command to copy the file, and the copy is not blocked.

Since .chm is a compiled html file, I would imagine the concern is that there 
can be embedded (and malicious) scripts in the html.  Would it be possible to 
provide documentation in a safer format, such as a .pdf?


Ray Rizzuto
Susquehanna International Group
(610)747-2336 (W)
(856)617-1638 (C)
Sent from Outlook




IMPORTANT: The information contained in this email and/or its attachments is 
confidential. If you are not the intended recipient, please notify the sender 
immediately by reply and immediately delete this message and all its 
attachments. Any review, use, reproduction, disclosure or dissemination of this 
message or any attachment by an unintended recipient is strictly prohibited. 
Neither this message nor any attachment is intended as or should be construed 
as an offer, solicitation or recommendation to buy or sell any security or 
other financial instrument. Neither the sender, his or her employer nor any of 
their respective affiliates makes any warranties as to the completeness or 
accuracy of any of the information contained herein or that this message or any 
of its attachments is free of viruses.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Arrangement of VACUUM, INTEGRITY_CHECK and OPTIMIZE

2019-01-09 Thread Simon Slavin
On 9 Jan 2019, at 2:01pm, spamh...@bluewin.ch wrote:

> In which order should VACUUM, INTEGRITY_CHECK and OPTIMIZE be executed?

If you are in any situation where INTEGRITY_CHECK should be run, do not make 
any changes to the database (e.g. ANALYZE) first.  Those changes might 
overwrite parts of the file that may show that the database was corrupt.

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


Re: [sqlite] Feedback on article about SQLITE_BUSY

2019-01-09 Thread Simon Slavin
On 8 Jan 2019, at 3:48pm, Rahul Jayaraman  wrote:

> https://www.activesphere.com/blog/2018/12/24/understanding-sqlite-busy
> 
> I’d appreciate feedback on the article.

I read your article, though I did not go through all the logic and check that 
it is correct.  I like your choice of sections, and found your diagrams to be 
clear.  I have three points:

First, you include in your article several direct quotes from the SQLite 
documentation.  It is an error to include these without labelling them as such. 
 I see that in one case you write "From its documentation".  Including "From 
SQLite's documentation" each time you quote from it would correct this problem.

Second, there are a few places where you have used just the acronym "WAL" where 
I would have expected you to put "WAL mode", to remind the reader that SQLite 
has another mode and they need to explicitly set WAL mode if they want it.

My third point would be relating to setting a timeout.  You mention setting a 
busy timeout late in the article, and as part of the deadlocks section, and 
your text jumps straight to the most complicated way of doing it: supplying 
your own busy handler.  This misses a more important and easier aspect.

Your article is a good overview of the subject, written for those who have 
studied computer science.  But it would be far more useful to programmers who 
have just encountered SQLITE_BUSY if near the beginning you mention one or both 
of




which sets a timeout time, and tells SQLite to use its own timeout handler, 
rather than the programmer having to supply one.  Setting this to a few 
thousand milliseconds, means that most SQLite programmers never see a result of 
SQLITE_BUSY, without supplying a busy-handler routine, and without including 
complicated and difficult-to-debug retry-loops in their code.  It covers all 
busy situations, not just deadlock, and I feel that it's important to any 
discussion of SQLITE_BUSY.

Hope this helps.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Bug report: Data race in pcache1.c

2019-01-09 Thread Richard Hipp
Check-in https://www.sqlite.org/src/info/383437be276719ac will perhaps
silence the harmless false-positives reported by TSAN.  Please let us
know if it does not solve the problem for you.

On 1/7/19, Jan Krčál  wrote:
> Hi,
>
> as a Chrome developer, I've run into a data race flagged by ThreadSanitizer
> in pcache1.c:
>
> When two threads write to in-memory sqlite DBs (each to its own separate
> DB), each thread has its own PCache1 with bPurgeable being false. Thus, in
> both threads, pCache->pnPurgeable points to the static
> variable dummyCurrentPage.
>
> Even if bPurgeable is false, pCache->pnPurgeable gets incremented by
> pcache1AllocPage()  and decremented by pcache1FreePage(). When each pCache
> belongs to a different pGroup, the writes can happen concurrently on those
> two threads and are not protected by any mutex. This results in a data race
> that makes ThreadSanitizer unhappy.
>
> These writes are not needed in the first place because the value of
> pCache->pnPurgeable is never read if bPurgeable is false. Because the value
> is never read, I can hardly imagine a situation this data race could lead
> to a real problem. Still, it is technically a data race with undefined
> behavior. Most importantly, I'd like ThreadSanitizer be happy with this
> code in this context.
>
> This is the first time I look into sqlite source code, does the text above
> make sense to you? :)
> If so, the fix should be pretty simple. Can you please look into this or
> should I provide a patch?
>
> Best regards,
> Jan
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>


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


Re: [sqlite] Arrangement of VACUUM, INTEGRITY_CHECK and OPTIMIZE

2019-01-09 Thread Richard Hipp
On 1/9/19, spamh...@bluewin.ch  wrote:
> In which order should VACUUM, INTEGRITY_CHECK and OPTIMIZE be executed?

I suppose that depends on what you are trying to accomplish?  Why do
you execute them at all?

I suppose INTEGRITY_CHECK should be run with first opening the
database file, to ensure that what you are opening really is a valid
SQLite database.  Maybe also run this after some other process that
you do not trust writes to the file.

Run VACUUM after deleting a lot of content.  Maybe also run this after
extensive changes when you want to optimize future access.

The OPTIMIZE pragma uses information saved from prior queries run on
the same database connection to try to determine whether or not
ANALYZE should be run.  If OPTIMIZE thinks ANALYZE should be run, it
runs it for you automatically.  Usually ANALYZE is not necessary and
OPTIMIZE is a no-op, however.  As OPTIMIZE uses statistics gathered
from execution of prior queries on the same database connection, it is
pointless to run it until later in the lifecycle of the database
connection.
-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Arrangement of VACUUM, INTEGRITY_CHECK and OPTIMIZE

2019-01-09 Thread Keith Medcalf
>For the OPTIMIZE the documentation states: "... run just before
>closing each database connection ...". There isn't a reason to do it
>instead after opening a connection each time?

The documentation tells you under what circumstances PRAGMA OPTIMIZE does 
anything, in the current implementation.  It will  ONLY do anything if ALL THE 
FOLLOWING CONDITIONS ARE TRUE:

1) MASK bit 0x02 is set. 
2) The query planner used sqlite_stat1-style statistics for one or more indexes 
of the table at some point during the lifetime of the current connection. 
3) One or more indexes of the table are currently unanalyzed or the number of 
rows in the table has increased by 25 times or more since the last time ANALYZE 
was run. 

Since bullet 2 is ALWAYS FALSE when opening a connection, PRAGMA OPTIMIZE will 
never do anything when run immediately after opening a new connection (in the 
current implementation).  

You have to actually DO SOMETHING for PRAGMA OPTIMIZE to have any effect.  That 
is why you run it AFTER you have done something with the connection, right 
before you close it ... (or, if you keep the connection open for a long time -- 
long being defined as seconds / minutes / hours / weeks / months / years / 
decades / centuries / millenia / aeons -- you may want to run it "periodically" 
... "periodically" being defined as every 1 or more seconds / minutes / hours / 
days / weeks / months / years / decades / centuries / millenia / aeons).

https://sqlite.org/pragma.html#pragma_optimize

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.



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


[sqlite] Arrangement of VACUUM, INTEGRITY_CHECK and OPTIMIZE

2019-01-09 Thread spamh...@bluewin.ch
Hello all
As I was not able to find the information I have to ask here. Maybe it is 
trivial.
In which order should VACUUM, INTEGRITY_CHECK and OPTIMIZE be executed? I have 
been using this one so far but I am not sure about the latter two.
For the OPTIMIZE the documentation states: "... run just before closing each 
database connection ...". There isn't a reason to do it instead after opening a 
connection each time?
Thanks in advance for any feedback.
Cheers, Mischl
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Feedback on article about SQLITE_BUSY

2019-01-09 Thread Rahul Jayaraman
I wrote an article about my high-level understanding of `SQLITE_BUSY` errors, 
hoping it might help others understand concurrency in SQLite better. It covers 
scenarios under which the error shows up, while SQLite tries to respect its 
isolation guarantee.

https://www.activesphere.com/blog/2018/12/24/understanding-sqlite-busy

I’d appreciate feedback on the article. Apologies if this is the wrong place to 
post such content.

Thanks,
Rahul
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Bug report: Data race in pcache1.c

2019-01-09 Thread Jan Krčál
Hi,

as a Chrome developer, I've run into a data race flagged by ThreadSanitizer
in pcache1.c:

When two threads write to in-memory sqlite DBs (each to its own separate
DB), each thread has its own PCache1 with bPurgeable being false. Thus, in
both threads, pCache->pnPurgeable points to the static
variable dummyCurrentPage.

Even if bPurgeable is false, pCache->pnPurgeable gets incremented by
pcache1AllocPage()  and decremented by pcache1FreePage(). When each pCache
belongs to a different pGroup, the writes can happen concurrently on those
two threads and are not protected by any mutex. This results in a data race
that makes ThreadSanitizer unhappy.

These writes are not needed in the first place because the value of
pCache->pnPurgeable is never read if bPurgeable is false. Because the value
is never read, I can hardly imagine a situation this data race could lead
to a real problem. Still, it is technically a data race with undefined
behavior. Most importantly, I'd like ThreadSanitizer be happy with this
code in this context.

This is the first time I look into sqlite source code, does the text above
make sense to you? :)
If so, the fix should be pretty simple. Can you please look into this or
should I provide a patch?

Best regards,
Jan
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users