Re: [sqlite] Database Corrupted!

2013-05-28 Thread Thanumalayan Sankaranarayana Pillai
Woody, this mailing list might not be the best place to discuss problems
with YAFFS2. Saying that, a simple test could be to almost fully fill the
YAFFS2 partition with a bunch of files, then read those files and make sure
the files have the data they are supposed to have. Files should have
sensible content in them (and are not just filled with zeroes). Also, I'm
assuming that you already have some experience with YAFFS2, correct?
Otherwise, maybe there is some requirement you haven't satisfied, like
erasing all of your partition prior to using it?


On Mon, May 27, 2013 at 11:44 PM, Woody Wu  wrote:

> On Tue, May 28, 2013 at 03:08:55AM +0100, Simon Slavin wrote:
> >
> > On 28 May 2013, at 2:37am, Woody Wu  wrote:
> >
> > > How do you guys think about this: if NAND has an
> > > IO problem, Yaffs2 should recover it or forward the error to
> > > applications, right?
> >
> > Arguably.  The file system can send an error back to the application.
> > If something does that to SQLite3 SQLite3 will then return the result
> > SQLITE_IOERR.  If your program is correctly looking at the results
> > returned from every SQLite3 API call, and it's not seeing that error,
> > it would seem that yaffs2 is not doing the correct thing in this case.
> > And from what you wrote it seems that rather than return an error to
> > the program, yaffs2 prefers to write an error message to the console.
> > Which is not what these things are meant to do.
> >
> >
> > On 28 May 2013, at 2:40am, Woody Wu  wrote:
> >
> > > Can you experts explains why a cheap Flash drive can harm an
> > > application such as sqlite?
> >
> > > Does you mean these cheap drive was cheating
> > > with ECC?
> >
> > It might just be so bad that it doesn't even realise something is
> > wrong.  You write something to sector 2336 and later read sector 2336
> > and expect to get the same thing back, but instead it returns the
> > contents of sector 2338.  Faulty hardware, perhaps.
> >
> > > Otherwise, filesystem should be able to capture IO error (fix
> > > it or forward), right?
> >
> > If by 'forward' you mean to tell the application something went wrong,
> > then right.  But the file system might not know anything is wrong.  It
> > asked for sector 2336 and it got some data.  How is it meant to know
> > the data it retrieved came from the wrong place on the chip ?
> >
> > On 28 May 2013, at 2:33am, Woody Wu  wrote:
> >
> > > How can I tell what's the current VFS that I was using? Thanks.
> >
> > Actually, just ignore that.  You couldn't do anything about it even if
> > you knew.  From what Doctor Hipp wrote, I suspect that yaffs2 is
> > faulty.
> >
> > Simon.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
> Very clear explained, Simon.  Thanks.
>
> On the other hand, I still want to write some test code to exposure
> Yaffs2's defects on my target.  I already wrote a simple one, which just
> repeatly write to a file and read back to compare its conents. Probably
> it's too simple to trigger an error. After 72 hours, it haven't reported
> any error.  I really like to hear any suggestion on writing such a test
> from your experts.  Anyway, if the original case was really caused by
> Yaffs2, I belive there must exist a test to capture it.  Do you agree?
>
> -woody
>
>
>
>
>
> --
> woody
> I can't go back to yesterday - because I was a different person then.
> ___
> 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] Correct way to open multiple in memory databases

2013-05-28 Thread Roland Hughes
Sorry for top post, client site forces worthless MS email on me.

"Works" would require a politician dictionary.  ":memory:" is a one-shot 
wonder.  The example from the documentation allowed multiple threads to use the 
_same_ in memory database.


From: sqlite-users-boun...@sqlite.org on behalf of Simon Slavin
Sent: Friday, May 24, 2013 4:11 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Correct way to open multiple in memory databases

On 24 May 2013, at 7:06pm, Stephan Beal  wrote:

> On Fri, May 24, 2013 at 5:03 PM, Roland Hughes
> wrote:
>
>> "file:memdb1?mode=memory&cache=shared",
>>
>> It ends up creating files in the executable directory.
>
> Have you tried using ":memory:"? Each instance of an in-memory db opened
> that way is unique, despite the non-unique name:

Yes, Roland, please check to see whether this works.  It won't give you shared 
cache but it's a good test to figure out what's wrong.

The example Roland used, by the way is straight from the SQLite documentation:



near the bottom.  That's probably why he feels it should work.

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


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread Roland Hughes
Your response doesn't say anything useful.

When *WE* tell you the kit required for the project, it is just that, the kit 
required for the project.  Given the rules and regulations for this project the 
kit must be as is without hacks.  The target will run roughly 12 years without 
modification unless a catastrophic bug is found.  Given that such an issue 
rarely shows up within the first 5 years the rules and regs require publicly 
available archives.  No personal hacks or desk drawer builds allowed.

From: sqlite-users-boun...@sqlite.org on behalf of Richard Hipp
Sent: Friday, May 24, 2013 1:27 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Correct way to open multiple in memory databases

On Fri, May 24, 2013 at 1:14 PM, Roland Hughes
wrote:

> I have whatever came with Qt 4.8.x and Linux Mint 13 KDE
>

That doesn't tell us anything useful.

What actions have *YOU* taken to enable URI filenames.  If you haven't
taken any actions, then (as described in the documentation) URI filenames
are disabled for backwards compatibility and the in-memory database naming
scheme you used will not work.

Please follow the instructions for enabling URI filenames and try again.

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


[sqlite] Exact content of a column in a row

2013-05-28 Thread Dave Wellman
Hi,

 

