[sqlite] Upgraded from 2.8.6 to 2.8.13

2004-05-26 Thread v t
Hi ,
 
I upgraded sqlite version from 2.8.6 to 2.8.13. 
And I am running into a problem where after inserting and deleting some (eg 30 ) 
entries, I get the error, "database is full" followed by "database disk image is 
malformed
". I use sqlite_exec to run all queries. 
 
The database has a table with string as "key" and few other "string" columns. Any idea 
which part of the sqlite code I should be concentrating on?
 
Thanks
vt


-
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

Re: [sqlite] sqlite on vxworks or vrtx?

2004-03-29 Thread v t
Hi,
 
I ported sqlite to Vxworks. It was a straight forward port. File locking is not 
possible in VxWorks. So I do not use it. So I define the macro __DJGPP__  which takes 
care of fcntl call used for file locking.
 
Did not include the files shell.c and tclsqlite.c in my project.
 
I used the following macros -DOS_UNIX -DSQLITE_OMIT_AUTHORIZATION -DSQLITE_OMIT_VACUUM 
-D__DJGPP__  -DSQLITE_TRACE_DEBUG

 
Will have to modify TIMER_START and TIMER_END macros in os.c for VxWorks.
 
Replaced malloc and free with memory pools. realloc requires special attention when 
repcaling with memory pools. Will need to spend some time in tuning memory pool sizes. 
Modified util.c for memory pools.
 
Most of the time use sqlite_exec and sqlite_query_table API calls. Use temporary 
tables too. 
 
Very happy so far.

vt

Brett Granger <[EMAIL PROTECTED]> wrote:

Hi,

I'm new to this list, and have been given a task to investigate various 
alternatives for databases on embedded systems. I like what I have seen 
of sqlite so far!

On the sqlite.org wiki under "when to use sqlite", there is the following:

"# Embedded devices and applications

Because an SQLite database requires little or no administration, SQLite 
is a good choice for devices or services that must work unattended and 
without human support. SQLite is a good fit for use in cellphones, PDAs, 
set-top boxes, and/or appliances. It also works well as an embedded 
database in downloadable consumer applications."

Based on size, speed, and performance the above claim appears to be 
true. However, a lot of set-top boxes out there are not running Linux 
or WinCE, but are instead running vxworks or even vrtx. Has anyone 
ported/compiled sqlite to run on either of these OSes? Does anyone have 
a sense as to how hard it might or might not be if it doesn't already 
exist? Maybe it's not too hard if they're both POSIX compliant?

I know that Berkeley DB from sleepy cat has a vxworks port, but I would 
really prefer to pursue sqlite.

Any thoughts/hints welcomed!
--Brett Granger


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: [sqlite] tables in in-memory database

2004-02-11 Thread v t
Thanks Richard. It works now. Originally I tried using SQLITE_MASTER and it did not 
work so after searching this forum I found some info on SQLITE_TEMP_MASTER and tried 
that.
 
I figured the reason why SQLITE_MASTER did not work originally is because I opened a 
new handle to the in-memory database and then ran the query using that handle to get 
the table list. I already had the in-memory database open with a different handle. The 
query returns correct results only with the handle I got the first time I opened the 
in-memory database.
 
Can I open and maintain multiple in-memory databases?
 
Thanks
vt

"D. Richard Hipp" <[EMAIL PROTECTED]> wrote:
v t wrote:
> Hi
>
> When I execute the following query on a in-memory database, I get no results.
> The query is " SELECT * FROM SQLITE_TEMP_MASTER WHERE type='table'". I
^^
Should be "SQLITE_MASTER" not "SQLITE_TEMP_MASTER"

> initialize and create tables before I run the above query. I am also able to
> insert and update records in the tables in the in-memory database.
>
> My objective is to get a list of all tables in in-memory database. I am able
> to extract the tables list from SQLITE_MASTER though.
>
> Any ideas what could be going wrong?
>
> Thanks Vt
>
>
> - Do you Yahoo!? Yahoo! Finance: Get your
> refund fast by filing online



-- 
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

[sqlite] tables in in-memory database

2004-02-09 Thread v t
Hi
 
