Re: [sqlite] sqlite3_step

2007-07-05 Thread Dan Kennedy
On Thu, 2007-07-05 at 18:26 -0300, Bruno S. Oliveira wrote:
> Hi all,
> 
> I'm having problems with the sqlite3_step function.
> I have a table with only one record and then I execute the
> sqlite3_step twice (with some processing in between). In the first run
> of the function everything goes fine, but, in the second one, it
> returns SQLITE_ROW even with only one record in the table and with no
> modifications in the SQL statement.
> Is this the correct behaviour of that function? Does anyone knows why
> this happens?
> 
> I'm using the sqlite3_prepare before executing the sqlite3_step.

Could be a few things. If you post the problematic code somebody 
will be able to help you.

Dan.



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] FTS and upgrades

2007-07-05 Thread Dan Kennedy
On Thu, 2007-07-05 at 21:08 -0700, Dave Brown wrote:
> I am considering using FTS for a new feature. My question is:
> 
> - If I use fts1 (or fts2) now, and then a new version of fts comes out which
> is not backwards compatible, will I at least be able to upgrade users by
> simply deleting the old FTS table and re-building it using the new FTS
> system?
> 
> In other words, my users will have a database file built with fts1, then my
> new upgraded code (which contains sqlite with fts3, for example) will try to
> upgrade them by deleting the fts1 table, and creating a new table.
> 
> Will the delete of the old table at least be guaranteed to work?

fts1 and fts2 are separate extensions that happen to do similar things.
You can load them both at the same time and have a single database
connection access both fts1 and fts2 tables. The same should be
true with fts3.

Dan. 


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] FTS and upgrades

2007-07-05 Thread Dave Brown

I am considering using FTS for a new feature. My question is:

- If I use fts1 (or fts2) now, and then a new version of fts comes out which
is not backwards compatible, will I at least be able to upgrade users by
simply deleting the old FTS table and re-building it using the new FTS
system?

In other words, my users will have a database file built with fts1, then my
new upgraded code (which contains sqlite with fts3, for example) will try to
upgrade them by deleting the fts1 table, and creating a new table.

Will the delete of the old table at least be guaranteed to work?

Thank you.


RE: [sqlite] sqlite testing with Boundschecker

2007-07-05 Thread James Dennett
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Sunday, July 01, 2007 11:11 AM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] sqlite testing with Boundschecker
> 
> "Damian Slee" <[EMAIL PROTECTED]> wrote:
> >
> > I have done some testing with 3.2 and now 3.4, visual studio2003 and
> > boundschecker (and XP).
> 
> Thank you for the report.
> 
> I have analyzed the errors reported by boundschecker and they
> all appear to be false postives.  The SQLite 3.4.0 code base
> is correct in all cases and boundchecker is complaining about
> problems that do not exist.
> 
> The following is typical:
> 
> >
> > Dangling Pointer: Pointer 0x010D9250, allocated by HeapAlloc, has
> already
> > been freed.
> >
> > Vdbe.c sqlite3VdbeExec Line 469
> >
> >   if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE;
> >   assert( db->magic==SQLITE_MAGIC_BUSY );
> >   [pTos = p->pTos;]
> >   if( p->rc==SQLITE_NOMEM ){
> >
> 
> There are two pointers on the offending line: "p" and "pTos".  The
> p pointer appears to be valid.  Otherwise, the "return SQLITE_MISUSE"
> two lines above would have be taken.  Or at worst, the dereference
> of p two lines above should have triggered a similar error.  So
> apparently boundschecker is upset because SQLite is merely making
> a copy pointer to previously freed memory.  There really is no
> harm in this.  Nothing bad can happen unless the program actually
> tries to dereference the pointer - which it never does.

BoundsChecker is pedantically correct: code which reads the
value of such an indeterminate pointer has undefined behavior
according to the C standard.  Note that I do mean reading
the value of the pointer, not dereferencing it (which is
more obviously invalid).

As for whether it's worth setting the pointer to null after
the memory to which it pointed is freed, that's subjective.

-- James


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] promise raid controller uses sqlite ?

2007-07-05 Thread David Crawshaw

Roger Binns wrote:

> is there really a native java-port of sqlite ?

There is an insane project named NestedVM that compiles C code for the
MIPS processor and then converts it to Java bytecode.

  http://nestedvm.ibex.org/


It comes packaged up with a JDBC interface:

http://www.zentus.com/sqlitejdbc/

Though I recommend that the platform-dependent version of the driver
be used if speed matters.

d.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] promise raid controller uses sqlite ?

2007-07-05 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

gg wrote:
> is there really a native java-port of sqlite ?

