Re: [sqlite] how to get SQLite 4 source?

2012-06-29 Thread E. Timothy Uy
Hi Darren,

1. Install Fossil - http://www.fossil-scm.org.
2. At a command prompt or console, 'fossil clone
http://www.sqlite.org/src4sqlite4.fossil'.
3. (Not sure if this the "right" way) From here I usually 'mkdir
sqlite4_src', 'cd sqlite_src', then 'fossil open ../sqlite4.fossil'

Respectfully,
Tim




On Fri, Jun 29, 2012 at 9:50 PM, Darren Duncan wrote:

> Forgive me if I seem dense, but from http://www.sqlite.org/src4/**
> doc/trunk/www/index.wikiand
>  elsewhere on
> sqlite.org, though I can see individual source files, I don't see any
> place to get the whole SQLite 4 source at once, either as a tarball or
> version control instructions. So where do we go to actually download and
> play with it? -- Darren Duncan
> __**_
> 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] how to get SQLite 4 source?

2012-06-29 Thread Darren Duncan
Forgive me if I seem dense, but from 
http://www.sqlite.org/src4/doc/trunk/www/index.wiki and elsewhere on sqlite.org, 
though I can see individual source files, I don't see any place to get the whole 
SQLite 4 source at once, either as a tarball or version control instructions. 
So where do we go to actually download and play with it? -- Darren Duncan

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Kees Nuyt
On Sat, 30 Jun 2012 00:54:44 +1000, Dennis Volodomanov
 wrote:

>On 30/06/2012 12:19 AM, Black, Michael (IS) wrote:
>>
>> It persists across a reboot?
>>
>> You can create a database, delete it, reboot, and your app will still 
>> see the original table?
>>
>> All I can say is wow...your system is really hosed.
>>
>> Even anti-virus shouldn't cause that.  This would infer some sort of 
>> caching that is semi-permanent.
>>
>> Have you got a 2nd computer you can test this on?
>>
>> Would you be willing to share your app so others can check this?  As 
>> "House" used to say..."interesting".
>>
>>
>
>Not only my app, the sqlite shell will see it too. Regarding my second 
>message - I was talking about this same screwed-up folder, so yes, I can 
>create a new db in a new folder and it's fine. It's only when I try 
>anything in this folder that things go amok (at least it's localized to 
>this folder so far).
>
>I'll do testing on another machine and I'll do a full chkdsk here as 
>well tomorrow.
>
>Most likely - it is my box that's causing this. Unless SQLite does any 
>sort of real low-level disk access, bypassing standard OS, then it's 
>unlikely that it somehow caused this to happen, but it would be good to 
>rule this out somehow.
>
>I can share the app (not the source of course), sure, but I don't know 
>if that'll help in any way?


Is the database file in a protected folder (that is, "\Program Files",
or somewhere in the Windows system software tree) ?

It shouldn't be. Data belongs somewhere else. Either in your
userprofile/appdata or in a completely separate dirtree that Microsoft
doesn't try to manage.

HTH

-- 
Regards,

Kees Nuyt

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


Re: [sqlite] SQLITE 64bit Application Support?

2012-06-29 Thread Pam Li




Thanks very much, Stephen and Roger, for your time and help.
 
pam
 
> Date: Fri, 29 Jun 2012 17:31:21 -0700
> From: rog...@rogerbinns.com
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] SQLITE 64bit Application Support?
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On 29/06/12 16:56, Pam Li wrote:
> > Question:Should we continue building it as a 32 bit library, and link
> > it with 64 bit product
> 
> It is virtually impossible to link a 32 bit library into a 64 bit product.
>  As an example a 64 bit pointer can't be passed to 32 bit code since it
> won't fit.
> 
> SQLite works just fine in 32 or 64 bits.  And either endian.  And on lower
> end platforms.  And on stonking big machines.  Here is the reason why:
> 
>   http://www.sqlite.org/testing.html
> 
> That page doesn't mention the different hardware SQLite is tested on, but
> it is quite a variety and takes a long time.
> 
> Roger
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
> 
> iEYEARECAAYFAk/uSNkACgkQmOOfHg372QTYTgCcDzZEPE1wdZm4DBbbQmqeyH4D
> 2YoAnAtsCH9Eh3qdRJHk6iKUQS7sKl7E
> =Vtwi
> -END PGP SIGNATURE-
> ___
> 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] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

On 30/06/2012 10:32 AM, Donald Griggs wrote:

Regarding:


Could it be that the .ext is used by the OS or other apps with some
caching  scheme?


Well, this symptom is so amazingly strange, it undeniably belongs in the
   Ext Files.

(To those outside the U.S -- this is just a joke on
http://en.wikipedia.org/wiki/The_X-Files
)



The real extension I use is ".krr", so it's unique, as far as I know, 
but thanks for the thought! And yes, I wouldn't be surprised if Moulder 
showed up at the door :)


I ran a full disk check (/f /v /r /x), but the issue is still there.

I'm out of ideas at this point and to continue development I'll need to 
hard-code a different path into the app, so that this bogus file is not 
read, but I'd really like to get to the bottom of this.


Imagine this happening on a client/user's machine...

   Dennis

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


[sqlite] System.Data.Sqlite extension function - performing INSERT

2012-06-29 Thread Brad Hards
Hi,

I'm trying to provide a not-really-spatialite toolset for C# users (since they 
often seem to have trouble with spatialite / extension loading).

No problem with SELECT from an existing database / table. However I'd like to 
provide the capability to perform an INSERT of a newly created geometry into 
an existing spatialite geometry column. I can do that if there isn't an index.

If there is an index, then the insertion will invoke triggers to update the 
RTree index table. Those triggers use two SQL functions that are provided by 
libspatialite - GeometryConstraints() and RTreeAlign(). I don't have 
libspatialite in this example, so I need to provide those functions myself.

GeometryConstraints() is no problem.

RTreeAlign is OK up to the point where I need to actually update the index 
table. Now I'm stuck because I don't have access to the connection.

http://system.data.sqlite.org/index.html/annotate?checkin=2849c1b71384d52d&filename=System.Data.SQLite/SQLiteFunction.cs
 
indicates that this is intentional:
ec237b0123 2005-03-01 rmsimpson:   /// Although there is one instance of a 
class derived from SQLiteFunction per database connection, the derived class 
has no access
ec237b0123 2005-03-01 rmsimpson:   /// to the underlying connection.  This 
is necessary to deter implementers from thinking it would be a good idea to 
make database
ec237b0123 2005-03-01 rmsimpson:   /// calls during processing.

I can read that two ways:
1. Most implementers aren't smart enough to get that right (probably true in 
my case).
2. No-one is smart enough to get that right - its a "Here Be Dragons" place.

However, I still need to do it (or toss the code onto the "nice idea at the 
time" scrapheap).

Is there a workaround to get at the underlying connection from my extension 
function class?

Is there anything to be aware of in implementing a "SQLiteFunction2" that does 
allow access to the underlying connection?

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Donald Griggs
Regarding:

> Could it be that the .ext is used by the OS or other apps with some
> caching  scheme?


Well, this symptom is so amazingly strange, it undeniably belongs in the
  Ext Files.

(To those outside the U.S -- this is just a joke on
http://en.wikipedia.org/wiki/The_X-Files
)

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


Re: [sqlite] SQLITE 64bit Application Support?

2012-06-29 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 29/06/12 16:56, Pam Li wrote:
> Question:Should we continue building it as a 32 bit library, and link
> it with 64 bit product

It is virtually impossible to link a 32 bit library into a 64 bit product.
 As an example a 64 bit pointer can't be passed to 32 bit code since it
won't fit.

SQLite works just fine in 32 or 64 bits.  And either endian.  And on lower
end platforms.  And on stonking big machines.  Here is the reason why:

  http://www.sqlite.org/testing.html

That page doesn't mention the different hardware SQLite is tested on, but
it is quite a variety and takes a long time.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk/uSNkACgkQmOOfHg372QTYTgCcDzZEPE1wdZm4DBbbQmqeyH4D
2YoAnAtsCH9Eh3qdRJHk6iKUQS7sKl7E
=Vtwi
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Mohd Radzi Ibrahim
Could it be that the .ext is used by the OS or other apps with some caching
scheme? Try different extension...
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov
Never heard about tunnelling before this, but I tried to turn it off and 
it has no effect. I've also (numerously) deleted the whole folder and 
created it from scratch and I'd still get that contents. Interestingly, 
I now keep getting a different contents than before - it's now from the 
last attempt of running my app where I stopped it mid-way through debugging.


I suspect that Windows' FS is got a screw lose at this point. Hopefully 
a disk check will uncover this.


My suspicion is that I was debugging and stopped the app. Then I likely 
deleted the DB, as I do that often, but perhaps at this point the wal 
journal or the main db itself got corrupted in the file system table. 
And perhaps now when I try to create this DB in this folder, the OS is 
pulling out this old journal (or the main db) instead of the new one. I 
know it doesn't sound very plausible, but it's the best guess I've got 
at the moment :) I mean, to have executed "sqlite3 mydb.ext" and not see 
"mydb.ext" appear in a folder, but to actually have contents coming from 
a .dump, is certainly the OS doing something?


   Dennis

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


Re: [sqlite] SQLITE 64bit Application Support?

2012-06-29 Thread Stephan Beal
On Sat, Jun 30, 2012 at 1:56 AM, Pam Li  wrote:

> Hello, We use SQLite C/C++ API interface.  We are in the process of
> migrating our product (a C/C++ application) from 32 bit to 64 bit.  We
> build our own SQLite library with SQLite source code.   Question:Should we
> continue building it as a 32 bit library, and link it with 64 bit product,
> or we can build it as a 64 bit library (Windows, Linux and Solartis)?
>

It works just fine built in 64-bit mode.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLITE 64bit Application Support?

2012-06-29 Thread Pam Li




Hello, We use SQLite C/C++ API interface.  We are in the process of migrating 
our product (a C/C++ application) from 32 bit to 64 bit.  We build our own 
SQLite library with SQLite source code.   Question:Should we continue building 
it as a 32 bit library, and link it with 64 bit product, or we can build it as 
a 64 bit library (Windows, Linux and Solartis)?  Thanks a lot,pam   
   
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Nico Williams
OK, I give :)
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Richard Hipp
On Fri, Jun 29, 2012 at 6:40 PM, Nico Williams wrote:

> On Fri, Jun 29, 2012 at 5:24 PM, Richard Hipp  wrote:
> > varint+value does not sort BLOBs in lexicographical order.
> >
> > Not having a distinct terminator for the BLOB means that two BLOBs where
> > one is a prefix of the other might not compare correctly.
>
> Would 31-bit encoding help?
>

Maybe.

But you know:  How often do people use BLOBs as keys?  What other SQL
engines other than SQLite even allow BLOBs as keys?  Are we trying to
optimize something that is never actually used?

Note that the data
encodingfor
BLOBs (used in the overwhelmingly common case of when the BLOB is not
the key) does have a simple size+content format.


> ___
> 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] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Nico Williams
On Fri, Jun 29, 2012 at 5:24 PM, Richard Hipp  wrote:
> varint+value does not sort BLOBs in lexicographical order.
>
> Not having a distinct terminator for the BLOB means that two BLOBs where
> one is a prefix of the other might not compare correctly.

Would 31-bit encoding help?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Richard Hipp
On Fri, Jun 29, 2012 at 6:09 PM, Nico Williams wrote:

> On Fri, Jun 29, 2012 at 4:39 PM, Cory Nelson  wrote:
> > On Fri, Jun 29, 2012 at 2:48 PM, Richard Hipp  wrote:
> > What is the rationale for the 7-bit BINARY encoding? The performance
> impact
> > will surely outweigh any convenience of being able to treat blobs as
> > 0-terminated strings.
>
> I tend to agree.  Varint length + value should be faster,


varint+value does not sort BLOBs in lexicographical order.

Not having a distinct terminator for the BLOB means that two BLOBs where
one is a prefix of the other might not compare correctly.




> though this
> just needs to be measured, and it's likely that the 7-bit approach
> will be faster for very short blobs.  Another possibility would be to
> use 31-bit encoding ;)  or escape zero-bytes, and so on.
>
> Nico
> --
> ___
> 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] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Nico Williams
On Fri, Jun 29, 2012 at 4:39 PM, Cory Nelson  wrote:
> On Fri, Jun 29, 2012 at 2:48 PM, Richard Hipp  wrote:
> What is the rationale for the 7-bit BINARY encoding? The performance impact
> will surely outweigh any convenience of being able to treat blobs as
> 0-terminated strings.

I tend to agree.  Varint length + value should be faster, though this
just needs to be measured, and it's likely that the 7-bit approach
will be faster for very short blobs.  Another possibility would be to
use 31-bit encoding ;)  or escape zero-bytes, and so on.

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


Re: [sqlite] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Cory Nelson
On Fri, Jun 29, 2012 at 2:48 PM, Richard Hipp  wrote:

> On Fri, Jun 29, 2012 at 3:40 PM, Nico Williams  >wrote:
>
> > So, if I understand section 3.2 of the SQLite4 design page then it
> > will often be the case that lookup keys will not be stored in an order
> > that will be useful for optimizing common ORDER BY expressions.  Is
> > this correct?
>
>
> Not correct.  The keys are encoded (see
> http://www.sqlite.org/src4/doc/trunk/www/key_encoding.wiki) in a way that
> causes a lexicographical ordering of the keys to correspond to what the
> user wants out of ORDER BY.  So indices can still be used for fulfilling
> ORDER BY.
>

What is the rationale for the 7-bit BINARY encoding? The performance impact
will surely outweigh any convenience of being able to treat blobs as
0-terminated strings.

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


Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Simon Slavin

On 29 Jun 2012, at 10:16pm, Simon Slavin  wrote:

>> Not likely.  I do Prepare, Bind, Step, Finalize using a wrapper function.
>> The database file was created only moments before.

I'm sorry.  I should have realised this was a FAQ:



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


Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Jay A. Kreibich
On Fri, Jun 29, 2012 at 05:27:25PM -0400, Jeff Archer scratched on the wall:
> >Pavel Ivanov paivanof at gmail.com Fri Jun 29 17:06:42 EDT 2012
> >
> >Because SQLite successfully re-prepared this statement behind the
> >scenes and thus was able to successfully finish sqlite3_step()
> >function.
> 
> What could cause it to "re-prepare" the statement?

  Usually a change in the database schema, including the creation or
  dropping of tables, indexes, etc.

> Is this something I need to find and fix?

  Generally, no.  The fact that _prepare_v2() deals with this condition
  automatically is generally considered to be a feature.

   -j

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Intelligence is like underwear: it is important that you have it,
 but showing it to the wrong people has the tendency to make them
 feel uncomfortable." -- Angela Johnson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Simon Slavin

On 29 Jun 2012, at 10:27pm, Jeff Archer  wrote:

>> Pavel Ivanov paivanof at gmail.com Fri Jun 29 17:06:42 EDT 2012
>> 
>> Because SQLite successfully re-prepared this statement behind the
>> scenes and thus was able to successfully finish sqlite3_step()
>> function.
> 
> What could cause it to "re-prepare" the statement?

Changing the schema of the database in any way.  For example, creating or 
deleting a table or index.

> Is this something I need to find and fix?


You should definitely know why it's doing it, in case it indicates your app is 
doing something unexpected.  But that error is a warning: SQLite noticed 
something was wrong, but fixed it for you.

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


[sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Jeff Archer
>Simon Slavin slavins at bigfraud.org Fri Jun 29 17:16:36 EDT 2012
>
>Do you do the _prepare() first, then make a change to the database schema
?  For instance
>
>Start of app
>Prepare the INSERT statement
>CREATE TABLE
>Bind the INSERT statement
>Step the INSERT statement

No.
Create Table

Then in a separate function
Prepare
Bind
Step
Finalize

Callback happens during call to sqlite3_step()
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Jeff Archer
>Pavel Ivanov paivanof at gmail.com Fri Jun 29 17:06:42 EDT 2012
>
>Because SQLite successfully re-prepared this statement behind the
>scenes and thus was able to successfully finish sqlite3_step()
>function.

What could cause it to "re-prepare" the statement?
Is this something I need to find and fix?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Simon Slavin

On 29 Jun 2012, at 9:55pm, Jeff Archer  wrote:

>> Kevin Benson kevin.m.benson at gmail.com Fri Jun 29 16:32:55 EDT 2012
>> 
>> The mention of SQLITE_SCHEMA error and sqlite3VdbeExec() sounds like maybe
>> you're fighting an expired statement???
> 
> Not likely.  I do Prepare, Bind, Step, Finalize using a wrapper function.
> The database file was created only moments before.

Do you do the _prepare() first, then make a change to the database schema ?  
For instance

Start of app
Prepare the INSERT statement
CREATE TABLE
Bind the INSERT statement
Step the INSERT statement

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


Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Pavel Ivanov
On Fri, Jun 29, 2012 at 4:55 PM, Jeff Archer  wrote:
>>Kevin Benson kevin.m.benson at gmail.com Fri Jun 29 16:32:55 EDT 2012
>>
>>The mention of SQLITE_SCHEMA error and sqlite3VdbeExec() sounds like maybe
>>you're fighting an expired statement???
>
> Not likely.  I do Prepare, Bind, Step, Finalize using a wrapper function.
> The database file was created only moments before.
>
> My biggest question is: Why after this error being indicate through the
> SQLITE_CONFIG_LOG callback would the sqlite3_step() succeeded?

Because SQLite successfully re-prepared this statement behind the
scenes and thus was able to successfully finish sqlite3_step()
function.


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


[sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Jeff Archer
>Kevin Benson kevin.m.benson at gmail.com Fri Jun 29 16:32:55 EDT 2012
>
>The mention of SQLITE_SCHEMA error and sqlite3VdbeExec() sounds like maybe
>you're fighting an expired statement???

Not likely.  I do Prepare, Bind, Step, Finalize using a wrapper function.
The database file was created only moments before.

My biggest question is: Why after this error being indicate through the
SQLITE_CONFIG_LOG callback would the sqlite3_step() succeeded?

Jeff Archer
Nanotronics Imaging
jsarc...@nanotronicsimaging.com
<330>819.4615
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Kevin Benson
On Fri, Jun 29, 2012 at 3:26 PM, Jeff Archer  wrote:

> I have been puzzling on this for a couple of days now and am at a loss.  I
> hate to let something like this go because it appears so much like an
> error, I feel like it will just bite me at a later time.
>
> Any suggestions would be greatly appreciated.
>
> In attempting to execute the following SQL: "INSERT INTO [Scans](ScanID,
> Timestamp, EndTime, Result) VALUES(NULL, @Timestamp, @Timestamp, @Result);"
>
> I get the following message through the SQLITE_CONFIG_LOG callback during
> the sqlite3_step():
> errcode: SQLITE_SCHEMA  (17)
> message: statement aborts at 80: [INSERT INTO [Scans](ScanID, Timestamp,
> EndTime, Result) VALUES(NULL, Timestamp, @Timestamp, @Result);] database
> schema has changed
>
> sqlite3_step() returns SQLITE_DONE (101) and the row being inserted does
> get inserted into the database.
>
> I have investigated this with a very small test app and have not seen the
> log message in this context.
>
> I have now instrumented my real applications with output of all SQL to a
> single log file but am not seeing anything in here that would suggest the
> schema is being changed.  (I'm not sure how to make this available since it
> can't be attached to this email)
>
> Unfortunately, I am on Windows and using the amalgamation (3.7.13) in
> VisualStudio so I am handicapped in terms of debugging down to the actual
> line within sqlite.  I only see one instance of this log message at line
> 72025 within sqlite3VdbeExec().
>

The mention of SQLITE_SCHEMA error and sqlite3VdbeExec() sounds like maybe
you're fighting an expired statement??? Maybe the virtual machine opcodes
will help:

http://www.sqlite.org/opcode.html

--
   --
  --
 --Ô¿Ô--
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] sqlite3_bind_int64() on Solaris 10?

2012-06-29 Thread Richard Hipp
On Fri, Jun 29, 2012 at 4:22 PM, Pam Li  wrote:

>
> Thanks for the qucik answer.  Looks like our compilers are different.  We
> use CC.  Which version of GCC do you use? Thanks again,pam
>

Tested with GCC 4.3.3.



>  > From: d...@sqlite.org
> > Date: Fri, 29 Jun 2012 15:51:35 -0400
> > To: sqlite-users@sqlite.org
> > Subject: Re: [sqlite] sqlite3_bind_int64() on Solaris 10?
> >
> > FWIW, every recent release of SQLite has been tested on SunOS 5.10
> (Sparc)
> > using GCC.  That doesn't really answer your question (I don't know the
> real
> > answer) but it does at least demonstrate that SQLite has been made to
> work
> > correctly on Sparc and on SunOS.
> >
> > On Fri, Jun 29, 2012 at 3:17 PM, Pam Li  wrote:
> >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > Hello,  We are using SQLITE 3.7.10 C/C++ interface API in our product.
> > >  This is the very first time we use it.   Our product runs on Windows,
> > > Linux and Solaris. We ran into a problem that a query on a 64 bit
> integer
> > > key is successful on both Windows and Linux, but not on Solaris 10.
> The
> > > code, database, and input data for the query are the same fro all
> > > platforms. Query: select * from  where MAC_ADDR in (?1, ?2.
> ?3); On
> > > Solaris, if the MAC_ADDRESS value is 4 byte or less, a query is
> successful.
> > >  If its value is 5-8 bytes, the query fails. API sequence we use for
> the
> > > query: ===sqlite3_prepare_v2()
> sqlite3_bind_int64()
> > > sqlite3_step() ... ===  Has anyone else had
> this
> > > issue?  Any clue is appreciated.  Best regards,pam
> > >
> > > ___
> > > 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-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] sqlite3_bind_int64() on Solaris 10?