Is there a way to extract the content of a column/row in its 'stored' format
- i.e. the actual bytes?  So that it's 'fairly' easy to read! I have a
utility that will look at the hex bytes of any file, but the entire database
is (understandably) quite complex.

 

Let me explain the problem that I'm facing and someone might point me in a
better direction.

 

I found that a SELECT statement was not returning all of the rows as
expected. The query selected rows from a table "where QUERYID = 1". 

 

Using the sqlite3 shell program:

If I ran a simple "SELECT * FROM table;" then all expected rows were
returned - hence the rows were in the table.

Looking at the output from the query the QUERYID column contains a value of
1 for all rows (as expected).

However, if I ran "SELECT QUERYID,COUNT(*) FROM table GROUP BY 1;" I get two
rows in my answer set. They both 'look' like they contain a value of 1, but
obviously they are different to the dbms. 

 

It would seem for instance as if some rows have a value of 1 (numeric)
whilst others might be ' 1' or '1 ' (both text with differing spaces - hence
different ot the dbms). The QUERYID column is defined as INTEGER - but
effectively sqlite3 ignores this and looks at the data value itself.

 

Hence my question above, is there a way that I can extract the 'real'
content (i.e. the bytes) from each row? 

 

I have worked around the problem.

I noted above that  a query such as "SELECT QUERYID,COUNT(*) FROM table
GROUP BY 1;" gave two result rows. I worked out that on the table rows
counted in one group were inserted by selecting the QUERYID value from
another table (using an INSERT/SELECT) and the table rows counted in the
second group the value was directly inserted from my program using a
parameterised insert. I'm going through an intermediate layer dll (the
sqlite3 plus com dll from eztools). I changed my ' parameterised insert ' so
that I build the QUERYID value into the sql text itself - but I'd like to
try and understand what happened.

 

All help much appreciated.

 

Cheers,

Dave

 

 

Ward Analytics Ltd - information in motion

Tel: +44 (0) 118 9740191

Fax: +44 (0) 118 9740192

www:   http://www.ward-analytics.com

 

Registered office address: The Oriel, Sydenham Road, Guildford, Surrey,
United Kingdom, GU1 3SR

Registered company number: 3917021 Registered in England and Wales.

 

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


Re: [sqlite] Exact content of a column in a row

2013-05-28 Thread Igor Tandetnik

On 5/28/2013 8:06 AM, Dave Wellman wrote:

However, if I ran "SELECT QUERYID,COUNT(*) FROM table GROUP BY 1;" I get two
rows in my answer set. They both 'look' like they contain a value of 1, but
obviously they are different to the dbms.


Try this:

select QUERYID, typeof(QUERYID), hex(QUERYID), len(QUERYID), count(*)
from MyTable group by 1;

This should collect enough information to determine the actual contents 
of the column. Post the results here if you have difficulty interpreting 
them.

--
Igor Tandetnik

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


Re: [sqlite] Exact content of a column in a row

2013-05-28 Thread kyan
On Tue, May 28, 2013 at 3:06 PM, Dave Wellman
wrote:

> Is there a way to extract the content of a column/row in its 'stored'
> format
> - i.e. the actual bytes?  So that it's 'fairly' easy to read! I have a
> utility that will look at the hex bytes of any file, but the entire
> database
> is (understandably) quite complex.
>
>
>
> Let me explain the problem that I'm facing and someone might point me in a
> better direction.
> 
>
>
Maybe the typeof() function could help?

http://www.sqlite.org/lang_corefunc.html#typeof

For instance:

create table test (col);
insert into test values (1);
insert into test values ('1');
insert into test values (1.0);
select col, typeof(col) as type from test;

col type
1integer
1text
1real

and for a possible data fix:

update test set col = cast(trim(col) as integer) where typeof(col) <>
'integer';
select col, typeof(col) as type from test;

col type
1integer
1integer
1integer

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


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread Simon Slavin

On 28 May 2013, at 1:05pm, Roland Hughes  wrote:

> Your response doesn't say anything useful.
> 
> When *WE* tell you the kit required for the project, it is just that, the kit 
> required for the project.  Given the rules and regulations for this project 
> the kit must be as is without hacks.  The target will run roughly 12 years 
> without modification unless a catastrophic bug is found.  Given that such an 
> issue rarely shows up within the first 5 years the rules and regs require 
> publicly available archives.  No personal hacks or desk drawer builds allowed.

What Richard is telling you is that the form of URI you've used will work fine 
with SQLite as long as you have enabled URIs by using one of the conditions 
listed in section 2.0 here:



These are not hacks, they're how SQLite >= 3.7.7 works, and they're the normal 
way to make what you want happen.  If you don't have any of those things, you 
get the behaviour you listed in your OP.  If you do have one or more of them, 
and you still have the problem listed in your OP, then we have something to 
investigate.

There's no expected problem with SQLite3 running for 12 years, by the way.  I 
have a GPS unit older than that that uses SQLite to maintain Positions Of 
Interest.  No problems.

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


Re: [sqlite] Exact content of a column in a row

2013-05-28 Thread Simon Slavin

On 28 May 2013, at 1:06pm, Dave Wellman  wrote:

> Using the sqlite3 shell program:
> 
> If I ran a simple "SELECT * FROM table;" then all expected rows were
> returned - hence the rows were in the table.
> 
> Looking at the output from the query the QUERYID column contains a value of
> 1 for all rows (as expected).
> 
> However, if I ran "SELECT QUERYID,COUNT(*) FROM table GROUP BY 1;" I get two
> rows in my answer set. They both 'look' like they contain a value of 1, but
> obviously they are different to the dbms. 