There is an insane project named NestedVM that compiles C code for the
MIPS processor and then converts it to Java bytecode.

  http://nestedvm.ibex.org/

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

iD8DBQFGjWW1mOOfHg372QQRAuYkAJ9P1Atouy/laPxR3KmfY1nM53CD1gCgwT/6
7ST7f3f3x7nI01Y83wtFFNI=
=CwTO
-END PGP SIGNATURE-

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] sqlite3_step

2007-07-05 Thread Bruno S. Oliveira

Hi all,

I'm having problems with the sqlite3_step function.
I have a table with only one record and then I execute the
sqlite3_step twice (with some processing in between). In the first run
of the function everything goes fine, but, in the second one, it
returns SQLITE_ROW even with only one record in the table and with no
modifications in the SQL statement.
Is this the correct behaviour of that function? Does anyone knows why
this happens?

I'm using the sqlite3_prepare before executing the sqlite3_step.

Thanks in advance.

Regards,

Bruno

--
/**
* Bruno Silva de Oliveira
* Bacharel em Ciência da Computação
* Mestrando em Inteligência Computacional
* http://www.inf.ufpr.br/brunoso/
*
* http://www.last.fm/user/bsoliveira/
*/


[sqlite] [ANN] New DBManager Professional Enterprise Edition 3.4.5

2007-07-05 Thread COS
DBTools Software is pleased to announce the new DBManager Professional
Enterprise Edition version 3.4.5.
This is only a bug fix without new features and recommended for users of
previous versions.

For a complete list of changes please check
http://www.dbtools.com.br/EN/article.php?id=00094.

The new version can be downloaded from
http://www.dbtools.com.br/EN/downloads/downloads_file.php?file_id=3

WHAT IS DBMANAGER?

DBManager Professional is a Windows application for complete database
management supporting MySQL, PostgreSQL, Interbase, Firebird, SQlite,
MSAccess, MSSQL Server, Oracle, Sybase, DBF Tables and ODBC Datasources. Its
features includes:

- Complete schema management
- Query Builder and Query Designer
- HTML Form and HTML Report Builders
- Diagram Designer
- Server and Database Monitoring tools with charts
- Serveral Wizards to Import and Export Structure and Data to/from a variety
of formats
- Task Builder for process automations
- And much more
- Available in English and Portuguese BR

For a complete list of features and versions available please check
http://www.dbtools.com.br/EN/dbmanagerpro.

Best Regards,

DBTools Software
http://www.dbtools.com.br


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] SQLite (3) Documentation

2007-07-05 Thread Guido Ostkamp

Hello,

So, I would like to take on an project to collect all the information 
and restructure it in a comprehensive SQLite 3 Manual. Sqlite.org 
already has (almost) all the information for the book so, if whoever has 
the copyright to that material allows it, it's a matter of copying, 
pasting and restructuring it.


Comments and ideas, please.


if all you want is a manual for yourself then be informed that there is a 
good SQLite book available at 
, also available as 
PDF E-Book for just a small amount of money.


If you however want to produce something for free, go ahead. It will 
surely be appreciated.


Regards

Guido

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] sqlite testing with Boundschecker

2007-07-05 Thread Florian Weimer
> So apparently boundschecker is upset because SQLite is merely making
> a copy pointer to previously freed memory.  There really is no harm
> in this.  Nothing bad can happen unless the program actually tries
> to dereference the pointer - which it never does.

I don't think GCC makes this guarantee.  The standard certainly doesnt
require this; copying a pointer value after the object it points to
has been freed results in undefined behavior.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: INDEX + SELECT or just SELECT?

2007-07-05 Thread Igor Tandetnik

Alberto Simões <[EMAIL PROTECTED]>
wrote:

I have a big table (16 million records) and I want to perform JUST
ONCE an operation to sort by one column:

  SELECT * FROM tbl ORDER BY i DESC;

Now, is it faster to perform just the select, or to do:

  CREATE INDEX tmp ON tbl (i);
  SELECT * FROM tbl ORDER BY i DESC;


My understanding is that SQLite implements ORDER BY by effectively 
building a temporary index and then iterating over it (unless a suitable 
existing index is available, of course). So both approaches should take 
approximately the same time.


Why don't you test both (perhaps on a small subset of a real database) 
and find out for sure?


Igor Tandetnik 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] INDEX + SELECT or just SELECT?

2007-07-05 Thread Alberto Simões

Hi

I have a big table (16 million records) and I want to perform JUST
ONCE an operation to sort by one column:

 SELECT * FROM tbl ORDER BY i DESC;

Now, is it faster to perform just the select, or to do:

 CREATE INDEX tmp ON tbl (i);
 SELECT * FROM tbl ORDER BY i DESC;