2012-06-29 Thread Pam Li

Thanks for the qucik answer.  Looks like our compilers are different.  We use 
CC.  Which version of GCC do you use? Thanks again,pam
 > From: d...@sqlite.org
> Date: Fri, 29 Jun 2012 15:51:35 -0400
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] sqlite3_bind_int64() on Solaris 10?
> 
> FWIW, every recent release of SQLite has been tested on SunOS 5.10 (Sparc)
> using GCC.  That doesn't really answer your question (I don't know the real
> answer) but it does at least demonstrate that SQLite has been made to work
> correctly on Sparc and on SunOS.
> 
> On Fri, Jun 29, 2012 at 3:17 PM, Pam Li  wrote:
> 
> >
> >
> >
> >
> >
> >
> >
> > Hello,  We are using SQLITE 3.7.10 C/C++ interface API in our product.
> >  This is the very first time we use it.   Our product runs on Windows,
> > Linux and Solaris. We ran into a problem that a query on a 64 bit integer
> > key is successful on both Windows and Linux, but not on Solaris 10.   The
> > code, database, and input data for the query are the same fro all
> > platforms. Query: select * from  where MAC_ADDR in (?1, ?2. ?3); On
> > Solaris, if the MAC_ADDRESS value is 4 byte or less, a query is successful.
> >  If its value is 5-8 bytes, the query fails. API sequence we use for the
> > query: ===sqlite3_prepare_v2() sqlite3_bind_int64()
> > sqlite3_step() ... ===  Has anyone else had this
> > issue?  Any clue is appreciated.  Best regards,pam
> >
> > ___
> > 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Nico Williams
On Fri, Jun 29, 2012 at 2:48 PM, Richard Hipp  wrote:
> On Fri, Jun 29, 2012 at 3:40 PM, Nico Williams wrote:
>> So, if I understand section 3.2 of the SQLite4 design page then it
>> will often be the case that lookup keys will not be stored in an order
>> that will be useful for optimizing common ORDER BY expressions.  Is
>> this correct?
>
>
> Not correct.  The keys are encoded (see
> http://www.sqlite.org/src4/doc/trunk/www/key_encoding.wiki) in a way that
> causes a lexicographical ordering of the keys to correspond to what the
> user wants out of ORDER BY.  So indices can still be used for fulfilling
> ORDER BY.

Ah, I hadn't seen that.  That's very clever.

>>  If so, is this worth the trade-off for the single
>> key/value storage complexity?  Or is this wrong because the key
>> comparison function to be used will be aware of of data typing in the
>> encoding of the keys?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_bind_int64() on Solaris 10?

2012-06-29 Thread Richard Hipp
FWIW, every recent release of SQLite has been tested on SunOS 5.10 (Sparc)
using GCC.  That doesn't really answer your question (I don't know the real
answer) but it does at least demonstrate that SQLite has been made to work
correctly on Sparc and on SunOS.

On Fri, Jun 29, 2012 at 3:17 PM, Pam Li  wrote:

>
>
>
>
>
>
>
> Hello,  We are using SQLITE 3.7.10 C/C++ interface API in our product.
>  This is the very first time we use it.   Our product runs on Windows,
> Linux and Solaris. We ran into a problem that a query on a 64 bit integer
> key is successful on both Windows and Linux, but not on Solaris 10.   The
> code, database, and input data for the query are the same fro all
> platforms. Query: select * from  where MAC_ADDR in (?1, ?2. ?3); On
> Solaris, if the MAC_ADDRESS value is 4 byte or less, a query is successful.
>  If its value is 5-8 bytes, the query fails. API sequence we use for the
> query: ===sqlite3_prepare_v2() sqlite3_bind_int64()
> sqlite3_step() ... ===  Has anyone else had this
> issue?  Any clue is appreciated.  Best regards,pam
>
> ___
> 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] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Richard Hipp
On Fri, Jun 29, 2012 at 3:40 PM, Nico Williams wrote:

> So, if I understand section 3.2 of the SQLite4 design page then it
> will often be the case that lookup keys will not be stored in an order
> that will be useful for optimizing common ORDER BY expressions.  Is
> this correct?


Not correct.  The keys are encoded (see
http://www.sqlite.org/src4/doc/trunk/www/key_encoding.wiki) in a way that
causes a lexicographical ordering of the keys to correspond to what the
user wants out of ORDER BY.  So indices can still be used for fulfilling
ORDER BY.



>  If so, is this worth the trade-off for the single
> key/value storage complexity?  Or is this wrong because the key
> comparison function to be used will be aware of of data typing in the
> encoding of the keys?
>
> Nico
> --
> ___
> 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] Consequences of lexicographic sorting of keys in SQLite4?

2012-06-29 Thread Nico Williams
So, if I understand section 3.2 of the SQLite4 design page then it
will often be the case that lookup keys will not be stored in an order
that will be useful for optimizing common ORDER BY expressions.  Is
this correct?  If so, is this worth the trade-off for the single
key/value storage complexity?  Or is this wrong because the key
comparison function to be used will be aware of of data typing in the
encoding of the keys?

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


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Nico Williams
On Fri, Jun 29, 2012 at 12:30 PM, Stephan Beal  wrote:
> On Fri, Jun 29, 2012 at 7:24 PM, Nico Williams wrote:
>
>> I'd be more concerned about linker symbol colliosions than about C
>> pre-processor symbol collisions.
>>
>
> We have since resolved it - the current code can be compiled with and
> linked with both APIs in the same compilation unit.

Ah, yes, of course, I should have read the rest.  Well, that's
awesome.  Thanks for the good work!

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


[sqlite] Error indicated through SQLITE_CONFIG_LOG callback but sqlite3_step() does not fail

2012-06-29 Thread Jeff Archer
I have been puzzling on this for a couple of days now and am at a loss.  I
hate to let something like this go because it appears so much like an
error, I feel like it will just bite me at a later time.

Any suggestions would be greatly appreciated.

In attempting to execute the following SQL: "INSERT INTO [Scans](ScanID,
Timestamp, EndTime, Result) VALUES(NULL, @Timestamp, @Timestamp, @Result);"

I get the following message through the SQLITE_CONFIG_LOG callback during
the sqlite3_step():
errcode: SQLITE_SCHEMA  (17)
message: statement aborts at 80: [INSERT INTO [Scans](ScanID, Timestamp,
EndTime, Result) VALUES(NULL, Timestamp, @Timestamp, @Result);] database
schema has changed

sqlite3_step() returns SQLITE_DONE (101) and the row being inserted does
get inserted into the database.

I have investigated this with a very small test app and have not seen the
log message in this context.

I have now instrumented my real applications with output of all SQL to a
single log file but am not seeing anything in here that would suggest the
schema is being changed.  (I'm not sure how to make this available since it
can't be attached to this email)

Unfortunately, I am on Windows and using the amalgamation (3.7.13) in
VisualStudio so I am handicapped in terms of debugging down to the actual
line within sqlite.  I only see one instance of this log message at line
72025 within sqlite3VdbeExec().
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3_bind_int64() on Solaris 10?

2012-06-29 Thread Pam Li







Hello,  We are using SQLITE 3.7.10 C/C++ interface API in our product.  This is 
the very first time we use it.   Our product runs on Windows, Linux and 
Solaris. We ran into a problem that a query on a 64 bit integer key is 
successful on both Windows and Linux, but not on Solaris 10.   The code, 
database, and input data for the query are the same fro all platforms. Query: 
select * from  where MAC_ADDR in (?1, ?2. ?3); On Solaris, if the 
MAC_ADDRESS value is 4 byte or less, a query is successful.  If its value is 
5-8 bytes, the query fails. API sequence we use for the query: 
===sqlite3_prepare_v2() sqlite3_bind_int64() 
sqlite3_step() ... ===  Has anyone else had this issue? 
 Any clue is appreciated.  Best regards,pam 
  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] size_t printf standard

2012-06-29 Thread Robert Myers

On 6/29/2012 1:56 PM, Kyle McKay wrote:

On June 28, 2012 09:46:06 PDT, Stephan Beal wrote:

- There are no standard printf()/scanf() specifiers for it, which means
those funcs cannot be used with size_t or ifdefs or casts are needed to
handle them portably.


Perhaps you should actually check the standard before making such a 
claim:


http://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html


There are standardized ones, but not standard ones; a subtle, but 
important, distinction.


Compare your link to http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx

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


Re: [sqlite] size_t printf standard (was: SQLite4 (don't scream))

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 8:56 PM, Kyle McKay  wrote:

> On June 28, 2012 09:46:06 PDT, Stephan Beal wrote:
>
>> - There are no standard printf()/scanf() specifiers for it, which means
>> those funcs cannot be used with size_t or ifdefs or casts are needed to
>> handle them portably.
>>
>
> Perhaps you should actually check the standard before making such a claim:
>
>  
> http://pubs.opengroup.org/**onlinepubs/009695399/**functions/printf.html


My apologies, my statement was extremely misleading. i was refering to the
PRIxxx and SCNxxx family of macros. Those don't exist for size_t.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] size_t printf standard (was: SQLite4 (don't scream))