In addition to Dave and kyan's suggestions, you might like to try

SELECT rowid,* FROM table

which should let you identify which rows have which problems.  As far as I 
know, there's no easy way to extract the 'raw' data for a row using the SQLite 
API.

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


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread Igor Tandetnik

On 5/28/2013 8:05 AM, Roland Hughes wrote:

Your response doesn't say anything useful.

When *WE* tell you the kit required for the project, it is just that, the kit 
required for the project.  Given the rules and regulations for this project the 
kit must be as is without hacks.  The target will run roughly 12 years without 
modification unless a catastrophic bug is found.  Given that such an issue 
rarely shows up within the first 5 years the rules and regs require publicly 
available archives.  No personal hacks or desk drawer builds allowed.


Do those rules and regulations prohibit your application from calling 
sqlite3_config(SQLITE_CONFIG_URI, 1), or using sqlite3_open_v2() with 
SQLITE_OPEN_URI flag to open the database?

--
Igor Tandetnik

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


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread Kevin Benson
On Tue, May 28, 2013 at 7:57 AM, Roland Hughes
wrote:

> ":memory:" is a one-shot wonder.  The example from the documentation
> allowed multiple threads to use the _same_ in memory database.
>


Am I not understanding the explanation on that page correctly? My
understanding would be that

"file:memdb1?mode=memory&cache=shared"

is aimed at a single process having access to two or more distinct but
shareable in-memory databases.

"If two or more distinct but shareable in-memory databases are needed in a
single process, then the mode=memory
query parameter can be used
with a URI
filename  to create a named in-memory
database:"
--
   --
  --
 --Ô¿Ô--
K e V i N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Documentation license

2013-05-28 Thread Jan Staněk

Hello,
as a maintainer of sqlite in Fedora, I recently found out that the 
license of the sqlite documentation is not specified - the web page only 
states that documentation or its parts may be licensed under various 
licenses, and that the details are unclear.


Recently a bug was opened (see [1]), claiming that in reporter's opinion 
the sqlite documentation is non-free and not distributable, thus 
unsuitable for packaging in Fedora.


Could someone please clarify this issue?

Regards,
Jan Stanek

[1] https://bugzilla.redhat.com/show_bug.cgi?id=967280
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread Kevin Benson
On Tue, May 28, 2013 at 8:31 AM, Kevin Benson wrote:

> On Tue, May 28, 2013 at 7:57 AM, Roland Hughes <
> rhug...@cincinnati-test.com> wrote:
>
>> ":memory:" is a one-shot wonder.  The example from the documentation
>> allowed multiple threads to use the _same_ in memory database.
>>
>
>
> Am I not understanding the explanation on that page correctly? My
> understanding would be that
>
> "file:memdb1?mode=memory&cache=shared"
>
> is aimed at a single process having access to two or more distinct but
> shareable in-memory databases.
>
> "If two or more distinct but shareable in-memory databases are needed in a
> single process, then the 
> mode=memoryquery parameter can be used 
> with a URI
> filename  to create a named in-memory
> database:"
>

Okay, I rechecked the thread and confirmed that was what Roland is seeking.
Sorry for the noise.
--
   --
  --
 --Ô¿Ô--
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] Exact content of a column in a row

2013-05-28 Thread kyan
On Tue, May 28, 2013 at 3:26 PM, kyan  wrote:

>
> On Tue, May 28, 2013 at 3:06 PM, Dave Wellman  > wrote:
>
>> Is there a way to extract the content of a column/row in its 'stored'
>> format
>> - i.e. the actual bytes?  So that it's 'fairly' easy to read! I have a
>> utility that will look at the hex bytes of any file, but the entire
>> database
>> is (understandably) quite complex.
>>
>>
>>
>> Let me explain the problem that I'm facing and someone might point me in a
>> better direction.
>> 
>>
>>
> Maybe the typeof() function could help?
> 
>

Also, in order to troubleshoot your application(s), script(s) etc. that
modify the database and find the piece of code that inserts a value of the
wrong type you can create two triggers on your table:

CREATE TRIGGER BI_TEST BEFORE INSERT ON test FOR EACH ROW
BEGIN
  SELECT CASE
WHEN (typeof (new.col) <> 'integer') THEN
  RAISE(FAIL, 'Invalid type inserted')
END;
END;

CREATE TRIGGER BU_TEST BEFORE UPDATE OF col ON test FOR EACH ROW
BEGIN
  SELECT CASE
WHEN (typeof (new.col) <> 'integer') THEN
  RAISE(FAIL, 'Invalid type inserted')
END;
END;

You can keep them until you run the app/scripts and locate the problem (you
will get an error at exactly that command) and then drop them or keep them
permanently to ensure that you will never have a value of the wrong type.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Documentation license

2013-05-28 Thread Richard Hipp
On Tue, May 28, 2013 at 8:37 AM, Jan Staněk  wrote:

> Hello,
> as a maintainer of sqlite in Fedora, I recently found out that the license
> of the sqlite documentation is not specified - the web page only states
> that documentation or its parts may be licensed under various licenses, and
> that the details are unclear.
>
> Recently a bug was opened (see [1]), claiming that in reporter's opinion
> the sqlite documentation is non-free and not distributable, thus unsuitable
> for packaging in Fedora.
>
> Could someone please clarify this issue?
>

Many years ago, there were pieces of documentation of unknown provenance.
But all of that has been removed now.  The SQLite documentation, as with
the SQLite source code, is public domain.  We have in our firesafe signed
affidavits from all documentation authors releasing their work into the
public domain.


-- 
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] Documentation license

2013-05-28 Thread Jan Staněk

