Re: [sqlite] Crash in sqlite3_mutex_try [Was: SQLite 3.8.6 beta]

2014-08-11 Thread Klaas V


 Jan wrote: " ** can manually set this value to 1 to emulate Win98 behavior.
*/"

Can anyone give me one good reason apart from nostalgia to support a MS system 
not supported by MS?


Kind regards | Cordiali saluti | Vriendelijke groeten | Freundliche Grüsse,
Klaas `Z4us` V  - OrcID -0001-7190-2544
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Need help on SQLite In-Memory Mode

2014-08-11 Thread Kevin Benson
On Mon, Aug 11, 2014 at 9:19 PM, Nick Bao  wrote:

> Thanks, Joe!
>
> But it did not work for me.
>
> Still got the error:
> System.ArgumentException: Invalid ConnectionString format for parameter
> "FullUri"
>
>
>
Are you using System.Data.SQLite version > *1.0.81.0 ?*

--
   --
  --
 --Ô¿Ô--
K e V i N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] UEFA EURO 2012 Football Championship problem - SOLVED!!

2014-08-11 Thread Errol Emden
Keith...you are the man!!! Thanks for showing me a better way to solve my 
problem. I honestly did not think of using correlated subqueries, mainly 
because I was unsure of the underlying operations when they are used. But your 
mentoring explanation has made it quite clear now. I hope to be as good as you 
are...one day :-).

Be well.

> Subject: RE:  UEFA EURO 2012 Football Championship problem
> Date: Mon, 11 Aug 2014 17:47:30 -0600
> From: kmedc...@dessus.com
> To: eem...@hotmail.com
> CC: sqlite-users@sqlite.org
> 
> How about
> 
>   select mdate,
>  team1,
>  (select count(*)
> from goal
>where matchid = game.id 
>  and teamid = game.team1) as score1,
>  team2,
>  (select count(*) 
> from goal
>where matchid = game.id 
>  and teamid = game.team2) as score2
> from game
> order by mdate, id, team1, team2;
> 
> the parts "(select ...) as scoreX" are called Correlated Subqueries.  
> Basically, you are retrieving your game table and columns that you want from 
> it.  For each returned row each Subquery is executed to return the result 
> computed for the value(s) contained in that row.  A Correlated Subquery may 
> only return a single scalar result (ie, only one row containing one value).  
> If a subquery returns multiple rows, only the first value is used (that is, 
> it is as if the Correlated Subqueries had "limit 1" appended to them).  
> Selecting multiple values in a correlated subquery is a syntax error.
> 

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


Re: [sqlite] Need help on SQLite In-Memory Mode

2014-08-11 Thread Nick Bao
Thanks, Joe!

But it did not work for me.

Still got the error:
System.ArgumentException: Invalid ConnectionString format for parameter 
"FullUri"


Nick Bao
DL_DEV_4/DL_DEV_19, VP, Dalian Office - AvePoint, Inc.
P: +86.411.8473.6866 | F: 159.0496.1680 | nick@avepoint.com
Follow us on Facebook, Twitter and LinkedIn!
  



-Original Message-
From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] 
On Behalf Of Joe Mistachkin
Sent: Saturday, August 09, 2014 9:54 AM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Need help on SQLite In-Memory Mode


Try this:

SQLiteConnection connection = new SQLiteConnection(
"FullUri=file::memory:?cache=shared;"); 

--
Joe Mistachkin

___
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] UEFA EURO 2012 Football Championship problem

2014-08-11 Thread Keith Medcalf
How about

  select mdate,
 team1,
 (select count(*)
from goal
   where matchid = game.id 
 and teamid = game.team1) as score1,
 team2,
 (select count(*) 
from goal
   where matchid = game.id 
 and teamid = game.team2) as score2
from game
order by mdate, id, team1, team2;

the parts "(select ...) as scoreX" are called Correlated Subqueries.  
Basically, you are retrieving your game table and columns that you want from 
it.  For each returned row each Subquery is executed to return the result 
computed for the value(s) contained in that row.  A Correlated Subquery may 
only return a single scalar result (ie, only one row containing one value).  If 
a subquery returns multiple rows, only the first value is used (that is, it is 
as if the Correlated Subqueries had "limit 1" appended to them).  Selecting 
multiple values in a correlated subquery is a syntax error.