When I execute the following query on a in-memory database, I get no results. The 
query is " SELECT * FROM SQLITE_TEMP_MASTER WHERE type='table'". I initialize and 
create tables before I run the above query. I am also able to insert and update 
records in the tables in the in-memory database.
 
My objective is to get a list of all tables in in-memory database. I am able to 
extract the tables list from SQLITE_MASTER though.
 
Any ideas what could be going wrong?
 
Thanks
Vt


-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: [sqlite] Journalling

2003-10-27 Thread v t
Hello,
 
I am aware that:
 
1) Reading from the database doesnt involve opening a journal file.
2) Writing (INSERT, UPDATE etc) to the database opens a journal file on the disk.
3) PRAGMA default_synchronous = OFF;  (0) is to turn on sync ON or OFF.
 
I am writing to a database file every 200ms on a compact flash.
 
My understanding of the PRAGMA default_synchronous = OFF;  (0) was that it is used for 
flushing the database contents on each write or doing it at the end of a database 
transaction.  (simlilar to doing a buffered I/O eg fwrite, fflush or doing a 
unbuffered I/O like write). 
 
And my understanding of journalling is that it is used to rollback any changes to the 
database in case of failures during a transaction. I am no expert on journalling so I 
could be wrong.
 
So I was just tailoring SQLite to my needs and not trying to throw away the use of a 
very useful feature. ( I may decide to use it when I need it again).
 
vt

[EMAIL PROTECTED] wrote:
Hello,





v t 
27/10/2003 05:16 PM


To: "Mrs. Brisby" 
cc: sqlite 
Subject: Re: [sqlite] Journalling


> I am trying to use sqlite in a context where I will be using it to store 
some configuration about a system. I want to try to minimize the disk 
access. Since journalling uses a file on the disk, I wanted to turn it 
off. I am not worried about rolling back the database to a known state in 
case of some failure.

You're not worried about your database becoming corrupted and all your 
data being destroyed? It doesn't sound like you like your data very 
much... ;)

This is a question that pops up on the list every so often, and there have 
been some good reasons for it. Well. One comes to mind, and that's the use 
of flash memory in embedded devices. When you don't want to write to your 
media too many times you might find that it's better to turn off 
journalling and risk the consequences... perhaps make regular backups... 
rather than write to the media too often.

The problem is that most people don't know what they're talking about when 
they ask how to turn journalling off. They don't understand when the 
journal gets written in the first place and they don't understand which 
operations they're performing that aren't affected by journalling. They 
haven't read the list archives, and they patently haven't read the manual, 
because it's listed under the pragma section of 
http://www.sqlite.org/lang.html.

This is why when you ask the question on this list you get the response
"Well I know you've asked how to turn off journalling, but what do you 
actually want to achieve by this and what alternatives have you 
considered?"

You haven't yet given an explination that makes sense to me, so in the 
spirit of RTFM I'll leave you to find the exact manual reference yourself. 
I think it's worth you understanding, though, that journalling doesn't 
occur when you're only querying the database. It only happens when you 
modify the database. Using transactions while modifying the database is 
not only a good idea for data integrity, it also makes the overhead 
associated with synching the file to disk almost disappear so there's 
usually no need at all to turn off journalling. Given all of this, if you 
still can't find the exact spot in the manuals to turn this off yourself 
perhaps you could offer a more complete discussion about the nature of 
your database and your access to it. You'd be well advised to discuss the 
alternatives you have considered so that the gentle list members will feel 
more compelled to answer your question directly.

Benjamin
--Premature optimisation is the root of all evil


-
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears

Re: [sqlite] Journalling

2003-10-27 Thread v t
I am trying to use sqlite in a context where I will be using it to store some 
configuration about a system. I want to try to minimize the disk access. Since 
journalling uses a file on the disk, I wanted to turn it off. I am not worried about 
rolling back the database to a known state in case of some failure.
 
vt
 
"Mrs. Brisby" <[EMAIL PROTECTED]> wrote:
On Thu, 2003-10-23 at 19:46, v t wrote:
> Hi,
> 
> How do I turn journalling OFF?

Why do you want to? What exactly are you trying to accomplish?


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears

Re: [sqlite] Listserver Digest Attachments

2003-10-24 Thread v t
Matt,
 
as you suggested, the link is very good to follow.
http://news.gmane.org/gmane.comp.db.sqlite.general
 
vt

Matt Sergeant <[EMAIL PROTECTED]> wrote:
On 24 Oct 2003, at 10:02, Steve O'Hara wrote:

> I'm a Windows (followed by Unix then VMS) guy and I use Outlook to 
> view my
> email.

Can I recommend you try viewing via Gmane instead then? Point outlook 
at the Usenet News server news.gmane.org and you can find the SQLite 
list in there.

You might find other lists easier to track this way too.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

[sqlite] Journalling

2003-10-23 Thread v t

Hi,

How do I turn journalling OFF?

Inside sqlite_open function, I passed TRUE to third argument of sqliteBtreeFactory 
which stands for omitJournal. That did not work. I got an assertion in 
sqlitepager_commit. Following is the surrounding code:

  TRACE1("COMMIT\n");
  if( pPager->dirtyFile==0 ){
/* Exit early (without doing the time-consuming sqliteOsSync() calls)
** if there have been no changes to the database file. */
assert( pPager->needSync==0 );
rc = pager_unwritelock(pPager);
pPager->dbSize = -1;
return rc;
  }
  assert( pPager->journalOpen );

Thanks

vt



-
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

Re: [sqlite] too few operands on stack at 13(Callback).

2003-10-20 Thread v t
Hi Richard,
 
I tried to open my database file "test.11" by enabling MEMORY_DEBUG=2, it works fine 
now. 
 
I was trying to use memory pools for sqliteMalloc. So I modified the malloc & free 
calls to my internal memory pool calls. In addition to that I saw that some files were 
not calling sqliteMalloc but call malloc directly. I modified all the malloc calls to 
sqliteMalloc.
 
When I use my allocation library call, I do not see any allocation failures but 
sqlite_open fails to the follow the sequence of instructions you said that each time 
it should follow.
 
I will try to debug and see what goes wrong when I use a memory pool allocation 
mechanism.
 
Thanks for your reply,
vt


"D. Richard Hipp" <[EMAIL PROTECTED]> wrote:
v t wrote:
> Anybody please help.
> 
> I get this error during sqlite_open for an exisitng database.
> 
> db=sqlite_open("/ata0/test.11",0,&f)
> 
> f points to string "too few operands on stack at 13"
> 
> Following is trace:
> 
> OPEN 15 /ata0/test.11
> OPEN-EX 16 /temp/saRUxt
> READ 15 1 2
> READ 15 2 0
> 
> 0 ColumnName 4 0 1
> 1 Integer 1 0
> Stack: i:1
> 2 OpenRead 0 2 sqlite_temp_master
> 3 Rewind 0 7
> 7 Close 0 0
> 8 Integer 0 0
> Stack: i:0
> 9 OpenRead 1 2 sqlite_master
> 10 VerifyCookie 0 75
> 11 Rewind 1 15
> 12 Integer 0 0 0
> Stack: si:0
> 13 Callback 5 0
> CLOSE 15
> CLOSE 16
> 

If possible, please e-mail me your "/ata0/test.11" file.


-- 
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

[sqlite] too few operands on stack at 13(Callback).

2003-10-17 Thread v t
Anybody please help.
 
I get this error during sqlite_open for an exisitng database.
 
 db=sqlite_open("/ata0/test.11",0,&f)
 
f points to string "too few operands on stack at 13"
 
Following is trace:

OPEN15  /ata0/test.11
OPEN-EX 16  /temp/saRUxt
READ151 2
READ152 0

   0 ColumnName  40 1
   1 Integer 10
Stack: i:1
   2 OpenRead02 sqlite_temp_master
   3 Rewind  07
   7 Close   00
   8 Integer 00
Stack: i:0
   9 OpenRead12 sqlite_master
  10 VerifyCookie0   75
  11 Rewind  1   15
  12 Integer 00 0
Stack: si:0
  13 Callback50
CLOSE   15
CLOSE   16

Thanks
Vt
 


-
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search