Dne 28.5.2013 14:53, Richard Hipp napsal(a):

On Tue, May 28, 2013 at 8:37 AM, Jan Staněk  wrote:


Hello,
as a maintainer of sqlite in Fedora, I recently found out that the license
of the sqlite documentation is not specified - the web page only states
that documentation or its parts may be licensed under various licenses, and
that the details are unclear.

Recently a bug was opened (see [1]), claiming that in reporter's opinion
the sqlite documentation is non-free and not distributable, thus unsuitable
for packaging in Fedora.

Could someone please clarify this issue?



Many years ago, there were pieces of documentation of unknown provenance.
But all of that has been removed now.  The SQLite documentation, as with
the SQLite source code, is public domain.  We have in our firesafe signed
affidavits from all documentation authors releasing their work into the
public domain.




Thank you very much for clarifying. May I suggest update of the webpage 
http://www.sqlite.org/copyright.html to reflect current state? It would 
help preventing similar "bug reports".


In any case, thanks for fast reply.

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


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread Keith Medcalf

It should be "is aimed at a single process having access to one or more 
distinct but shareable in-memory databases"

The keys are that you have neither shared cache nor named in-memory databases 
without URI filenames.  Therefore, each connection opening a memory database 
will get a unique memory database for that connection.  

The URI format allows you to "name" the memory database and to "share" the 
cache between connections (effectively permitting you to open multiple 
connections to the same in memory database from within the same process.

---
()  ascii ribbon campaign against html e-mail
/\  www.asciiribbon.org

> -Original Message-
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Kevin Benson
> Sent: Tuesday, 28 May, 2013 06:31
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Correct way to open multiple in memory databases
> 
> On Tue, May 28, 2013 at 7:57 AM, Roland Hughes
> wrote:
> 
> > ":memory:" is a one-shot wonder.  The example from the documentation
> > allowed multiple threads to use the _same_ in memory database.
> >
> 
> 
> Am I not understanding the explanation on that page correctly? My
> understanding would be that
> 
> "file:memdb1?mode=memory&cache=shared"
> 
> is aimed at a single process having access to two or more distinct but
> shareable in-memory databases.
> 
> "If two or more distinct but shareable in-memory databases are needed in a
> single process, then the mode=memory
> query parameter can be used
> with a URI
> filename  to create a named in-memory
> database:"
> --
>--
>   --
>  --Ô¿Ô--
> K e V i N
> ___
> 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] Documentation license

2013-05-28 Thread Richard Hipp
On Tue, May 28, 2013 at 9:04 AM, Jan Staněk  wrote:

> . May I suggest update of the webpage http://www.sqlite.org/copyright.htmlto 
> reflect current state? It would help preventing similar "bug reports".
>

Is the revised language on http://www.sqlite.org/copyright.html adequate?

-- 
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] Documentation license

2013-05-28 Thread Jan Staněk

Dne 28.5.2013 15:25, Richard Hipp napsal(a):

On Tue, May 28, 2013 at 9:04 AM, Jan Staněk  wrote:


. May I suggest update of the webpage http://www.sqlite.org/copyright.htmlto reflect 
current state? It would help preventing similar "bug reports".



Is the revised language on http://www.sqlite.org/copyright.html adequate?


I'm no lawyer, but I believe it is. Thank you very much for cooperation.

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


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread rol...@logikalsolutions.com
Correct.  We must not drop below the Qt interface level.

> On May 28, 2013 at 7:29 AM Igor Tandetnik  wrote:
>
>
> On 5/28/2013 8:05 AM, Roland Hughes wrote:
> > Your response doesn't say anything useful.
> >
> > When *WE* tell you the kit required for the project, it is just that, the
> > kit required for the project. Given the rules and regulations for this
> > project the kit must be as is without hacks. The target will run roughly 12
> > years without modification unless a catastrophic bug is found. Given that
> > such an issue rarely shows up within the first 5 years the rules and regs
> > require publicly available archives. No personal hacks or desk drawer builds
> > allowed.
>
> Do those rules and regulations prohibit your application from calling
> sqlite3_config(SQLITE_CONFIG_URI, 1), or using sqlite3_open_v2() with
> SQLITE_OPEN_URI flag to open the database?
> --
> Igor Tandetnik
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Roland Hughes, President
Logikal Solutions
(630)-205-1593 - cell
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread rol...@logikalsolutions.com
There is/was additional documentation which stated multiple threads within the
same process could open that same connection and share the cache.  I'm not
talking about program A sharing a memory database with Program B, but rather
threads 32, 55, 126, and 84 of Program A being able to open and close on demand.

> On May 28, 2013 at 7:31 AM Kevin Benson  wrote:
>
>
> On Tue, May 28, 2013 at 7:57 AM, Roland Hughes
> wrote:
>
> > ":memory:" is a one-shot wonder. The example from the documentation
> > allowed multiple threads to use the _same_ in memory database.
> >
>
>
> Am I not understanding the explanation on that page correctly? My
> understanding would be that
>
> "file:memdb1?mode=memory&cache=shared"
>
> is aimed at a single process having access to two or more distinct but
> shareable in-memory databases.
>
> "If two or more distinct but shareable in-memory databases are needed in a
> single process, then the mode=memory
> query parameter can be used
> with a URI
> filename  to create a named in-memory
> database:"
> --
> --
> --
> --Ô¿Ô--
> K e V i N
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Roland Hughes, President
Logikal Solutions
(630)-205-1593 - cell
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Force use SMALLINT datatype

2013-05-28 Thread Wang, Gao
Dear all,