>-Original Message-
>From: Errol Emden [mailto:eem...@hotmail.com]
>Sent: Monday, 11 August, 2014 12:39
>To: Keith Medcalf
>Cc: General Discussion of SQLite Database
>Subject: RE: UEFA EURO 2012 Football Championship problem
>
>Hi Keith:
>I am trying to list every match with the goals scored by each team as
>shown.
>
>mdate  team1   score1  team2   score2
>1 July 2012ESP 4   ITA 0
>10 June 2012   ESP 1   ITA 1
>10 June 2012   IRL 1   CRO 3
>...
>
>The database schema is as follows:
>game(id,mdate,stadium,team1,team2); goal(matchid,teamid,player,gtime);
>eteam(id,teamname,coach). matchid=game.id; teamid=eteam.id; team1 and
>team2 are teamids'; gtime is time each goal is scored in a match.
>
>My problems in the SQL code below are:
>1. Matches in which neither team scored is not being displayed.
>2. Scores for the same matchid where both teams scored are appearing on
>separate lines instead of in a single line.
>What do I need to do to correct these issues?
>
>SELECT mdate,
>  team1,
>  CASE WHEN teamid=team1 THEN count(gtime) ELSE 0 END score1,
>team2,
>  CASE WHEN teamid=team2 THEN count(gtime) ELSE 0 END score2
>  FROM game JOIN goal ON matchid = id
>GROUP BY matchid, teamid
>ORDER BY mdate,matchid,team1,team2
>
>Thanks and be well.
>  Errol
>
>




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


Re: [sqlite] Cross-Platform ADO wrapper for iOS, Android and Win 8.1 WP 8.1?

2014-08-11 Thread J Decker
maybe ... http://www.unixodbc.org/


On Mon, Aug 11, 2014 at 10:47 AM, Ken Wenyon  wrote:

> Is there ADO Support for SQLite using Windows 8.1 and Windows Phone 8.1?
>  I am looking for a Cross-Platform ADO wrapper for iOS, Android and Win 8.1
> WP 8.1?
>
>
> Ken Wenyon
> ___
> 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] Cross-Platform ADO wrapper for iOS, Android and Win 8.1 WP 8.1?

2014-08-11 Thread Ken Wenyon
Is there ADO Support for SQLite using Windows 8.1 and Windows Phone 8.1?  I am 
looking for a Cross-Platform ADO wrapper for iOS, Android and Win 8.1 WP 8.1?


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


Re: [sqlite] Not SQLite related, but, SQLite Mailing List related

2014-08-11 Thread jose isaias cabrera

"Stephen Chrzanowski" wrote...


Ok, this IS NOT about SQLite itself in ANY regard, but specifically about
this particular mailing list and how GMail is handling itself.

When I joined this mailing list years ago, I put anything that goes 
through

here into its own label via the same means that I've got for other email I
regularly receive.  When I go through my PHP Classes emails, my regular in
box, etc, those "Newer" and "Older" buttons are enabled.  However, in THIS
mailing list, when I click on any email, I don't get the option to go to
OLDER messages, but I do get to go to NEWER messages.  That OLDER button
doesn't activate when I go to a NEWER message when hitting the NEWER
button, but this functionality seemingly works everywhere else (I admit I
didn't try EVERY label)

Anyone have an idea why?


Can you try another browser, if you are using a browser, to see if it 
display correctly in another browser? 


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


Re: [sqlite] UEFA EURO 2012 Football Championship problem

2014-08-11 Thread Petite Abeille

On Aug 11, 2014, at 8:39 PM, Errol Emden  wrote:

> 1. Matches in which neither team scored is not being displayed.

Because you have an inner join to goal. If there no goal, then no entry will 
match.

> 2. Scores for the same matchid where both teams scored are appearing on 
> separate lines instead of in a single line.

Because you have a join to goal, which has a granularity of one entry per goal, 
per match. So, if multiple goal, multiple entries. You try to compensate by 
grouping per match and team, so you end up with two entries if both team have 
scored.

> What do I need to do to correct these issues?

Get you granularity in order.

selectgame.mdate,
  game.matchid,
  game.team1,
  ( select count( * ) from goal where goal.matchid = game.id and 
goal.teamid = game.team1 ) as score1,
  game.team2,
  ( select count( * ) from goal where goal.matchid = game.id and 
goal.teamid = game.team2 ) as score2
from  game

order by  game.mdate,
  game.matchid

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


Re: [sqlite] Not SQLite related, but, SQLite Mailing List related

2014-08-11 Thread Luuk

On 11-8-2014 19:19, Stephen Chrzanowski wrote:

Ok, this IS NOT about SQLite itself in ANY regard, but specifically about
this particular mailing list and how GMail is handling itself.

When I joined this mailing list years ago, I put anything that goes through
here into its own label via the same means that I've got for other email I
regularly receive.  When I go through my PHP Classes emails, my regular in
box, etc, those "Newer" and "Older" buttons are enabled.  However, in THIS
mailing list, when I click on any email, I don't get the option to go to
OLDER messages, but I do get to go to NEWER messages.  That OLDER button
doesn't activate when I go to a NEWER message when hitting the NEWER
button, but this functionality seemingly works everywhere else (I admit I
didn't try EVERY label)

Anyone have an idea why?


It seems like some index on your 'label' is broken...

You have 2 posibility's (as far as i see):
1) contact Gmail ;)