2012-06-29 Thread Kyle McKay

On June 28, 2012 09:46:06 PDT, Stephan Beal wrote:
- There are no standard printf()/scanf() specifiers for it, which  
means
those funcs cannot be used with size_t or ifdefs or casts are needed  
to

handle them portably.


Perhaps you should actually check the standard before making such a  
claim:


  http://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html

The functionality described on this reference page is aligned with  
the ISO C standard. Any conflict between the requirements described  
here and the ISO C standard is unintentional. This volume of IEEE  
Std 1003.1-2001 defers to the ISO C standard.

[...]

The length modifiers and their meanings are:


[...]

z
	Specifies that a following d, i, o, u, x, or X conversion specifier  
applies to a size_t or the corresponding signed integer type  
argument; or that a following n conversion specifier applies to a  
pointer to a signed integer type corresponding to a size_t argument.

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


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 7:24 PM, Nico Williams wrote:

> I'd be more concerned about linker symbol colliosions than about C
> pre-processor symbol collisions.
>

We have since resolved it - the current code can be compiled with and
linked with both APIs in the same compilation unit.

:-D

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Nico Williams
On Fri, Jun 29, 2012 at 9:27 AM, Stephan Beal  wrote:
> On Fri, Jun 29, 2012 at 4:25 PM, Richard Hipp  wrote:
>
>> Bummer.  These are going to be hard to fix.  :-(
>>
>
> i guessed that would be the case for some of the long-standing symbols like
> SQLITE_OK.
>
> i will admit that including both 3 and 4 into one client is an odd
> corner-case.

Well, maybe not, maybe DB conversion tools would do it, but, yeah, not likely.

I'd be more concerned about linker symbol colliosions than about C
pre-processor symbol collisions.

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


Re: [sqlite] SQLite4 (don't scream)

2012-06-29 Thread Petite Abeille

On Jun 28, 2012, at 5:57 PM, Simon Slavin wrote:

> "SQLite4 is an alternative, not a replacement, for SQLite3. SQLite3 is not 
> going away."

Argh… but more seriously… would that new incarnation provide proper error 
messages for constraint violations?  

Providing a proper data dictionary would be nice as well :))

Supporting merge statement and with clause would be the cherry on the top.

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Simon Slavin

On 29 Jun 2012, at 3:54pm, Dennis Volodomanov  wrote:

> Most likely - it is my box that's causing this. Unless SQLite does any sort 
> of real low-level disk access, bypassing standard OS, then it's unlikely that 
> it somehow caused this to happen, but it would be good to rule this out 
> somehow.

SQLite doesn't do anything weird like bypassing the file system.  I agree with 
everyone that there's something weird about your OS or hardware.  Run all the 
checks you can find.

Simon.

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


Re: [sqlite] sqlite4: type decl/def discrepancy (w/ fix)

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 6:04 PM, Richard Hipp  wrote:

> No.  It has been leaking memory for a while now.  I need to get to the
> bottom of that
>

If i can be of any assistance, i'm free to help this weekend. i feel kinda
bad about spamming the user list so much, though :/. Should we try to
convince the admin ;) to set to a v4-specific list (or i can alternately
move to the dev list (subscribing now))?

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Example database with lots of "types"?

2012-06-29 Thread Maury Markowitz
Hey Dan, thanks for that link, it was just what I was looking for.

Yes indeed, someone, somewhere in my software stack is incorrectly mapping out 
BLOBs as text.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite4: type decl/def discrepancy (w/ fix)

2012-06-29 Thread Richard Hipp
On Fri, Jun 29, 2012 at 12:01 PM, Stephan Beal wrote:

> On Fri, Jun 29, 2012 at 5:45 PM, Stephan Beal 
> wrote:
>
> > sqliteInt.h: sqlite4_env:
> >
> >   sqlite4_mutex *pFactoryMutex; /* Mutex for pFactory */
> >
> > is missing from the definition in global.c, line 172. Adding a NULL
> > there resolves "excess initializer" warnings and the follow-up errors
> such
> > as "braces around scalar initializer" in nowValue[].
> >
> > Make test fails, but it "might" be related to my local SQLITE4_
> > replacements.
> >
>
> With the SQLITE4_ trunk and the addition of the NULL pFactoryMutex, make
> test now runs but fails at the end with a massive list of leaks in
> memleak.txt. Have i caused that with the null factory or might that somehow
> be a side-effect of the 7-vs-8 strlen change?
>

No.  It has been leaking memory for a while now.  I need to get to the
bottom of that


>
> ...
> Memory used:  now   13991544  max  118078336  max-size   67108864
> Allocation count: now  15078  max 100119
> 5 errors out of 34621 tests
> Failures on these tests: fkey2-6.1 where8-4.3.9.2 where8-4.4.9.2
> where8-4.5.9.2 where8-4.6.9.2
> Unfreed memory: 13991696 bytes in 15079 allocations
> Writing unfreed memory log to "./memleak.txt"
> Memory used:  now   13991696  max  118078336  max-size   67108864
> Allocation count: now  15079  max 100119
> Maximum memory usage: 118078336 bytes
> Current memory usage: 13991696 bytes
> Number of malloc()  : 4814608 calls
> make: *** [test] Error 1
>
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> ___
> 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] An interesting (strange) issue with selects

2012-06-29 Thread Black, Michael (IS)
Not supposed to be the contentsjust attributes...

Also note the 15-second default time window.  If you do it faster than 15 
seconds you won't see the effect.



http://support.microsoft.com/kb/172190



http://dfstream.blogspot.com/2012/02/file-system-tunneling-in-windows.html



Not sure if Windows 7 has it too but I would imagine so.



Can you turn it off and see what happens?



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 Joel Lucsy [jjlu...@gmail.com]
Sent: Friday, June 29, 2012 10:50 AM
To: i...@psunrise.com; General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] An interesting (strange) issue with selects

There is a "bug" that I've read about on a Windows machines sporting the
NTFS filesystem that when a file is deleted and recreated within a certain
period of time, the original file is retrieved rather than a new one.

On Fri, Jun 29, 2012 at 10:54 AM, Dennis Volodomanov wrote:

> On 30/06/2012 12:19 AM, Black, Michael (IS) wrote:
>
>>
>> It persists across a reboot?
>>
>> You can create a database, delete it, reboot, and your app will still see
>> the original table?
>>
>> All I can say is wow...your system is really hosed.
>>
>> Even anti-virus shouldn't cause that.  This would infer some sort of
>> caching that is semi-permanent.
>>
>> Have you got a 2nd computer you can test this on?
>>
>> Would you be willing to share your app so others can check this?  As
>> "House" used to say..."interesting".
>>
>>
>>
> Not only my app, the sqlite shell will see it too. Regarding my second
> message - I was talking about this same screwed-up folder, so yes, I can
> create a new db in a new folder and it's fine. It's only when I try
> anything in this folder that things go amok (at least it's localized to
> this folder so far).
>
> I'll do testing on another machine and I'll do a full chkdsk here as well
> tomorrow.
>
> Most likely - it is my box that's causing this. Unless SQLite does any
> sort of real low-level disk access, bypassing standard OS, then it's
> unlikely that it somehow caused this to happen, but it would be good to
> rule this out somehow.
>
> I can share the app (not the source of course), sure, but I don't know if
> that'll help in any way?
>
>
>   Dennis
>
> __**_
> 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] sqlite4: type decl/def discrepancy (w/ fix)

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 5:45 PM, Stephan Beal  wrote:

> sqliteInt.h: sqlite4_env:
>
>   sqlite4_mutex *pFactoryMutex; /* Mutex for pFactory */
>
> is missing from the definition in global.c, line 172. Adding a NULL
> there resolves "excess initializer" warnings and the follow-up errors such
> as "braces around scalar initializer" in nowValue[].
>
> Make test fails, but it "might" be related to my local SQLITE4_
> replacements.
>

With the SQLITE4_ trunk and the addition of the NULL pFactoryMutex, make
test now runs but fails at the end with a massive list of leaks in
memleak.txt. Have i caused that with the null factory or might that somehow
be a side-effect of the 7-vs-8 strlen change?

...
Memory used:  now   13991544  max  118078336  max-size   67108864
Allocation count: now  15078  max 100119
5 errors out of 34621 tests
Failures on these tests: fkey2-6.1 where8-4.3.9.2 where8-4.4.9.2
where8-4.5.9.2 where8-4.6.9.2
Unfreed memory: 13991696 bytes in 15079 allocations
Writing unfreed memory log to "./memleak.txt"
Memory used:  now   13991696  max  118078336  max-size   67108864
Allocation count: now  15079  max 100119
Maximum memory usage: 118078336 bytes
Current memory usage: 13991696 bytes
Number of malloc()  : 4814608 calls
make: *** [test] Error 1


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 5:50 PM, Stephan Beal  wrote:

> caused by an unclosed /*, and the long-long (C++-specific) warning, but
> other than that everything looks good as far as i'm concerned.
>

One more bit of pedanticness:

lsmInt.h:35:

#else
# define LSM_DEBUG
#endif

"should probably" be:

#else
#  if !defined(LSM_DEBUG)
#   define LSM_DEBUG
#  endif
#endif

The problem is that gcc warns about redefinition when LSM_DEBUG is -Defined
vla CLI args.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 5:42 PM, Richard Hipp  wrote:

> I also had to change a couple of 7's to 8's in ctime.c (since "SQLITE_" is
> 7 characters long whereas "SQLITE4_" is 8).  But that plus your changes
> above seem to do the trick.  The changes are now checked in on the trunk.
> Thanks.


Thank YOU!

i'm still seeing this one:

/home/stephan/include/sqlite4.h:3446:1: error: "/*" within comment
[-Werror=comment]

caused by an unclosed /*, and the long-long (C++-specific) warning, but
other than that everything looks good as far as i'm concerned. i have not
yet put it through any stress-tests because i need to fix my dependency on
autoincrement, but everything other than that i've tried so far is fine
(meaning "comparable results to sqlite3").

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Joel Lucsy
There is a "bug" that I've read about on a Windows machines sporting the
NTFS filesystem that when a file is deleted and recreated within a certain
period of time, the original file is retrieved rather than a new one.

On Fri, Jun 29, 2012 at 10:54 AM, Dennis Volodomanov wrote:

> On 30/06/2012 12:19 AM, Black, Michael (IS) wrote:
>
>>
>> It persists across a reboot?
>>
>> You can create a database, delete it, reboot, and your app will still see
>> the original table?
>>
>> All I can say is wow...your system is really hosed.
>>
>> Even anti-virus shouldn't cause that.  This would infer some sort of
>> caching that is semi-permanent.
>>
>> Have you got a 2nd computer you can test this on?
>>
>> Would you be willing to share your app so others can check this?  As
>> "House" used to say..."interesting".
>>
>>
>>
> Not only my app, the sqlite shell will see it too. Regarding my second
> message - I was talking about this same screwed-up folder, so yes, I can
> create a new db in a new folder and it's fine. It's only when I try
> anything in this folder that things go amok (at least it's localized to
> this folder so far).
>
> I'll do testing on another machine and I'll do a full chkdsk here as well
> tomorrow.
>
> Most likely - it is my box that's causing this. Unless SQLite does any
> sort of real low-level disk access, bypassing standard OS, then it's
> unlikely that it somehow caused this to happen, but it would be good to
> rule this out somehow.
>
> I can share the app (not the source of course), sure, but I don't know if
> that'll help in any way?
>
>
>   Dennis
>
> __**_
> 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] sqlite4: type decl/def discrepancy (w/ fix)

2012-06-29 Thread Stephan Beal
Hiho,

sqliteInt.h: sqlite4_env:

  sqlite4_mutex *pFactoryMutex; /* Mutex for pFactory */