I use sqlite to store, query and perform simple math operations on large
datasets of small integers -- all values I have in the dataset are -1, 0, 1
and 2. These integers are stored as INTEGER (4 byte). I desperately need a
way to reduce the size of my database because I have dozens of databases
like this with size ~100G which takes too much of my storage. I'd like some
other integer type for {-1,0,1,2} such as "SMALLINT" (
http://www.sqlite.org/datatype3.html). I understand sqlite data types are
dynamic and it does not make a difference to create a field of type
SMALLINT. I wonder if there are something I can do to fulfill my need.
Anyway to hack into the sqlite.c codes?

Please advice. Thank you!


Kindest regards,
Gao Wang

Student in Statistical Genetics, Baylor College of Medicine
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Force use SMALLINT datatype

2013-05-28 Thread Richard Hipp
On Tue, May 28, 2013 at 10:15 AM, Wang, Gao  wrote:

> Dear all,
>
> I use sqlite to store, query and perform simple math operations on large
> datasets of small integers -- all values I have in the dataset are -1, 0, 1
> and 2. These integers are stored as INTEGER (4 byte). I desperately need a
> way to reduce the size of my database because I have dozens of databases
> like this with size ~100G which takes too much of my storage. I'd like some
> other integer type for {-1,0,1,2} such as "SMALLINT" (
> http://www.sqlite.org/datatype3.html). I understand sqlite data types are
> dynamic and it does not make a difference to create a field of type
> SMALLINT. I wonder if there are something I can do to fulfill my need.
> Anyway to hack into the sqlite.c codes?
>
>
SQLite does not allocate 4 bytes to every integer.  It uses a variable
number of bytes (between 1 and 9) depending on the magnitude of the
integer.  See http://www.sqlite.org/fileformat2.html#record_format for
additional information.  Values of 0 and 1 take 1 bytes.  Values of -1 and
2 take two bytes.

See also the sqlite3_analyzer.exe utility.  Running sqlite3_analyzer.exe on
one of your database files might give you a better idea of where space is
being used.

-- 
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] FW: Exact content of a column in a row

2013-05-28 Thread Dave Wellman
Original reply sent from incorrect email address.

-Original Message-
From: David Wellman [mailto:david.well...@ward-analytics.com] 
Sent: 28 May 2013 14:25
To: 'General Discussion of SQLite Database'
Subject: RE: [sqlite] Exact content of a column in a row

Dear all,

Many thanks for your suggestions. I think the typeof, len and hex functions
will probably give me what I need.

Regards,
Dave


Ward Analytics Ltd - information in motion
Tel: +44 (0) 118 9740191
Fax: +44 (0) 118 9740192
www: http://www.ward-analytics.com

Registered office address: The Oriel, Sydenham Road, Guildford, Surrey,
United Kingdom, GU1 3SR Registered company number: 3917021 Registered in
England and Wales.

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of kyan
Sent: 28 May 2013 13:49
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Exact content of a column in a row

On Tue, May 28, 2013 at 3:26 PM, kyan  wrote:

>
> On Tue, May 28, 2013 at 3:06 PM, Dave Wellman 
>  > wrote:
>
>> Is there a way to extract the content of a column/row in its 'stored'
>> format
>> - i.e. the actual bytes?  So that it's 'fairly' easy to read! I have 
>> a utility that will look at the hex bytes of any file, but the entire 
>> database is (understandably) quite complex.
>>
>>
>>
>> Let me explain the problem that I'm facing and someone might point me 
>> in a better direction.
>> 
>>
>>
> Maybe the typeof() function could help?
> 
>

Also, in order to troubleshoot your application(s), script(s) etc. that
modify the database and find the piece of code that inserts a value of the
wrong type you can create two triggers on your table:

CREATE TRIGGER BI_TEST BEFORE INSERT ON test FOR EACH ROW BEGIN
  SELECT CASE
WHEN (typeof (new.col) <> 'integer') THEN
  RAISE(FAIL, 'Invalid type inserted')
END;
END;

CREATE TRIGGER BU_TEST BEFORE UPDATE OF col ON test FOR EACH ROW BEGIN
  SELECT CASE
WHEN (typeof (new.col) <> 'integer') THEN
  RAISE(FAIL, 'Invalid type inserted')
END;
END;

You can keep them until you run the app/scripts and locate the problem (you
will get an error at exactly that command) and then drop them or keep them
permanently to ensure that you will never have a value of the wrong type.
___
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] Compiling SQLite for Windows Phone 8

2013-05-28 Thread andy
I’d like to generate my own build of SQLite from the amalgamation source for 
use in a WP8 app, but I can’t figure out how to compile it successfully.  
Building for WinRT was as simple as defining SQLITE_OS_WINRT so I expected 
something similar for WP8, but no amount of searching has turned up anything 
like that.  All I could find were a few unanswered questions on Stack 
Overflow[1][2] about people not even being able to build it for WP8 from the 
original sources and makefiles.

 

With no additional defines, compiling against the WP8 platform fails 
spectacularly, which is not surprising.  If I define SQLITE_OS_WINRT then the 
errors are trimmed down to just three about undeclared Windows APIs related to 
file mapping (CreateFileMappingFromApp, MapViewOfFileFromApp, and 
UnmapViewOfFile).  There appears to be some ambiguity about whether or not 
those functions are supposed to be supported by WP8; the documentation for the 
first two says that they are, but the actual SDK headers obviously don’t agree. 
 There’s an MSDN thread[3] noting this mismatch which also notes that SQLite 
both uses these APIs and works on WP8.  A reply there indicates that it may be 
possible to somehow be granted an exception to use those APIs even though the 
SDK doesn’t appear to support them.  Has SQLite been granted such an exception?

 