2) put a new label on every mail that currently has 'SQLite', remove the 
old label, and see if thing start working ok (eventually you can rename 
the newLabel to SQLite again)




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


Re: [sqlite] Not SQLite related, but, SQLite Mailing List related

2014-08-11 Thread RSmith


On 2014/08/11 19:19, Stephen Chrzanowski wrote:

Ok, this IS NOT about SQLite itself in ANY regard, but specifically about
this particular mailing list and how GMail is handling itself.

When I joined this mailing list years ago, I put anything that goes through
here into its own label via the same means that I've got for other email I
regularly receive.  When I go through my PHP Classes emails, my regular in
box, etc, those "Newer" and "Older" buttons are enabled.  However, in THIS
mailing list, when I click on any email, I don't get the option to go to
OLDER messages, but I do get to go to NEWER messages.  That OLDER button
doesn't activate when I go to a NEWER message when hitting the NEWER
button, but this functionality seemingly works everywhere else (I admit I
didn't try EVERY label)

Anyone have an idea why?


Goverment Conspiracy.

THEY Know



Might be a G-mail setting, mine works fine, but it always have, so no idea what to look for other than to say it should work under 
the right circumstances. I'm hoping someone else here already battled with the same issue and won.


Actually, mine gets into gmail via an IMAP server (as per my email address) and isn't a native gmail address, so might not be 
comparable...



(Disclaimer: I realize now that this response contains not one single bit of helpful information, but hopefully eliminates one of 
the myriad questions)


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


Re: [sqlite] UEFA EURO 2012 Football Championship problem

2014-08-11 Thread Errol Emden



Hi Keith:
I am trying to list every match with the goals scored by each team as shown.
mdateteam1score1team2score2
1 July 2012ESP4ITA 0
10 June 2012ESP1ITA1
10 June 2012IRL1CRO3
...
The database schema is as follows:
game(id,mdate,stadium,team1,team2); goal(matchid,teamid,player,gtime); 
eteam(id,teamname,coach). matchid=game.id; teamid=eteam.id; team1 and team2 are 
teamids'; gtime is time each goal is scored in a match.

My problems in the SQL code below are:
1. Matches in which neither team scored is not being displayed.
2. Scores for the same matchid where both teams scored are appearing on 
separate lines instead of in a single line.
What do I need to do to correct these issues?

SELECT mdate,
  team1,
  CASE WHEN teamid=team1 THEN count(gtime) ELSE 0 END score1,
team2,
  CASE WHEN teamid=team2 THEN count(gtime) ELSE 0 END score2
  FROM game JOIN goal ON matchid = id
GROUP BY matchid, teamid
ORDER BY mdate,matchid,team1,team2

Thanks and be well.
  Errol


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


Re: [sqlite] CREATE INDEX Placement

2014-08-11 Thread Simon Slavin

On 11 Aug 2014, at 5:19pm, Drago, William @ MWG - NARDAEAST 
 wrote:

> Does it matter if I group all of my CREATE INDEX statements at the end of my 
> .sql file or should they appear right after each CREATE TABLE statement? Does 
> SQLITE care one way or another?

The results are identical.  But if you have lots of INSERTs in the same .sql 
file, it's faster to insert the data first and then create the indexes.  And 
don't forget to put your INSERTs inside transactions.

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


[sqlite] Not SQLite related, but, SQLite Mailing List related

2014-08-11 Thread Stephen Chrzanowski
Ok, this IS NOT about SQLite itself in ANY regard, but specifically about
this particular mailing list and how GMail is handling itself.

When I joined this mailing list years ago, I put anything that goes through
here into its own label via the same means that I've got for other email I
regularly receive.  When I go through my PHP Classes emails, my regular in
box, etc, those "Newer" and "Older" buttons are enabled.  However, in THIS
mailing list, when I click on any email, I don't get the option to go to
OLDER messages, but I do get to go to NEWER messages.  That OLDER button
doesn't activate when I go to a NEWER message when hitting the NEWER
button, but this functionality seemingly works everywhere else (I admit I
didn't try EVERY label)

Anyone have an idea why?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] CREATE INDEX Placement

2014-08-11 Thread Richard Hipp
On Mon, Aug 11, 2014 at 12:19 PM, Drago, William @ MWG - NARDAEAST <
william.dr...@l-3com.com> wrote:

> All,
>
> Does it matter if I group all of my CREATE INDEX statements at the end of
> my .sql file or should they appear right after each CREATE TABLE statement?
> Does SQLITE care one way or another?
>

It doesn't really matter.
-- 
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] CREATE INDEX Placement