Thank you
Alberto

--
Alberto Simões

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] SQLite (3) Documentation

2007-07-05 Thread Veikko Mäkinen

Hi everyone,

I'm a semi-active SQLite user and it has always bothered me how the 
documentation of this brilliant tool is somewhat scattered in 
sqlite.org/docs.html and in the wiki. Quite often when I try to help 
other users in #sqlite IRC channel (irc.freenode.net) I know I have seen 
the answer somewhere in the docs but I just can't find the information 
from the site.


So, I would like to take on an project to collect all the information 
and restructure it in a comprehensive SQLite 3 Manual. Sqlite.org 
already has (almost) all the information for the book so, if whoever has 
the copyright to that material allows it, it's a matter of copying, 
pasting and restructuring it.


I already started drafting the book (the structure). The source is 
available via SVN in http://svn.projectbin.org/sqlitemanual/trunk/ and a 
compiled version in http://projectbin.org/sqlitemanual/.


This is definitely something I can't do alone and it would be stupid to 
even try to do it without the support of the active community and the 
developers.


Comments and ideas, please.


Sincerely,
Veikko "v-dogg" Mäkinen


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Re: Re: Re: self join instead of temporary table

2007-07-05 Thread Jeffrey Ratcliffe

On 05/07/07, Igor Tandetnik <[EMAIL PROTECTED]> wrote:

The fact that GROUP BY follows ORDER BY, of course. You are probably not
surprised that you can't, say, put WHERE clause in front of FROM clause
or SELECT clause - why are you surprised that other clauses must also be
used in a certain order?


You are right. I should have RTFM better.

Thanks for all the help

Jeff

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: Re: Re: Re: self join instead of temporary table

2007-07-05 Thread Igor Tandetnik

Jeffrey Ratcliffe
<[EMAIL PROTECTED]> wrote:

SELECT eid, P, subcase
FROM temp a1
WHERE NOT EXISTS (
SELECT *
FROM temp a2
 WHERE a2.eid == a1.eid AND a2.P < a1.P
)
ORDER BY eid
GROUP BY eid;

I get a syntax error, complaining about GROUP. If I switch the ORDER
and GROUP lines, I get the desired result - thanks. What is wrong with
the first version?


The fact that GROUP BY follows ORDER BY, of course. You are probably not 
surprised that you can't, say, put WHERE clause in front of FROM clause 
or SELECT clause - why are you surprised that other clauses must also be 
used in a certain order?


Igor Tandetnik 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Database File size not exceeding 2GB

2007-07-05 Thread RaghavendraK 70574
Pls check if can create a normal file more than 2GB from your program
if not then some options must be missing.

regards
ragha

**
 This email and its attachments contain confidential information from HUAWEI, 
which is intended only for the person or entity whose address is listed above. 
Any use of the information contained herein in any way (including, but not 
limited to, total or partial disclosure, reproduction, or dissemination) by 
persons other than the intended recipient(s) is prohibited. If you receive this 
e-mail in error, please notify the sender by phone or email immediately and 
delete it!
 
*

- Original Message -
From: "Krishnamoorthy, Priya (IE10)" <[EMAIL PROTECTED]>
Date: Thursday, July 5, 2007 7:37 pm
Subject: [sqlite] Database File size not exceeding 2GB

> Hi all,
> 
> 
> 
> This is with reference to the problem mentioned below:
> 
> 
> 
> 1)   I am using NTFS file system
> 
> 2)   I tried in windows 2000 and Windows XP
> 
> 
> 
> But still I am able to log only 2 GB of data. SQLite stops logging 
> datamore than that. But it is not throwing any exception also.
> 
> 
> 
> Is there any setting that needs to be done in Windows XP? Enable 
> LFS etc
> so as to log data more than 2GB?
> 
> 
> 
> Please help me in this regard.
> 
> 
> 
> Regards,
> 
> Priya
> 
> 
> 
> ---
> -
> ---
> -
> 
> 
> 
> 
> I am using SQLite3 database in my application.
> 
> 
> 
> My application runs on Windows XP (32 bit) platform. I am not able to
> store more than 2GB of data in my database. Is it not possible to 
> storemore than 2gb data in windows XP? 
> 
> 
> 
> I used SQlite3 in Linux and could store more than 2GB.
> 
> 
> 
> Please help me in this regard
> 
> 
> 
> Best regards,
> 
> Priya 
> 
> 
> 
> 
> 
> 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Re: Re: self join instead of temporary table

2007-07-05 Thread Jeffrey Ratcliffe

On 05/07/07, Igor Tandetnik <[EMAIL PROTECTED]> wrote:

Add "group by eid"


For

SELECT eid, P, subcase
FROM temp a1
WHERE NOT EXISTS (
SELECT *
FROM temp a2
 WHERE a2.eid == a1.eid AND a2.P < a1.P
)
ORDER BY eid
GROUP BY eid;

I get a syntax error, complaining about GROUP. If I switch the ORDER
and GROUP lines, I get the desired result - thanks. What is wrong with
the first version?

Thanks for the help

Jeff

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Re: Re: Re: self join instead of temporary table

2007-07-05 Thread Igor Tandetnik

Jeffrey Ratcliffe
<[EMAIL PROTECTED]> wrote:

Even better. Thanks again. But in the case where there ARE duplicates:

CREATE TEMPORARY TABLE temp (eid, P, subcase);
INSERT INTO temp (eid, P, subcase) VALUES (1, 1, 'a');
INSERT INTO temp (eid, P, subcase) VALUES (1, 1, 'b');
INSERT INTO temp (eid, P, subcase) VALUES (2, 2, 'a');
INSERT INTO temp (eid, P, subcase) VALUES (2, 2, 'b');
SELECT eid, P, subcase
FROM temp a1
WHERE NOT EXISTS (
SELECT *
FROM temp a2
 WHERE a2.eid == a1.eid AND a2.P < a1.P
)
ORDER BY eid;
DROP TABLE temp;

I get:

1,1,a
1,1,b
2,2,a
2,2,b

I would like:

1,1,a (or 1,1,b it doesn't matter which)
2,2,a (or 2,2,b)


Add "group by eid"

Igor Tandetnik 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] Database File size not exceeding 2GB

2007-07-05 Thread Krishnamoorthy, Priya (IE10)
Hi all,

 

This is with reference to the problem mentioned below:

 

1)   I am using NTFS file system

2)   I tried in windows 2000 and Windows XP

 

But still I am able to log only 2 GB of data. SQLite stops logging data
more than that. But it is not throwing any exception also.

 

Is there any setting that needs to be done in Windows XP? Enable LFS etc
so as to log data more than 2GB?

 

Please help me in this regard.

 

Regards,

Priya

 





 

I am using SQLite3 database in my application.

 

My application runs on Windows XP (32 bit) platform. I am not able to
store more than 2GB of data in my database. Is it not possible to store
more than 2gb data in windows XP? 

 

I used SQlite3 in Linux and could store more than 2GB.

 

Please help me in this regard

 

Best regards,

Priya 

 

 



[sqlite] SQLite binaries for Embedded Linux ARM architecture

2007-07-05 Thread Steinmaurer Thomas
Hello,

I would like to give SQLite a try for an embedded system running on
Embedded Linux ARM CPU architecture. Are there any pre-compiled binaries
available?


Thanks,
Thomas


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Re: Re: self join instead of temporary table

2007-07-05 Thread Jeffrey Ratcliffe

On 04/07/07, Igor Tandetnik <[EMAIL PROTECTED]> wrote:

For each unique eid you look for a record with this eid where P is
smallest. Another way to express "smallest" is to say: there doesn't
exist a record with the same eid and a smaller value of P. Which is
precisely what my "not exists" clause is saying.


Wow. It is counter-intuitive (to me at least) that this is quick.


just happens to have the same P). If you don't, the query could be made
simpler:

select eid, P, subcase
from barforce_1 a
where not exists
(select * from barforce_1 a1 where a1.eid = a.eid and a1.P < a.P)
order by eid;


Even better. Thanks again. But in the case where there ARE duplicates:

CREATE TEMPORARY TABLE temp (eid, P, subcase);
INSERT INTO temp (eid, P, subcase) VALUES (1, 1, 'a');
INSERT INTO temp (eid, P, subcase) VALUES (1, 1, 'b');
INSERT INTO temp (eid, P, subcase) VALUES (2, 2, 'a');
INSERT INTO temp (eid, P, subcase) VALUES (2, 2, 'b');
SELECT eid, P, subcase
FROM temp a1
WHERE NOT EXISTS (
SELECT *
FROM temp a2
 WHERE a2.eid == a1.eid AND a2.P < a1.P
)
ORDER BY eid;
DROP TABLE temp;

I get:

1,1,a
1,1,b
2,2,a
2,2,b

I would like:

1,1,a (or 1,1,b it doesn't matter which)
2,2,a (or 2,2,b)

How can I modify the query so as only one minimum per element (it
doesn't matter which one)? Is there any way of getting DISTINCT to
only operate on eid and P but not subcase?

Thanks

Jeff

-
To unsubscribe, send email to [EMAIL PROTECTED]
-