In any case, it’s clearly possible to build SQLite for WP8 because there’s an 
official distribution of such a build.  What do I have to do to generate one 
myself?  If SQLite has an exception to use APIs not generally available, then 
is it simply not possible for anyone other than an official distributor with 
inside info/headers/something?

 

Thanks a lot!

 

 

[1] http://stackoverflow.com/questions/14074821/build-sqlite-for-windows-phone-8

[2] 
http://stackoverflow.com/questions/14785506/compiling-sqlite-for-windows-phone-8

[3] 
http://social.msdn.microsoft.com/Forums/en-US/wpdevelop/thread/6114f2fe-1543-4121-bb4e-478c36207c5b
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Force use SMALLINT datatype

2013-05-28 Thread Paolo Bolzoni
And double check that you actually VACUUM the db
(manually or via auto vacuum).

On Tue, May 28, 2013 at 4:23 PM, Richard Hipp  wrote:
> On Tue, May 28, 2013 at 10:15 AM, Wang, Gao  wrote:
>
>> Dear all,
>>
>> I use sqlite to store, query and perform simple math operations on large
>> datasets of small integers -- all values I have in the dataset are -1, 0, 1
>> and 2. These integers are stored as INTEGER (4 byte). I desperately need a
>> way to reduce the size of my database because I have dozens of databases
>> like this with size ~100G which takes too much of my storage. I'd like some
>> other integer type for {-1,0,1,2} such as "SMALLINT" (
>> http://www.sqlite.org/datatype3.html). I understand sqlite data types are
>> dynamic and it does not make a difference to create a field of type
>> SMALLINT. I wonder if there are something I can do to fulfill my need.
>> Anyway to hack into the sqlite.c codes?
>>
>>
> SQLite does not allocate 4 bytes to every integer.  It uses a variable
> number of bytes (between 1 and 9) depending on the magnitude of the
> integer.  See http://www.sqlite.org/fileformat2.html#record_format for
> additional information.  Values of 0 and 1 take 1 bytes.  Values of -1 and
> 2 take two bytes.
>
> See also the sqlite3_analyzer.exe utility.  Running sqlite3_analyzer.exe on
> one of your database files might give you a better idea of where space is
> being used.
>
> --
> 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] Database Corrupted!

2013-05-28 Thread Woody Wu
On Tue, May 28, 2013 at 06:31:47AM -0500, Thanumalayan Sankaranarayana Pillai 
wrote:
> Woody, this mailing list might not be the best place to discuss problems
> with YAFFS2. Saying that, a simple test could be to almost fully fill the
> YAFFS2 partition with a bunch of files, then read those files and make sure
> the files have the data they are supposed to have. Files should have
> sensible content in them (and are not just filled with zeroes). Also, I'm
> assuming that you already have some experience with YAFFS2, correct?

No, I don't have any real experience in using YAFFS2. Today, I tried to
subscribe its mailing list, but don't get the confirmation email, wired.

> Otherwise, maybe there is some requirement you haven't satisfied, like
> erasing all of your partition prior to using it?

Interesting...  Could you talk more 'bout that? As I said, the target
system was built by our external vendor, I don't know their process.
Can I check if it's correctly done?  Erasing Yaffs2 means something like 
'mke2fs'
on a ext* file system?  Thanks.

> 
> 
> On Mon, May 27, 2013 at 11:44 PM, Woody Wu  wrote:
> 
> > On Tue, May 28, 2013 at 03:08:55AM +0100, Simon Slavin wrote:
> > >
> > > On 28 May 2013, at 2:37am, Woody Wu  wrote:
> > >
> > > > How do you guys think about this: if NAND has an
> > > > IO problem, Yaffs2 should recover it or forward the error to
> > > > applications, right?
> > >
> > > Arguably.  The file system can send an error back to the application.
> > > If something does that to SQLite3 SQLite3 will then return the result
> > > SQLITE_IOERR.  If your program is correctly looking at the results
> > > returned from every SQLite3 API call, and it's not seeing that error,
> > > it would seem that yaffs2 is not doing the correct thing in this case.
> > > And from what you wrote it seems that rather than return an error to
> > > the program, yaffs2 prefers to write an error message to the console.
> > > Which is not what these things are meant to do.
> > >
> > >
> > > On 28 May 2013, at 2:40am, Woody Wu  wrote:
> > >
> > > > Can you experts explains why a cheap Flash drive can harm an
> > > > application such as sqlite?
> > >
> > > > Does you mean these cheap drive was cheating
> > > > with ECC?
> > >
> > > It might just be so bad that it doesn't even realise something is
> > > wrong.  You write something to sector 2336 and later read sector 2336
> > > and expect to get the same thing back, but instead it returns the
> > > contents of sector 2338.  Faulty hardware, perhaps.
> > >
> > > > Otherwise, filesystem should be able to capture IO error (fix
> > > > it or forward), right?
> > >
> > > If by 'forward' you mean to tell the application something went wrong,
> > > then right.  But the file system might not know anything is wrong.  It
> > > asked for sector 2336 and it got some data.  How is it meant to know
> > > the data it retrieved came from the wrong place on the chip ?
> > >
> > > On 28 May 2013, at 2:33am, Woody Wu  wrote:
> > >
> > > > How can I tell what's the current VFS that I was using? Thanks.
> > >
> > > Actually, just ignore that.  You couldn't do anything about it even if
> > > you knew.  From what Doctor Hipp wrote, I suspect that yaffs2 is
> > > faulty.
> > >
> > > Simon.
> > > ___
> > > sqlite-users mailing list
> > > sqlite-users@sqlite.org
> > > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> > Very clear explained, Simon.  Thanks.
> >
> > On the other hand, I still want to write some test code to exposure
> > Yaffs2's defects on my target.  I already wrote a simple one, which just
> > repeatly write to a file and read back to compare its conents. Probably
> > it's too simple to trigger an error. After 72 hours, it haven't reported
> > any error.  I really like to hear any suggestion on writing such a test
> > from your experts.  Anyway, if the original case was really caused by
> > Yaffs2, I belive there must exist a test to capture it.  Do you agree?
> >
> > -woody
> >
> >
> >
> >
> >
> > --
> > woody
> > I can't go back to yesterday - because I was a different person then.
> > ___
> > 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