2014-08-11 Thread Drago, William @ MWG - NARDAEAST
All,

Does it matter if I group all of my CREATE INDEX statements at the end of my 
.sql file or should they appear right after each CREATE TABLE statement? Does 
SQLITE care one way or another?

Thanks,
--
Bill Drago
Senior Engineer

L3 Communications / Narda Microwave East
435 Moreland Road
Hauppauge, NY 11788
631-272-5947 / william.dr...@l-3com.com

CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any 
attachments are solely for the use of the addressee and may contain information 
that is privileged or confidential. Any disclosure, use or distribution of the 
information contained herein is prohibited. In the event this e-mail contains 
technical data within the definition of the International Traffic in Arms 
Regulations or Export Administration Regulations, it is subject to the export 
control laws of the U.S.Government. The recipient should check this e-mail and 
any attachments for the presence of viruses as L-3 does not accept any 
liability associated with the transmission of this e-mail. If you have received 
this communication in error, please notify the sender by reply e-mail and 
immediately delete this message and any attachments.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Crash in sqlite3_mutex_try [Was: SQLite 3.8.6 beta]

2014-08-11 Thread Jan Nijtmans
2014-08-08 23:34 GMT+02:00 Richard Hipp>:
> Please continue to test the latest snapshots and report any issues you find.

I already reported this to sqlite-dev, but without test-case exposing the
problem. Here is the test-case, which is 100% reproducable.
And below is a minimal patch which fixes this problem.

=== main.c 
#include 
int main(){
sqlite3_mutex *mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_RECURSIVE);
int rc = sqlite3_mutex_try(mutex);
if( rc == SQLITE_OK) sqlite3_mutex_leave(mutex);
}
==

Compile this using any Windows compiler (MSVC, MinGW, MinGW-w64)
with the following options.e.g.:

i686-w64-mingw32-gcc -o bug.exe -DNTDDI_VERSION=NTDDI_WINBLUE
-D_WIN32_WINNT=0x0400 -DSQLITE_THREADSAFE=1 main.c sqlite3.c

Then simply run "bug.exe", it will crash immediately in the function
sqlite3_win32_is_nt(), because osGetVersionExW is a NULL pointer.

Regards,
Jan Nijtmans

-- Forwarded message --
From: Jan Nijtmans 
Date: 2014-08-05 13:24 GMT+02:00
Subject: Re: SQLite trunk on win32 broken with -DSQLITE_WIN32_NO_ANSI
To: sqlite-dev 


2014-08-03 9:37 GMT+02:00 Jan Nijtmans :
> Fixed here:
>   
>
> Thanks!

Actually, just discovered that it is still not fixed for
all cases: When SQLITE_WIN32_GETVERSIONEX
is equal to 0 (later MS SDK's), then any call to
sqlite3_win32_is_nt() will crash because the
function osGetVersionExW() is a null pointer ;-(

Suggested patch (current SQLite trunk) below.

Regards,
Jan Nijtmans

Index: src/os_win.c
==
--- src/os_win.c
+++ src/os_win.c
@@ -413,11 +413,11 @@
 ** In order to facilitate testing on a WinNT system, the test fixture
 ** can manually set this value to 1 to emulate Win98 behavior.
 */
 #ifdef SQLITE_TEST
 LONG volatile sqlite3_os_type = 0;
-#else
+#elif SQLITE_WIN32_GETVERSIONEX
 static LONG volatile sqlite3_os_type = 0;
 #endif

 #ifndef SYSCALL
 #  define SYSCALL sqlite3_syscall_ptr
@@ -1308,10 +1308,11 @@
 /*
 ** This function determines if the machine is running a version of Windows
 ** based on the NT kernel.
 */
 int sqlite3_win32_is_nt(void){
+#if SQLITE_WIN32_GETVERSIONEX
   if( osInterlockedCompareExchange(&sqlite3_os_type, 0, 0)==0 ){
 #if defined(NTDDI_VERSION) && NTDDI_VERSION >= NTDDI_WIN8
 OSVERSIONINFOW sInfo;
 sInfo.dwOSVersionInfoSize = sizeof(sInfo);
 osGetVersionExW(&sInfo);
@@ -1322,10 +1323,13 @@
 #endif
 osInterlockedCompareExchange(&sqlite3_os_type,
 (sInfo.dwPlatformId == VER_PLATFORM_WIN32_NT) ? 2 : 1, 0);
   }
   return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2;
+#else
+  return 1;
+#endif
 }

 #ifdef SQLITE_WIN32_MALLOC
 /*
 ** Allocate nBytes of memory.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users