is missing from the definition in global.c, line 172. Adding a NULL
there resolves "excess initializer" warnings and the follow-up errors such
as "braces around scalar initializer" in nowValue[].

Make test fails, but it "might" be related to my local SQLITE4_
replacements.

...
-o testfixture -ltcl8.5 -lm -lpthread -ldl -lz -ldl -lpthread libsqlite4.a
../sqlite4/test/test_mutex.c: In function ‘getDbPointer’:
../sqlite4/test/test_mutex.c:369:10: warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]
/tmp/cc4rUyGN.o: In function `Sqlitetest1_Init':
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_main.c:4544:
undefined reference to `sqlite4_search_count'
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_main.c:4546:
undefined reference to `sqlite4_found_count'
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_main.c:4548:
undefined reference to `sqlite4_sort_count'
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_main.c:4550:
undefined reference to `sqlite4_max_blobsize'
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_main.c:4552:
undefined reference to `sqlite4_like_count'
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_main.c:4554:
undefined reference to `sqlite4_interrupt_count'
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_main.c:4563:
undefined reference to `sqlite4_xferopt_count'
/tmp/cc64DmC7.o: In function `test_translate_selftest':
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_utf.c:196: undefined
reference to `sqlite4UtfSelfTest'
/tmp/ccpAUrm8.o: In function `sqlite4test_install_test_functions':
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_func.c:577: undefined
reference to `Md5_Register'
/tmp/ccfFgLtO.o: In function `utf8_to_utf8':
/home/stephan/cvs/fossil/sqlite4/../sqlite4/test/test_hexio.c:311:
undefined reference to `sqlite4Utf8To8'
collect2: ld returned 1 exit status

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Richard Hipp
On Fri, Jun 29, 2012 at 11:08 AM, Stephan Beal wrote:

> On Fri, Jun 29, 2012 at 4:38 PM, Stephan Beal 
> wrote:
>
> > Other than that i simply did s/sqlite3/sqlite4/g and all went just fine,
> > so i wouldn't expect any problems with s/SQLITE_/SQLITE4_/g.
> >
>
> This actually works.
>
> Here's what i did (incrementally via trial/error), from the 'src' dir:
>
>  544  perl -i -pe 's|SQLITE_|SQLITE4_|g' *.c ../tool/*.tcl
>  545  perl -i -pe 's|SQLITE_|SQLITE4_|g' ../Makefile*
>  547  perl -i -pe 's|SQLITE_|SQLITE4_|g' *.in
>  549  perl -i -pe 's|SQLITE_|SQLITE4_|g' *.h
>  550  perl -i -pe 's|SQLITE_|SQLITE4_|g' ../test/*.*
>  551  perl -i -pe 's|SQLITE_|SQLITE4_|g' *.y
>
> make clean; make
>
> i made the same changes in my client and now its amalgamation builds just
> fine with both v3 and v4 enabled.
>

I also had to change a couple of 7's to 8's in ctime.c (since "SQLITE_" is
7 characters long whereas "SQLITE4_" is 8).  But that plus your changes
above seem to do the trick.  The changes are now checked in on the trunk.
Thanks.


>
> :-D
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> ___
> 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] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 4:38 PM, Stephan Beal  wrote:

> Other than that i simply did s/sqlite3/sqlite4/g and all went just fine,
> so i wouldn't expect any problems with s/SQLITE_/SQLITE4_/g.
>

This actually works.

Here's what i did (incrementally via trial/error), from the 'src' dir:

  544  perl -i -pe 's|SQLITE_|SQLITE4_|g' *.c ../tool/*.tcl
  545  perl -i -pe 's|SQLITE_|SQLITE4_|g' ../Makefile*
  547  perl -i -pe 's|SQLITE_|SQLITE4_|g' *.in
  549  perl -i -pe 's|SQLITE_|SQLITE4_|g' *.h
  550  perl -i -pe 's|SQLITE_|SQLITE4_|g' ../test/*.*
  551  perl -i -pe 's|SQLITE_|SQLITE4_|g' *.y

make clean; make

i made the same changes in my client and now its amalgamation builds just
fine with both v3 and v4 enabled.

:-D

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

On 30/06/2012 12:19 AM, Black, Michael (IS) wrote:


It persists across a reboot?

You can create a database, delete it, reboot, and your app will still 
see the original table?


All I can say is wow...your system is really hosed.

Even anti-virus shouldn't cause that.  This would infer some sort of 
caching that is semi-permanent.


Have you got a 2nd computer you can test this on?

Would you be willing to share your app so others can check this?  As 
"House" used to say..."interesting".





Not only my app, the sqlite shell will see it too. Regarding my second 
message - I was talking about this same screwed-up folder, so yes, I can 
create a new db in a new folder and it's fine. It's only when I try 
anything in this folder that things go amok (at least it's localized to 
this folder so far).


I'll do testing on another machine and I'll do a full chkdsk here as 
well tomorrow.


Most likely - it is my box that's causing this. Unless SQLite does any 
sort of real low-level disk access, bypassing standard OS, then it's 
unlikely that it somehow caused this to happen, but it would be good to 
rule this out somehow.


I can share the app (not the source of course), sure, but I don't know 
if that'll help in any way?


   Dennis

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


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 4:38 PM, Stephan Beal  wrote:

> Other than that i simply did s/sqlite3/sqlite4/g and all went just fine
>

One more tiny thing: the build flags for gcc should include -fPIC. Some
Linuxes won't link against a lib built without -fPIC.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 4:33 PM, Richard Hipp  wrote:

> You think?  You already need to do a global search/replace of "sqlite3_" to
> "sqlite4_".  How much harder is it to do a separate search/replace of
> "SQLITE_" to "SQLITE4_"?
>

True enough. The only points which i came across not yet mentioned in the
porting guide:

- sqlite3_open_v2()
- sqlite3_prepare_v2()

don't exist anymore. i'm not yet sure how the flags field from open_v2() is
to be handled with sqlite4_open().

Other than that i simply did s/sqlite3/sqlite4/g and all went just fine, so
i wouldn't expect any problems with s/SQLITE_/SQLITE4_/g.


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Richard Hipp
On Fri, Jun 29, 2012 at 10:32 AM, Stephan Beal wrote:

> On Fri, Jun 29, 2012 at 4:30 PM, Richard Hipp  wrote:
>
> > Maybe the thing to do is globally replace SQLITE_ with SQLITE4_?
> >
>
>
> That would be my preference, but it admittedly makes porting more
> difficult,


You think?  You already need to do a global search/replace of "sqlite3_" to
"sqlite4_".  How much harder is it to do a separate search/replace of
"SQLITE_" to "SQLITE4_"?



> and i wouldn't cry too much if you decide to punt on this
> problem. i'm working around it now to disable v3 support if v4 is enabled.
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> ___
> 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] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 4:30 PM, Richard Hipp  wrote:

> Maybe the thing to do is globally replace SQLITE_ with SQLITE4_?
>


That would be my preference, but it admittedly makes porting more
difficult, and i wouldn't cry too much if you decide to punt on this
problem. i'm working around it now to disable v3 support if v4 is enabled.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Black, Michael (IS)
You need to check your file system.



When you run the shell doing this on a new, empty directory (this is using the 
shell from the website)



sqlite3 mydb.ext



In another window you should NOT see anything.



then after doing .dump you should see a 0-length mydb.ext file appear.



.quit -- your zero-length mydb.ext should still be there.



How are you getting wal mode without asking for it?





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 Dennis Volodomanov [i...@psunrise.com]
Sent: Friday, June 29, 2012 9:19 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] An interesting (strange) issue with selects

To further confuse things:

I've deleted all files from that old folder. Then using the shell:
"sqlite3 mydb.ext" and ".dump" - shows the usual rubbish. The
interesting bit here now is that there is no "mydb.ext" file in that
folder (checked using a second command prompt), but there are
"mydb.ext-shm" and "mydb.ext-wal" files there! Once I ".quit" there are
no "mydb*.*" at all.

Perhaps my drive or fat are dying or something?

Dennis

___
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] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Richard Hipp
On Fri, Jun 29, 2012 at 10:27 AM, Stephan Beal wrote:

> On Fri, Jun 29, 2012 at 4:25 PM, Richard Hipp  wrote:
>
> > Bummer.  These are going to be hard to fix.  :-(
> >
>
> i guessed that would be the case for some of the long-standing symbols like
> SQLITE_OK.
>
> i will admit that including both 3 and 4 into one client is an odd
> corner-case.
>

Maybe the thing to do is globally replace SQLITE_ with SQLITE4_?


>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> ___
> 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] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 4:27 PM, Stephan Beal  wrote:

> On Fri, Jun 29, 2012 at 4:25 PM, Richard Hipp  wrote:
>
>> Bummer.  These are going to be hard to fix.  :-(
>>
>
> i guessed that would be the case for some of the long-standing symbols
> like SQLITE_OK.
>

Maybe that's another idea for the code sprint next week ;).

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 4:25 PM, Richard Hipp  wrote:

> Bummer.  These are going to be hard to fix.  :-(
>

i guessed that would be the case for some of the long-standing symbols like
SQLITE_OK.

i will admit that including both 3 and 4 into one client is an odd
corner-case.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Richard Hipp
Bummer.  These are going to be hard to fix.  :-(

On Fri, Jun 29, 2012 at 10:21 AM, Stephan Beal wrote:

> Hi again,
>
> from sqlite4.h:
>
> _SQLITE3RTREE_H_
>
> collides with sqlite3.h, causing ODR violations when both headers are
> included (as is the case in my abstraction layer's amalgamation build).
>
> i've patched that locally but now i'm seeing similar collisions with other
> symbols:
>
> /home/stephan/include/sqlite4.h:163:0: error: "SQLITE_SOURCE_ID" redefined
> [-Werror]
> /home/stephan/include/sqlite3.h:112:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:2698:0: error: "SQLITE_STATIC" redefined
> [-Werror]
> /home/stephan/include/sqlite3.h:3975:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:2699:0: error: "SQLITE_TRANSIENT" redefined
> [-Werror]
> /home/stephan/include/sqlite3.h:3976:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3747:0: error: "SQLITE_TESTCTRL_FIRST"
> redefined [-Werror]
> /home/stephan/include/sqlite3.h:5616:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3748:0: error:
> "SQLITE_TESTCTRL_FAULT_INSTALL" redefined [-Werror]
> /home/stephan/include/sqlite3.h:5621:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3749:0: error: "SQLITE_TESTCTRL_ASSERT"
> redefined [-Werror]
> /home/stephan/include/sqlite3.h:5624:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3750:0: error: "SQLITE_TESTCTRL_ALWAYS"
> redefined [-Werror]
> /home/stephan/include/sqlite3.h:5625:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3751:0: error: "SQLITE_TESTCTRL_RESERVE"
> redefined [-Werror]
> /home/stephan/include/sqlite3.h:5626:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3752:0: error:
> "SQLITE_TESTCTRL_OPTIMIZATIONS" redefined [-Werror]
> /home/stephan/include/sqlite3.h:5627:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3753:0: error: "SQLITE_TESTCTRL_ISKEYWORD"
> redefined [-Werror]
> /home/stephan/include/sqlite3.h:5628:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3754:0: error:
> "SQLITE_TESTCTRL_LOCALTIME_FAULT" redefined [-Werror]
> /home/stephan/include/sqlite3.h:5631:0: note: this is the location of the
> previous definition
> /home/stephan/include/sqlite4.h:3756:0: error: "SQLITE_TESTCTRL_LAST"
> redefined [-Werror]
> /home/stephan/include/sqlite3.h:5632:0: note: this is the location of the
> previous definition
> In file included from cpdo_amalgamation.cpp:3417:0:
> /home/stephan/include/sqlite3.h:252:3: error: ISO C++ 1998 does not support
> ‘long long’ [-Werror=long-long]
> /home/stephan/include/sqlite3.h:253:3: error: ISO C++ 1998 does not support
> ‘long long’ [-Werror=long-long]
> In file included from cpdo_amalgamation.cpp:4400:0:
> /home/stephan/include/sqlite4.h:285:3: error: ISO C++ 1998 does not support
> ‘long long’ [-Werror=long-long]
> /home/stephan/include/sqlite4.h:286:3: error: ISO C++ 1998 does not support
> ‘long long’ [-Werror=long-long]
>
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> ___
> 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] symbol collisions between sqlite{3,4}.h

2012-06-29 Thread Stephan Beal
Hi again,

from sqlite4.h:

_SQLITE3RTREE_H_

collides with sqlite3.h, causing ODR violations when both headers are
included (as is the case in my abstraction layer's amalgamation build).

i've patched that locally but now i'm seeing similar collisions with other
symbols:

/home/stephan/include/sqlite4.h:163:0: error: "SQLITE_SOURCE_ID" redefined
[-Werror]
/home/stephan/include/sqlite3.h:112:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:2698:0: error: "SQLITE_STATIC" redefined
[-Werror]
/home/stephan/include/sqlite3.h:3975:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:2699:0: error: "SQLITE_TRANSIENT" redefined
[-Werror]
/home/stephan/include/sqlite3.h:3976:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3747:0: error: "SQLITE_TESTCTRL_FIRST"
redefined [-Werror]
/home/stephan/include/sqlite3.h:5616:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3748:0: error:
"SQLITE_TESTCTRL_FAULT_INSTALL" redefined [-Werror]
/home/stephan/include/sqlite3.h:5621:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3749:0: error: "SQLITE_TESTCTRL_ASSERT"
redefined [-Werror]
/home/stephan/include/sqlite3.h:5624:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3750:0: error: "SQLITE_TESTCTRL_ALWAYS"
redefined [-Werror]
/home/stephan/include/sqlite3.h:5625:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3751:0: error: "SQLITE_TESTCTRL_RESERVE"
redefined [-Werror]
/home/stephan/include/sqlite3.h:5626:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3752:0: error:
"SQLITE_TESTCTRL_OPTIMIZATIONS" redefined [-Werror]
/home/stephan/include/sqlite3.h:5627:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3753:0: error: "SQLITE_TESTCTRL_ISKEYWORD"
redefined [-Werror]
/home/stephan/include/sqlite3.h:5628:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3754:0: error:
"SQLITE_TESTCTRL_LOCALTIME_FAULT" redefined [-Werror]
/home/stephan/include/sqlite3.h:5631:0: note: this is the location of the
previous definition
/home/stephan/include/sqlite4.h:3756:0: error: "SQLITE_TESTCTRL_LAST"
redefined [-Werror]
/home/stephan/include/sqlite3.h:5632:0: note: this is the location of the
previous definition
In file included from cpdo_amalgamation.cpp:3417:0:
/home/stephan/include/sqlite3.h:252:3: error: ISO C++ 1998 does not support
‘long long’ [-Werror=long-long]
/home/stephan/include/sqlite3.h:253:3: error: ISO C++ 1998 does not support
‘long long’ [-Werror=long-long]
In file included from cpdo_amalgamation.cpp:4400:0:
/home/stephan/include/sqlite4.h:285:3: error: ISO C++ 1998 does not support
‘long long’ [-Werror=long-long]
/home/stephan/include/sqlite4.h:286:3: error: ISO C++ 1998 does not support
‘long long’ [-Werror=long-long]


-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Black, Michael (IS)
It persists across a reboot?



You can create a database, delete it, reboot, and your app will still see the 
original table?

All I can say is wow...your system is really hosed.

Even anti-virus shouldn't cause that.  This would infer some sort of caching 
that is semi-permanent.



Have you got a 2nd computer you can test this on?



Would you be willing to share your app so others can check this?  As "House" 
used to say..."interesting".



I've got XP x64 and Windows 7 32-bit I can test.







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 Dennis Volodomanov [i...@psunrise.com]
Sent: Friday, June 29, 2012 8:57 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] An interesting (strange) issue with selects

Michael,

It works using the shell with one simple table, so I'm investigating
this further to see if I can get this to break using the shell (by
adding pragmas, triggers, indexes, from my code). This is on a new file
in a different folder to the other test.

The OS is Windows 7 x64, SQLite 3.7.13 from the site. Local file,
persists across a reboot. Not sure about your question regarding 3rd
party software - there's a lot of software that I run, of course?
Antivirus, hmm, maybe... Need to try and get it to happen using the shell.

Dennis


On 29/06/2012 10:35 PM, Black, Michael (IS) wrote:
>
> Care to show all of your steps?  Not that my BS flag is waving but
> you're correct that this is very odd.
>
> What OS?
>
> What version sqlite?
>
> Shell from website or did you compile?
>
> Local file?
>
> Does it persist across a reboot?
>
> Are you running ANY 3rd party software?
>
> Try uninstalling your anti-virus.
>
> D:\>mkdir dennis
>
> D:\>cd dennis
>
> D:\dennis>dir
>  Volume in drive D is Apps
>  Volume Serial Number is C43B-2252
>
>  Directory of D:\dennis
>
> 06/29/2012  07:24 AM  .
> 06/29/2012  07:24 AM  ..
>0 File(s)  0 bytes
>2 Dir(s)  202,760,232,960 bytes free
>
> D:\dennis>sqlite3 mydbname.ext
> SQLite version 3.7.9 2011-11-01 00:52:41
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> pragma journal_mode=wal;
> wal
> sqlite> create table t(a);
> sqlite> insert into t values(1);
> sqlite> .quit
>
> D:\dennis>dir
>  Volume in drive D is Apps
>  Volume Serial Number is C43B-2252
>
>  Directory of D:\dennis
>
> 06/29/2012  07:25 AM  .
> 06/29/2012  07:25 AM  ..
> 06/29/2012  07:25 AM 2,048 mydbname.ext
>1 File(s)  2,048 bytes
>2 Dir(s)  202,760,228,864 bytes free
>
> D:\dennis>del mydbname.ext
>
> D:\dennis>sqlite3 mydbname.ext
> SQLite version 3.7.9 2011-11-01 00:52:41
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> .dump
> PRAGMA foreign_keys=OFF;
> BEGIN TRANSACTION;
> COMMIT;
> sqlite> .quit
>
> D:\dennis>dir
>  Volume in drive D is Apps
>  Volume Serial Number is C43B-2252
>
>  Directory of D:\dennis
>
> 06/29/2012  07:25 AM  .
> 06/29/2012  07:25 AM  ..
> 06/29/2012  07:25 AM 0 mydbname.ext
>1 File(s)  0 bytes
>2 Dir(s)  202,760,232,960 bytes free
>
> D:\dennis>del mydbname.ext
>
> 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 Dennis Volodomanov
> [i...@psunrise.com]
> *Sent:* Friday, June 29, 2012 6:47 AM
> *To:* General Discussion of SQLite Database
> *Subject:* EXT :Re: [sqlite] An interesting (strange) issue with selects
>
> Ok, tried using the shell and the result is the same as using my app.
>
> What I did is:
>
> 1) delete the database file ("mydbname.ext") from the DOS prompt, make
> sure the file is not there
> 2) run "sqlite3 .\mydbname.ext" from within that same folder, same DOS
> prompt
> 3) type .dump
> 4) see entries in this DB, which should be impossible, since the file
> wasn't there and I've issued no commands using the shell tool
>
> Weird?
>
> Dennis
>
> ___
> 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] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

To further confuse things:

I've deleted all files from that old folder. Then using the shell: 
"sqlite3 mydb.ext" and ".dump" - shows the usual rubbish. The 
interesting bit here now is that there is no "mydb.ext" file in that 
folder (checked using a second command prompt), but there are 
"mydb.ext-shm" and "mydb.ext-wal" files there! Once I ".quit" there are 
no "mydb*.*" at all.


Perhaps my drive or fat are dying or something?

   Dennis

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


[sqlite] errant opening comment block in sqlite4.h

2012-06-29 Thread Stephan Beal
Hiho,

FYI: sqlite4.h is being generated with an unclosed comment on line 3443:

/*
**

/*
** CAPIREF: Mutexes

*/