-- 
woody
I can't go back to yesterday - because I was a different person then.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread Igor Tandetnik
Well, in this case, I'm afraid you are sadly out of luck. I suppose you 
could lobby Qt to expose those features, or you could lobby Linux Mint 
13 KDE to distribute SQLite library built with SQLITE_USE_URI option.


However, I can't help but wonder: how come it's OK to use a 
SQLite-specific feature, but not OK to use SQLite-specific API to gain 
access to it?


Igor Tandetnik

On 5/28/2013 9:49 AM, 
rol...@logikalsolutions.com wrote:

Correct.  We must not drop below the Qt interface level.


On May 28, 2013 at 7:29 AM Igor Tandetnik  wrote:


On 5/28/2013 8:05 AM, Roland Hughes wrote:

Your response doesn't say anything useful.

When *WE* tell you the kit required for the project, it is just that, the
kit required for the project. Given the rules and regulations for this
project the kit must be as is without hacks. The target will run roughly 12
years without modification unless a catastrophic bug is found. Given that
such an issue rarely shows up within the first 5 years the rules and regs
require publicly available archives. No personal hacks or desk drawer builds
allowed.


Do those rules and regulations prohibit your application from calling
sqlite3_config(SQLITE_CONFIG_URI, 1), or using sqlite3_open_v2() with
SQLITE_OPEN_URI flag to open the database?
--
Igor Tandetnik

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

Roland Hughes, President
Logikal Solutions
(630)-205-1593 - cell
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net




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


Re: [sqlite] Database Corrupted!

2013-05-28 Thread Ryan Johnson

On 27/05/2013 9:40 PM, Woody Wu wrote:

On Mon, May 27, 2013 at 04:31:25PM +0100, Simon Slavin wrote:

On 27 May 2013, at 4:22pm, Woody Wu  wrote:


If Yaffs2 is the cause, how can I write an effective test to exposure it?

Do you have an opportunity to format the same drive in a different format ?  
I'm not telling you to change your long-term practises, just to try a different 
format for testing.  Reformat it, run your identical testing program, and see 
if it fails in the same way.

Also I liked Richard's point: are you testing on a cheap Flash drive ?  Perhaps 
one intended only for use with FAT and therefore only tested for use with FAT ?

Can you experts explains why a cheap Flash drive can harm an
application such as sqlite? Does you mean these cheap drive was cheating
with ECC? Otherwise, filesystem should be able to capture IO error (fix
it or forward), right?
Cheap (aka counterfeit) flash drives are notorious for advertizing more 
space to the OS than they actually have, and so at some point writes 
start to silently erase data that was written earlier.


Ryan

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


Re: [sqlite] Correct way to open multiple in memory databases

2013-05-28 Thread Igor Tandetnik
In case it helps, QSQLiteDriver has a constructor taking sqlite3* 
handle. You could open the database with sqlite3_open_v2, then wrap a 
QSQLiteDriver instance around it.


Igor Tandetnik

On 5/28/2013 9:49 AM, 
rol...@logikalsolutions.com wrote:

Correct.  We must not drop below the Qt interface level.


On May 28, 2013 at 7:29 AM Igor Tandetnik  wrote:


On 5/28/2013 8:05 AM, Roland Hughes wrote:

Your response doesn't say anything useful.

When *WE* tell you the kit required for the project, it is just that, the
kit required for the project. Given the rules and regulations for this
project the kit must be as is without hacks. The target will run roughly 12
years without modification unless a catastrophic bug is found. Given that
such an issue rarely shows up within the first 5 years the rules and regs
require publicly available archives. No personal hacks or desk drawer builds
allowed.


Do those rules and regulations prohibit your application from calling
sqlite3_config(SQLITE_CONFIG_URI, 1), or using sqlite3_open_v2() with
SQLITE_OPEN_URI flag to open the database?
--
Igor Tandetnik

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

Roland Hughes, President
Logikal Solutions
(630)-205-1593 - cell
http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net




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


Re: [sqlite] Database Corrupted!

2013-05-28 Thread Richard Hipp
On Tue, May 28, 2013 at 3:17 PM, Ryan Johnson
wrote:

> Cheap (aka counterfeit) flash drives are notorious for advertizing more
> space to the OS than they actually have, and so at some point writes start
> to silently erase data that was written earlier.


I've heard the same thing, except that the counterfeit flash drives are not
necessarily inexpensive.  They are just counterfeits.



> --
>
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] Database Corrupted!

2013-05-28 Thread Simon Slavin

On 28 May 2013, at 8:30pm, Richard Hipp  wrote:

> On Tue, May 28, 2013 at 3:17 PM, Ryan Johnson
> wrote:
> 
>> Cheap (aka counterfeit) flash drives are notorious for advertizing more
>> space to the OS than they actually have, and so at some point writes start
>> to silently erase data that was written earlier.
> 
> I've heard the same thing, except that the counterfeit flash drives are not
> necessarily inexpensive.  They are just counterfeits.