it also has the long-standing 'long long' c89 incompatibility, but that's
only significant if c89 is a hard goal (which it isn't, from what i
understand).

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

Michael,

It works using the shell with one simple table, so I'm investigating 
this further to see if I can get this to break using the shell (by 
adding pragmas, triggers, indexes, from my code). This is on a new file 
in a different folder to the other test.


The OS is Windows 7 x64, SQLite 3.7.13 from the site. Local file, 
persists across a reboot. Not sure about your question regarding 3rd 
party software - there's a lot of software that I run, of course? 
Antivirus, hmm, maybe... Need to try and get it to happen using the shell.


   Dennis


On 29/06/2012 10:35 PM, Black, Michael (IS) wrote:


Care to show all of your steps?  Not that my BS flag is waving but 
you're correct that this is very odd.


What OS?

What version sqlite?

Shell from website or did you compile?

Local file?

Does it persist across a reboot?

Are you running ANY 3rd party software?

Try uninstalling your anti-virus.

D:\>mkdir dennis

D:\>cd dennis

D:\dennis>dir
 Volume in drive D is Apps
 Volume Serial Number is C43B-2252

 Directory of D:\dennis

06/29/2012  07:24 AM  .
06/29/2012  07:24 AM  ..
   0 File(s)  0 bytes
   2 Dir(s)  202,760,232,960 bytes free

D:\dennis>sqlite3 mydbname.ext
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> pragma journal_mode=wal;
wal
sqlite> create table t(a);
sqlite> insert into t values(1);
sqlite> .quit

D:\dennis>dir
 Volume in drive D is Apps
 Volume Serial Number is C43B-2252

 Directory of D:\dennis

06/29/2012  07:25 AM  .
06/29/2012  07:25 AM  ..
06/29/2012  07:25 AM 2,048 mydbname.ext
   1 File(s)  2,048 bytes
   2 Dir(s)  202,760,228,864 bytes free

D:\dennis>del mydbname.ext

D:\dennis>sqlite3 mydbname.ext
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;
sqlite> .quit

D:\dennis>dir
 Volume in drive D is Apps
 Volume Serial Number is C43B-2252

 Directory of D:\dennis

06/29/2012  07:25 AM  .
06/29/2012  07:25 AM  ..
06/29/2012  07:25 AM 0 mydbname.ext
   1 File(s)  0 bytes
   2 Dir(s)  202,760,232,960 bytes free

D:\dennis>del mydbname.ext

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 Dennis Volodomanov 
[i...@psunrise.com]

*Sent:* Friday, June 29, 2012 6:47 AM
*To:* General Discussion of SQLite Database
*Subject:* EXT :Re: [sqlite] An interesting (strange) issue with selects

Ok, tried using the shell and the result is the same as using my app.

What I did is:

1) delete the database file ("mydbname.ext") from the DOS prompt, make
sure the file is not there
2) run "sqlite3 .\mydbname.ext" from within that same folder, same DOS
prompt
3) type .dump
4) see entries in this DB, which should be impossible, since the file
wasn't there and I've issued no commands using the shell tool

Weird?

Dennis

___
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] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

On 29/06/2012 9:52 PM, Simon Slavin wrote:

When you're deleting the database file, look for any other files in the same folder with 
names that start with "mydbname" and anything after that, including any 
extension.  (Marcus's theory)  Tell us what they're called.

Make sure you're quitting the shell tool with '.quit', not just CTRL-C ing out 
of it.

First try the above two.  If they don't explain what's wrong,

Using the shell tool, delete one of the rows which has magically appeared.  Or even 
the whole table.  Make another row or table with different data in.  Then repeat 
the quit & delete procedure.

When you go back into the shell tool, do you get the same old bad data or the 
new bad data ?

Simon.


Yes, of course all files are removed, as far as the "dir" command is 
concerned (with hidden files/folders shown). And yes, I'm using ".quit".


I've tried deleting that row, but the stuffed up DB contains a trigger 
that I have long removed from my code, which prevents that (because it 
relies on something that has also been long removed from the db's 
structure). So, I've inserted a new row using the shell tool, then 
".quit", deleted all files, ran my app, which created a supposedly empty 
database (stepping through the code). After that quit my app, open the 
DB using the shell and my new row was there - eventhough it contains 
impossible data, which would have never been entered using the app 
(proving that the app is not inserting data on its own). So, it's the 
new bad data :)


   Dennis

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


Re: [sqlite] group by z HAVING count(z>12.5)=2

2012-06-29 Thread Black, Michael (IS)
You need to ask your question betteryour example will give an answer but I 
have no idea what answer you are looking for.



Can you give a complete example?

CREATE TABLE TableA(z);
INSERT INTO "TableA" VALUES(2.0);
INSERT INTO "TableA" VALUES(4.0);
INSERT INTO "TableA" VALUES(8.0);
INSERT INTO "TableA" VALUES(12.0);
INSERT INTO "TableA" VALUES(16.0);
INSERT INTO "TableA" VALUES(20.0);
INSERT INTO "TableA" VALUES(20.0);
INSERT INTO "TableA" VALUES(24.0);
INSERT INTO "TableA" VALUES(24.0);
INSERT INTO "TableA" VALUES(24.0);



"What are the distinct Z values > 12.5"

sqlite> select distinct(z) from TableA where z>12.5;
16.0
20.0
24.0



Or

"What is the count of distinct Z values > 12.5"

sqlite> select sum(c) from(select count(z) as c from tablea where z>12.5 group 
by z);
6



Is there a different answer you want?





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: Friday, June 29, 2012 12:23 AM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] group by z HAVING count(z>12.5)=2

If I wanna to know how much z>12.5 result in the database,could I use this 
following cmd?
SELECT * from TableA WHERE z in (
   SELECT z FROM TableA GROUP BY z
   HAVING count(z>12.5)=2
);

___
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] An interesting (strange) issue with selects

2012-06-29 Thread Black, Michael (IS)
Care to show all of your steps?  Not that my BS flag is waving but you're 
correct that this is very odd.





What OS?

What version sqlite?

Shell from website or did you compile?

Local file?

Does it persist across a reboot?

Are you running ANY 3rd party software?

Try uninstalling your anti-virus.



D:\>mkdir dennis

D:\>cd dennis

D:\dennis>dir
 Volume in drive D is Apps
 Volume Serial Number is C43B-2252

 Directory of D:\dennis

06/29/2012  07:24 AM  .
06/29/2012  07:24 AM  ..
   0 File(s)  0 bytes
   2 Dir(s)  202,760,232,960 bytes free

D:\dennis>sqlite3 mydbname.ext
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> pragma journal_mode=wal;
wal
sqlite> create table t(a);
sqlite> insert into t values(1);
sqlite> .quit

D:\dennis>dir
 Volume in drive D is Apps
 Volume Serial Number is C43B-2252

 Directory of D:\dennis

06/29/2012  07:25 AM  .
06/29/2012  07:25 AM  ..
06/29/2012  07:25 AM 2,048 mydbname.ext
   1 File(s)  2,048 bytes
   2 Dir(s)  202,760,228,864 bytes free

D:\dennis>del mydbname.ext

D:\dennis>sqlite3 mydbname.ext
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
COMMIT;
sqlite> .quit

D:\dennis>dir
 Volume in drive D is Apps
 Volume Serial Number is C43B-2252

 Directory of D:\dennis

06/29/2012  07:25 AM  .
06/29/2012  07:25 AM  ..
06/29/2012  07:25 AM 0 mydbname.ext
   1 File(s)  0 bytes
   2 Dir(s)  202,760,232,960 bytes free

D:\dennis>del mydbname.ext



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 Dennis Volodomanov [i...@psunrise.com]
Sent: Friday, June 29, 2012 6:47 AM
To: General Discussion of SQLite Database
Subject: EXT :Re: [sqlite] An interesting (strange) issue with selects

Ok, tried using the shell and the result is the same as using my app.

What I did is:

1) delete the database file ("mydbname.ext") from the DOS prompt, make
sure the file is not there
2) run "sqlite3 .\mydbname.ext" from within that same folder, same DOS
prompt
3) type .dump
4) see entries in this DB, which should be impossible, since the file
wasn't there and I've issued no commands using the shell tool

Weird?

Dennis

___
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] Complete list of companies that bought SQLite licenses?

2012-06-29 Thread Peter Volkis


>License details are here:

>

>tl;dr version: no license is required or even requested.  You can buy one if 
>some part of your organisation requires it for legal purposes.

I am aware of this, I have visited sqlite.org before asking on the mailing list.

>There's a list of well-known users here:

>

My question is about a complete list (eventually published by Hwaci or DRH as 
main developer, if such information isn't considered private). My reasons for 
asking is that sometimes it would be just easier and painless to match the name 
of a company / software product against that list instead of explicitly asking 
about that. 

>I don't think there's much a company could do to misuse SQLite.

By no means I have asked the initial question in this context. Like I said, 
it's just plain curiousity, as in "company Foo that makes this proprietary 
software Bar is using SQLite, the complete list of companies who bought 
licenses is on sqlite.org and mentions company Foo, so company Foo does is 
right (from an ethical point of view), I'll give preference to company Foo 
because of it".
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Not sure how to interrupt this

2012-06-29 Thread Jeff Archer
>Igor Tandetnik itandetnik at mvps.org Thu Jun 28 09:38:27 EDT 2012
>My guess is that a) you have prepared your statement with
sqlite3_prepare_v2 (as opposed to sqlite3_prepare)...
Statement was prepared with sqlite3_prepare16_v2()
Database file was created only moments earlier.

Jeff Archer
Nanotronics Imaging
jsarc...@nanotronicsimaging.com
<330>819.4615
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Not sure how to interrupt this