My department ordered 500 low-capacity Pen Drives with our department logo on.  
The price was reasonable and we're part of a big organisation with a big name 
and big lawyers.  I see no reason Purchasing should have gone to some noname 
dodgy cheap Chinese supplier.  The drives came pre-loaded with our advertising 
material (PDFs, HTML, etc.) but were left writeable, with the intention that 
our potential recruits would use them for the next year or two and carry our 
logo around with them.

Nobody thought to ask me (I'm theoretically in charge of tech) or even tell me 
about the order.

These drives were terrible.  About one in 20 you couldn't even get our own 
material off of without a sector failure.  I picked up some that passed that 
test and us techies used them around the office for the next month.  I don't 
think any of them stood up to more than a couple of weeks without sector 
faults, disk IO errors, and all that stuff.  They had the right capacity, I 
think they just had very low-quality soldering and any heat expansion ruined 
them.  Or maybe they'd used chips which failed testing.

Of course, the company that supplied them were happy to replace any specific 
drives we returned as broken, but refused to replace the who lot, or return our 
money.  I toyed with the idea of returning one drive a day, every working day 
for the next two years.  But I settled for having my boss wave my job 
description under the noses of several other people in our department.

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


Re: [sqlite] Compiling SQLite for Windows Phone 8

2013-05-28 Thread Joe Mistachkin

a...@sourcegear.com wrote:
>
> What do I have to do to generate one myself?  
>

>From a Visual Studio 2012 Phone Tools (you'll need the WP8 SDK) command
prompt,
the following commands should work:

SET NCRTLIBPATH=%ProgramFiles(x86)%\Microsoft Visual Studio
11.0\VC\WPSDK\WP80\lib
SET NSDKLIBPATH=%ProgramFiles(x86)%\Windows Phone Kits\8.0\lib\x86

nmake -f Makefile.msc sqlite3.dll FOR_WINRT=1 USE_RC=0
OPTS="-DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -DSQLITE_OMIT_LOAD_EXTENSION=1
-DSQLITE_WIN32_FILEMAPPING_API=1" 

--
Joe Mistachkin

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


Re: [sqlite] Compiling SQLite for Windows Phone 8 (revised)

2013-05-28 Thread Joe Mistachkin

a...@sourcegear.com wrote:
>
> What do I have to do to generate one myself?  
>

Sorry, slight revision...

>From a Visual Studio 2012 Phone Tools (you'll need the WP8 SDK) command
prompt,
the following commands should work:

SET NCRTLIBPATH=%ProgramFiles(x86)%\Microsoft Visual Studio
11.0\VC\WPSDK\WP80\lib
SET NSDKLIBPATH=%ProgramFiles(x86)%\Windows Phone Kits\8.0\lib\x86

nmake -f Makefile.msc sqlite3.dll XCOMPILE=1 USE_NATIVE_LIBPATHS=1
NO_TCL=1 FOR_WINRT=1 USE_RC=0 OPTS="-DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
-DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_WIN32_FILEMAPPING_API=1" 
 
--
Joe Mistachkin

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


Re: [sqlite] Compiling SQLite for Windows Phone 8 (revised)

2013-05-28 Thread andy
Thanks Joe!

 

It looks like SQLITE_WIN32_FILEMAPPING_API=1 is what I was missing.

 

A related question: Your command includes SQLITE_OMIT_LOAD_EXTENSION=1 and the 
official WP8 build is also built this way.  One of the reasons that I wanted to 
build it myself was to allow extension loading.  Why is the default to disable 
extensions on WP8?  Is there something about the platform that makes extensions 
not work?  With the filemapping flag defined I can build successfully with 
extensions enabled, so it’s not due to a compile-time problem such as 
unsupported APIs.  Is there a runtime issue where loading/using extensions is 
asking for trouble?  I’ll try it out in the morning and see what happens, but 
I’m curious what issue(s) might be lurking.

 

Thanks again!

 


From: Joe Mistachkin
Sent: ‎May‎ ‎28‎, ‎2013 ‎3‎:‎11‎ ‎PM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] Compiling SQLite for Windows Phone 8 (revised)



a...@sourcegear.com wrote:
>
> What do I have to do to generate one myself?  
>

Sorry, slight revision...

>From a Visual Studio 2012 Phone Tools (you'll need the WP8 SDK) command
prompt,
the following commands should work:

SET NCRTLIBPATH=%ProgramFiles(x86)%\Microsoft Visual Studio
11.0\VC\WPSDK\WP80\lib
SET NSDKLIBPATH=%ProgramFiles(x86)%\Windows Phone Kits\8.0\lib\x86

 nmake -f Makefile.msc sqlite3.dll XCOMPILE=1 USE_NATIVE_LIBPATHS=1
NO_TCL=1 FOR_WINRT=1 USE_RC=0 OPTS="-DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP
-DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_WIN32_FILEMAPPING_API=1" 
 
--
Joe Mistachkin

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


Re: [sqlite] Compiling SQLite for Windows Phone 8 (revised)

2013-05-28 Thread Joe Mistachkin

a...@sourcegear.com wrote:
>
> Why is the default to disable extensions on WP8?
>

I'm actually not sure at this point.  Previously, it was disabled due
to lack of the necessary OS APIs.

>
> Is there something about the platform that makes extensions not work?
>

If the extensions are statically linked, things may work fine.  However,
running inside the WinRT sandbox will introduce some complications for
dynamic loading, see:

http://msdn.microsoft.com/en-us/library/windows/desktop/hh447159%28v=vs.85%2
9.aspx

--
Joe Mistachkin

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