2012-06-29 Thread Jeff Archer
>Marc L. Allen mlallen at outsitenetworks.com Thu Jun 28 09:31:40 EDT 2012
>I think he wants to know why he is receiving what appears to be an error
notification via the callback.

>Adam DeVita adevita at verifeye.com Thu Jun 28 09:04:44 EDT 2012
>What is the problem?

Yes, the error message through the SQLITE_CONFIG_LOG callback is
inconsistent with the success indicated by SQLITE_DONE.

Jeff Archer
Nanotronics Imaging
jsarc...@nanotronicsimaging.com
<330>819.4615
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Simon Slavin

On 29 Jun 2012, at 12:47pm, Dennis Volodomanov  wrote:

> Ok, tried using the shell and the result is the same as using my app.
> 
> What I did is:
> 
> 1) delete the database file ("mydbname.ext") from the DOS prompt, make sure 
> the file is not there
> 2) run "sqlite3 .\mydbname.ext" from within that same folder, same DOS prompt
> 3) type .dump
> 4) see entries in this DB, which should be impossible, since the file wasn't 
> there and I've issued no commands using the shell tool

When you're deleting the database file, look for any other files in the same 
folder with names that start with "mydbname" and anything after that, including 
any extension.  (Marcus's theory)  Tell us what they're called.

Make sure you're quitting the shell tool with '.quit', not just CTRL-C ing out 
of it.

First try the above two.  If they don't explain what's wrong,

Using the shell tool, delete one of the rows which has magically appeared.  Or 
even the whole table.  Make another row or table with different data in.  Then 
repeat the quit & delete procedure.

When you go back into the shell tool, do you get the same old bad data or the 
new bad data ?

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

On 29/06/2012 9:45 PM, Marcus Grimm wrote:

Just a quess: Are you using wal mode ?
And how to you "delete" the DB ? Are you removing also any journal or 
-wal files (if any) ?




Yes, WAL mode and I do clear out all files.

   Dennis

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

Ok, tried using the shell and the result is the same as using my app.

What I did is:

1) delete the database file ("mydbname.ext") from the DOS prompt, make 
sure the file is not there
2) run "sqlite3 .\mydbname.ext" from within that same folder, same DOS 
prompt

3) type .dump
4) see entries in this DB, which should be impossible, since the file 
wasn't there and I've issued no commands using the shell tool


Weird?

   Dennis

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Marcus Grimm



On 29.06.2012 13:42, Dennis Volodomanov wrote:

On 29/06/2012 9:25 PM, Simon Slavin wrote:

Your app or the shell tool is running while you delete the file, or do you 
quit, delete, then restart them ?

When you specify the database file to open are you specifying a full path, from 
the 'C:\' on down, or are you relying
on some default folder being specified by something ? The usual trick is that 
your application is opening a database
from one folder, the shell tool is opening the database from another folder, 
and the one you're deleting is one or
none of them. Make sure everything specifies the full path, just until you've 
figured out this problem.


It's all fully-qualified paths, no default folders :) And yes, the db is 
deleted when everything is closed (and checked
using Task Manager).


It's probably best to start off by assuming that the SQLite shell tool does 
exactly what it's documented to do 100% of
the time. There are thousands of users of it out there and a bug like you 
describe would have been reported to this
list many times by now.

You should be able to use a database file as a messaging system. Put a row in 
it using the shell tool, then read it
out using your app and make sure it has the right value. Then put a row in it 
using your app and read it out using the
shell tool. If that's not working, they're opening different files, your app is 
buggy, or you have a hardware failure
of some sort.




What's weird here (I'll just re-instate it) is that when a DB is created from 
within the app, it seems to inherit some
entries from an already deleted DB. I'm not sure how that's possible, but it 
appears to be what I'm seeing (if the .dump
command in sqlite shell is reporting the truth, which I do assume it does).


Just a quess: Are you using wal mode ?
And how to you "delete" the DB ? Are you removing also any journal or -wal 
files (if any) ?

Marcus



I'll try to reproduce this using the shell tool (creating the DB) and see what 
happens.

Dennis

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



--
Marcus Grimm
MedCom GmbH Darmstadt, Rundeturmstr. 12, 64283 Darmstadt
Tel: +49(0)6151-95147-10
Fax: +49(0)6151-95147-20
web: www.medcom-online.de
--

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

On 29/06/2012 9:25 PM, Simon Slavin wrote:

Your app or the shell tool is running while you delete the file, or do you 
quit, delete, then restart them ?

When you specify the database file to open are you specifying a full path, from 
the 'C:\' on down, or are you relying on some default folder being specified by 
something ?  The usual trick is that your application is opening a database 
from one folder, the shell tool is opening the database from another folder, 
and the one you're deleting is one or none of them.  Make sure everything 
specifies the full path, just until you've figured out this problem.


It's all fully-qualified paths, no default folders :) And yes, the db is 
deleted when everything is closed (and checked using Task Manager).



It's probably best to start off by assuming that the SQLite shell tool does 
exactly what it's documented to do 100% of the time.  There are thousands of 
users of it out there and a bug like you describe would have been reported to 
this list many times by now.

You should be able to use a database file as a messaging system.  Put a row in 
it using the shell tool, then read it out using your app and make sure it has 
the right value.  Then put a row in it using your app and read it out using the 
shell tool.  If that's not working, they're opening different files, your app 
is buggy, or you have a hardware failure of some sort.




What's weird here (I'll just re-instate it) is that when a DB is created 
from within the app, it seems to inherit some entries from an already 
deleted DB. I'm not sure how that's possible, but it appears to be what 
I'm seeing (if the .dump command in sqlite shell is reporting the truth, 
which I do assume it does).


I'll try to reproduce this using the shell tool (creating the DB) and 
see what happens.


   Dennis

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Simon Slavin

On 29 Jun 2012, at 11:57am, Dennis Volodomanov  wrote:

> What I found is that after I delete the database file (using Windows explorer 
> or from the command-line, doesn't matter - this is all on Windows 7 x64) and 
> then let my application re-create it as normal, it already contains some 
> entries!

Your app or the shell tool is running while you delete the file, or do you 
quit, delete, then restart them ?

When you specify the database file to open are you specifying a full path, from 
the 'C:\' on down, or are you relying on some default folder being specified by 
something ?  The usual trick is that your application is opening a database 
from one folder, the shell tool is opening the database from another folder, 
and the one you're deleting is one or none of them.  Make sure everything 
specifies the full path, just until you've figured out this problem.

> It's like the file is not created from scratch, but rather pulled from some 
> Windows cache, but only parts of it (doesn't make sense, as the integrity 
> check succeeds). So, the file would have all the proper tables, but the .dump 
> command in sqlite's utility would should an INSERT that's impossible to 
> happen as well mid-way through creating tables. I have table creation 
> surrounded by an explicit transaction and it happens before anything else can 
> happen and I've triple-stepped through my code just to make sure I'm not 
> crazy :) Possibly, this weird (can't say corrupt, just weird) file is what's 
> causing the strange SELECTs.
> 
> As a test, I've renamed the db inside my application, so that it's not 
> re-using the filename all the time and this time the .dump showed all the 
> correct CREATE TABLE statements, without any rubbish in between.

It's probably best to start off by assuming that the SQLite shell tool does 
exactly what it's documented to do 100% of the time.  There are thousands of 
users of it out there and a bug like you describe would have been reported to 
this list many times by now.

You should be able to use a database file as a messaging system.  Put a row in 
it using the shell tool, then read it out using your app and make sure it has 
the right value.  Then put a row in it using your app and read it out using the 
shell tool.  If that's not working, they're opening different files, your app 
is buggy, or you have a hardware failure of some sort.

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


Re: [sqlite] Complete list of companies that bought SQLite licenses?

2012-06-29 Thread Simon Slavin

On 29 Jun 2012, at 11:11am, Peter Volkis  wrote:

> My question is about a complete list [snip]

It'll never happen.  Nobody knows who uses SQLite in one of their products.  
The only reason people know I use SQLite is I'm not a brilliant programmer so 
I've had to ask questions about how to do things with it.

> Like I said, it's just plain curiousity, as in "company Foo that makes this 
> proprietary software Bar is using SQLite, the complete list of companies who 
> bought licenses is on sqlite.org and mentions company Foo, so company Foo 
> does is right (from an ethical point of view), I'll give preference to 
> company Foo because of it".

Well, from the web site you now know that buying a license is not a requirement 
for ethical use of SQLite, because SQLite is public domain.  The only reason 
licenses are sold is that some companies won't do anything without a record of 
legal entitlement.

Ethical use of SQLite would be more like reporting bugs and/or contributing 
patches that fix bugs.  Or helping other people figure out how to use it 
efficiently to do what they want.

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-29 Thread Dennis Volodomanov

Ok, back on this topic.

I've discovered one issue that is possibly the cause of this whole 
weirdness, but I can't explain what's going on. Perhaps someone has seen 
this happen.


What I found is that after I delete the database file (using Windows 
explorer or from the command-line, doesn't matter - this is all on 
Windows 7 x64) and then let my application re-create it as normal, it 
already contains some entries! It's like the file is not created from 
scratch, but rather pulled from some Windows cache, but only parts of it 
(doesn't make sense, as the integrity check succeeds). So, the file 
would have all the proper tables, but the .dump command in sqlite's 
utility would should an INSERT that's impossible to happen as well 
mid-way through creating tables. I have table creation surrounded by an 
explicit transaction and it happens before anything else can happen and 
I've triple-stepped through my code just to make sure I'm not crazy :) 
Possibly, this weird (can't say corrupt, just weird) file is what's 
causing the strange SELECTs.


As a test, I've renamed the db inside my application, so that it's not 
re-using the filename all the time and this time the .dump showed all 
the correct CREATE TABLE statements, without any rubbish in between.


I don't know where to head at this point.

   Dennis

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


Re: [sqlite] Latest SQLite version for Java

2012-06-29 Thread Stephan Beal
On Fri, Jun 29, 2012 at 8:36 AM, stefanos sofroniou <
stefanossofroniou...@yahoo.com> wrote:

> I have searched a bit how to use SQLite's latest version in Java and
> unfortunately did not find anything other than SQLiteJDBC (which is really
> outdated) and sqlite4java (which has not released any update for about a
> year now).
>

FWIW: having not released anything in a year does not mean much in this
case. i have C++ wrappers for sqlite3 which i have not updated in 3+ years
because sqlite3 still works the same as back then.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users