Re: [sqlite] DBD::SQLite SQLite Ver 3.2.7

2006-03-15 Thread Jarl Friis
Eric Bohlman earlier wrote this:
--
You'll need to go into dbdimp.c and change the two calls to
sqlite3_prepare() so that the third argument is -1 rather than
zero. This is due to the change in check-in 3047.
--

Jarl

-- 
Jarl Friis
Softace ApS
Omøgade 8, 2.sal
2100 København Ø.
Denmark
Phone:  +45 26 13 20 90
E-mail: [EMAIL PROTECTED]
LinkedIn: https://www.linkedin.com/in/jarlfriis



Re: [sqlite] C++ code sharing: import utility program for scripting and command line

2006-03-15 Thread Jarl Friis
"Jay Sprenkle" <[EMAIL PROTECTED]> writes:

> Good afternoon all,
>
> I've written a utility program in vanilla C++ to help with a project.
> I thought I would make it available to the community.
>
> If there's any interest let me know and I'll make it available.

Cool. Sounds great. How about just putting it up on sqlite.org somehow
as a contrib.

Jarl

-- 
Jarl Friis
Softace ApS
Omøgade 8, 2.sal
2100 København Ø.
Denmark
Phone:  +45 26 13 20 90
E-mail: [EMAIL PROTECTED]
LinkedIn: https://www.linkedin.com/in/jarlfriis



[sqlite] EUC_JP handling in sqlite

2006-03-15 Thread ryan bel brillo
Hi all,

  I guess this guery of mine is no longer related to sqlite, but maybe
somebody has encountered this problem before and can help me.

 

  I have a Postgresql database with encoding set to EUC_JP. Then I have
a sqlite database that is being updated every 10 minutes from data and
dumps from PostgreSQL db.

  

  One update is through files dump from the Postgresql. In this case,
Japanese characters are displayed fine. The updating is done by reading
those files dump from PostgreSQL then calling sqlite3_exec with the file
content as parameter. 

 

  Another is through a c program that connect to the PostgreSQL db then
query data in a table that contains SQL statement update then calling
sqlite3_exec with the queried SQL statement as parameter. This is where
the problem occurs. The result is the data is corrupted and show
garbage. Does anybody have a module to handle this?

 

Thanks.

 

Sincerely,

  Ryan Bel



Re: [sqlite] all

2006-03-15 Thread Clark Christensen
Send email to [EMAIL PROTECTED]

- Original Message 
From: Jiao <[EMAIL PROTECTED]>
To: sqlite-users@sqlite.org
Sent: Wednesday, March 15, 2006 4:40:11 PM
Subject: [sqlite] all

I want to be off this mail list, how to do it ?




Re: [sqlite] all

2006-03-15 Thread Pierre Renaux
Very helpfull considering that some ppl dont receive that header... me 
included...


- Pierre

- Original Message - 
From: "Darren Duncan" <[EMAIL PROTECTED]>

To: ; "Jiao" <[EMAIL PROTECTED]>
Sent: Thursday, March 16, 2006 09:47
Subject: Re: [sqlite] all



At 08:40 +0800 16/3/06, Jiao wrote:

I want to be off this mail list, how to do it ?


Read the header of the email you sent to the list, as well as every other 
list message; it says there "List-Unsubscribe" plain as day. -- 
Darren Duncan 




Re: [sqlite] all

2006-03-15 Thread Martin Jenkins

It's all in the mail headers:


List-Post: 
List-Help: 
List-Unsubscribe: 
List-Subscribe: 


Make sure you send the request from the address that receives the mail... ;)

Martin

- Original Message - 
From: "Jiao" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, March 16, 2006 12:40 AM
Subject: [sqlite] all


I want to be off this mail list, how to do it ? 




Re: [sqlite] all

2006-03-15 Thread Darren Duncan

At 08:40 +0800 16/3/06, Jiao wrote:

I want to be off this mail list, how to do it ?


Read the header of the email you sent to the list, as well as every 
other list message; it says there "List-Unsubscribe" plain as day. -- 
Darren Duncan


[sqlite] all

2006-03-15 Thread Jiao
I want to be off this mail list, how to do it ?

Re: [sqlite] DBD::SQLite SQLite Ver 3.2.7

2006-03-15 Thread Steve Green

In order to get this to work, modify DBD::SQLite dbdimp.c so that the 3rd
parameter of each call to sqlite3_prepare() is -1 instead of 0.

Steve

Chris Werner wrote:


Hello,

The current release of SQLite, 3.3.4 does not seem to be compatible with the
perl DBD driver. The embedded SQLite package works quite well, But I would
like to have the full SQLite package installed [so I can use sqlite3]. I do
not seem to be able to locate the source archives, I would be looking for
Ver 3.2.7: sqlite-3.2.7.tar.gz

I understand that the problem is a know bug... any feedback on whether a
change should be made in SQLite or the CPAN DBD package?

Thanks,
Christian Werner



--
Steve Green
SAVVIS
Transforming Information Technology SM

This message contains information which may be confidential and/or
privileged.  Unless you are the intended recipient (or authorized
to receive for the intended recipient), you may not read, use,
copy or disclose to anyone the message or any information contained
in the message. If you have received the message in error, please
advise the sender by reply e-mail at [EMAIL PROTECTED] and
delete the message and any attachment(s) thereto without retaining
any copies.


[sqlite] DBD::SQLite SQLite Ver 3.2.7

2006-03-15 Thread Chris Werner
Hello,

The current release of SQLite, 3.3.4 does not seem to be compatible with the
perl DBD driver. The embedded SQLite package works quite well, But I would
like to have the full SQLite package installed [so I can use sqlite3]. I do
not seem to be able to locate the source archives, I would be looking for
Ver 3.2.7: sqlite-3.2.7.tar.gz

I understand that the problem is a know bug... any feedback on whether a
change should be made in SQLite or the CPAN DBD package?

Thanks,
Christian Werner


[sqlite] RE:Re: [sqlite] RE: SQLite memory leak on Windows CE

2006-03-15 Thread [EMAIL PROTECTED]
Hi Robert,
Thank you for your test. I have not test it on the emulator but in 4 different 
Windows CE devices i have at work (with different Windows CE OS versions) and 
it always give me the same memory leak result.
I will run your test tomorrow at work using the emulator and i will let you 
know the results.
Thank you again,
Eduardo

---Mensaje original---Ok, here's what I did ...

On the desktop I created a SQLite database with one table and inserted 
120,000 rows into it. I then copied it over to the CE emulator.

Then I ran the following code on the CE (Pocket PC 2003 SE) emulator:

#include 
#include 
#include sqlite3.h

int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR pszCmdLine, 
int nCmdShow)
{
sqlite3 *pdb;
int rc;

for (int n = 0; n  1; n  )
{
rc = sqlite3_open(\\test.db3, pdb);
if (rc) break;
rc = sqlite3_exec(pdb, select * from testcase, 0, 0, 0);
if (rc) break;
rc = sqlite3_close(pdb);
if (rc) break;
}
return 0;
}

On the first call to sqlite3_exec(), available program memory dropped from 
an initial 10.5mb to 8.45mb. However, once that was done, available memory 
remained rock solid for the duration of the loop at a constant 8.45mb and no 
non-zero error codes were ever returned.

Robert




El día del padre está cerca... ¿Ya tienes el regalo? 
http://buscawanadoo.es/search?type=pref=web=homespot=Regalos%20Día%20del%20Padre

[sqlite] RE:[sqlite] RE:Re: [sqlite] RE: SQLite memory leak on Windows CE

2006-03-15 Thread [EMAIL PROTECTED]

Hi again Robert,
I think i forgot to tell you that to detect the memory leak you must not close 
the application testing program, the easiest way to detect the memory leak is:
create a simple MFC dialog project. Add 2 buttons, one for executing your 
testing program an another one for close the application from it.
If you execute your testing program and you monitorize the memory usage with 
the Remote performance monitor (from the tools menu at the EVC   4.0 
IDE-tools-Remote Performance Monitor-Select your device-press 
the   sign (add)-change combo Box selection to Memory-add a graphic 
line for memory load). You will notice that memory is only recovered once you 
execute the button to close the application.
I hope this might help you.
Thank you,
Eduardo

---Mensaje original---
Hi Robert,
Thank you for your test. I have not test it on the emulator but in 4 di
fferent Windows CE devices i have at work (with different Windows CE OS
versions) and it always give me the same memory leak result.
I will run your test tomorrow at work using the emulator and i will l
et you know the results.
Thank you again,
Eduardo
---Mensaje original---Ok, here's what I did ...

On the desktop I created a SQLite database with one table and inserted 

120,000 rows into it. I then copied it over to the CE emulator.

Then I ran the following code on the CE (Pocket PC 2003 SE) emulator:

#include 
#include 
#include sqlite3.h

int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR pszCmdLin
e, 
int nCmdShow)
{
sqlite3 *pdb;
int rc;

for (int n = 0; n  1; n )
{
rc = sqlite3_open(\\test.db3, pdb);
if (rc) break;
rc = sqlite3_exec(pdb, select * from testcase, 0, 0, 0);
if (rc) break;
rc = sqlite3_close(pdb);
if (rc) break;
}
return 0;
}

On the first call to sqlite3_exec(), available program memory dropped f
rom 
an initial 10.5mb to 8.45mb. However, once that was done, available mem
ory 
remained rock solid for the duration of the loop at a constant 8.45mb a
nd no 
non-zero error codes were ever returned.

Robert




El día del padre está cerca... ¿Ya tienes el regalo? http://busca
wanadoo.es/search?type=prefdestino=weborigen=homespotbuscar=
Regalos%20Día%20del%20Padre

El día del padre está cerca... ¿Ya tienes el regalo? 
http://buscawanadoo.es/search?type=pref=web=homespot=Regalos%20Día%20del%20Padre

[sqlite] RE:Re: [sqlite] RE: SQLite memory leak on Windows CE

2006-03-15 Thread [EMAIL PROTECTED]

Hi Robert,
Thank you for your test. I have not test it on the emulator but in 4 different 
Windows CE devices i have at work (with different Windows CE OS versions) and 
it always give me the same memory leak result.
I will run your test tomorrow at work using the emulator and i will let you 
know the results.
Thank you again,
Eduardo
---Mensaje original---Ok, here's what I did ...

On the desktop I created a SQLite database with one table and inserted 
120,000 rows into it. I then copied it over to the CE emulator.

Then I ran the following code on the CE (Pocket PC 2003 SE) emulator:

#include 
#include 
#include sqlite3.h

int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR pszCmdLine, 
int nCmdShow)
{
sqlite3 *pdb;
int rc;

for (int n = 0; n  1; n  )
{
rc = sqlite3_open(\\test.db3, pdb);
if (rc) break;
rc = sqlite3_exec(pdb, select * from testcase, 0, 0, 0);
if (rc) break;
rc = sqlite3_close(pdb);
if (rc) break;
}
return 0;
}

On the first call to sqlite3_exec(), available program memory dropped from 
an initial 10.5mb to 8.45mb. However, once that was done, available memory 
remained rock solid for the duration of the loop at a constant 8.45mb and no 
non-zero error codes were ever returned.

Robert




El día del padre está cerca... ¿Ya tienes el regalo? 
http://buscawanadoo.es/search?type=pref=web=homespot=Regalos%20Día%20del%20Padre

RE: [sqlite] Help needed to diagnose "NOT IN" query

2006-03-15 Thread CARTER-HITCHIN, David, FM
Hi Ulrich and Jay S.

> I don't know wether it's faster, but try
> 
> select a,b,c from d where c in (select c from d except select 
> c from e)
> 
> Maybe you're lucky and it's faster.

Thanks - I'll give IN a go, instead of NOT IN

Cheers,

David Carter-Hitchin.
--
Royal Bank of Scotland
Interest Rate Derivatives IT
135 Bishopsgate
LONDON EC2M 3TP


***
The Royal Bank of Scotland plc. Registered in Scotland No 90312. Registered 
Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorized and regulated by the Financial Services Authority 
 
This e-mail message is confidential and for use by the 
addressee only. If the message is received by anyone other 
than the addressee, please return the message to the sender 
by replying to it and then delete the message from your 
computer. Internet e-mails are not necessarily secure. The 
Royal Bank of Scotland plc does not accept responsibility for 
changes made to this message after it was sent. 

Whilst all reasonable care has been taken to avoid the 
transmission of viruses, it is the responsibility of the recipient to 
ensure that the onward transmission, opening or use of this 
message and any attachments will not adversely affect its 
systems or data. No responsibility is accepted by The Royal 
Bank of Scotland plc in this regard and the recipient should carry 
out such virus and other checks as it considers appropriate. 
Visit our websites at: 
http://www.rbos.com
http://www.rbsmarkets.com 




Re: [sqlite] Help needed to diagnose "NOT IN" query

2006-03-15 Thread Ulrich Schöbel
Hi David,

I don't know wether it's faster, but try

select a,b,c from d where c in (select c from d except select c from e)

Maybe you're lucky and it's faster.

Kind regards

Ulrich

On Wednesday 15 March 2006 22:44, CARTER-HITCHIN, David, FM wrote:
> Hi Brett,
>
> Many thanks for replying.  Well I tried PRAGMA temp_store=memory and that
> sadly did not help.
>
> I'm going to adopt a different approach. Say I've got:
>
> select a,b,c
> from   d
> where  c NOT IN (select c from e)
>
> What I'm trying is:
>
> 1. select a,b,c from d into a temp1 table  (as far as I can see SQLite
> can't do SELECT INTO, so I'll do it for it by creating the table and
> selecting and inserting the rows - please correct me if there's an easier
> way).
> 2. select c from e into a second temp2 table
> 3. delete from temp1 where temp1.c = temp2.c
> 4. the results left in temp1 will be the rows where c NOT IN (select c from
> e) [hopefully :-]
>
> I used to do this with Sybase back in the days when Sybase was really bad
> with NOT IN too - they seemed to improve on things around version 12 or
> 12.5...
>
> Thanks,
>
> David Carter-Hitchin.
> --
> Royal Bank of Scotland
> Interest Rate Derivatives IT
> 135 Bishopsgate
> LONDON EC2M 3TP
>
> Tel: +44 (0) 207 085 1088
>
> > -Original Message-
> > From: Brett Wilson [mailto:[EMAIL PROTECTED]
> > Sent: 14 March 2006 16:48
> > To: sqlite-users@sqlite.org
> > Subject: Re: [sqlite] Help needed to diagnose "NOT IN" query
> >
> >
> > David,
> >
> > I asked a similar question, and here is drh's response to me, adapted
> > to your situation. I think it is probably applicable to you as well.
> > I'm not sure this is the type of query that can be made to go really
> > fast no matter what. I actually haven't gotten around to doing this
> > yet, so I can't comment on how well it works.
> >
> >
> > To implement this, SQLite creates a temporary index that contains all
> > unique values of holiday_list.number. Then it scans through the table
> > and for each entry where holiday.hol_id is not in the temp index.
> >
> > Do make sure that your temp tables are stored in RAM.  Compile with
> > -DTEMP_STORE=2.  Or at run-time set
> >
> >  PRAGMA temp_store=memory;
> >
> > That will put the temporary index in RAM and things will tend
> > to go faster.
> >
> > Brett
> >
> > On 3/14/06, CARTER-HITCHIN, David, FM
> >
> > <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > >
> > > Hope someone out there can help - I've got this query which
> >
> > runs VERY
> >
> > > slowly:
> > >
> > > SELECTab_tran.ins_num, holiday.hol_id, holiday.ins_num
> > > FROM  ab_tran, holiday
> > > WHERE ab_tran.ins_num = holiday.ins_num
> > > AND   holiday.hol_id NOT IN ( SELECT number from holiday_list )
> > >
> > > All the tables are fairly chunky, except holiday_list which
> >
> > has 89 rows.  I
> >
> > > just realised that holiday.ins_num is needlessly selected
> >
> > but I doubt very
> >
> > > much that would be causing things to slow down massively.
> >
> > I can run this on
> >
> > > a similar powered Sybase server and it runs in a couple of
> >
> > minutes - with
> >
> > > SQLite, using an in-memory database I've left it all night
> >
> > and it didn't
> >
> > > finish!  Evidently something is wrong somewhere.  I've
> >
> > created indexes on
> >
> > > all the columns in the join and the "NOT IN" clause, but
> >
> > that didn't seem to
> >
> > > help.
> > >
> > > Is there anything else I check?
> > >
> > > I've run the EXPLAIN (output below), but I'm a novice here,
> >
> > not sure what
> >
> > > could be wrong.
> > >
> > > Any ideas will be highly appreciated.
> > >
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:476 - 64 rows
> >
> > extracted in
> >
> > > 0.03532 seconds.
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 0
> >
> > Goto0   60
> >
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 1
> >
> > Integer 0   0
> >
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 2
> >
> > OpenRead0
> >
> > > 3
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 3
> >
> > SetNumColumns   0
> >
> > > 7
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 4
> >
> > Integer 0   0
> >
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 5
> >
> > OpenRead1
> >
> > > 5
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 6
> >
> > SetNumColumns   1
> >
> > > 2
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 7
> >
> > Integer 0   0
> >
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 8
> >
> > OpenRead3
> >
> > > 137675  keyinfo(1,BINARY)
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 9
> >
> > Rewind  0   56
> >
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 10
> >
> > Column  0   1
> >
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 11
> >
> > NotNull -1  14
> >
> > > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 12Pop
> >
> > 1   0
> >
> > > Tue Mar 14 12:05:10 2006 DEBUG at 

Re: [sqlite] Help needed to diagnose "NOT IN" query

2006-03-15 Thread Jay Sprenkle
On 3/15/06, CARTER-HITCHIN, David, FM <[EMAIL PROTECTED]> wrote:
> Hi Brett,
>
> Many thanks for replying.  Well I tried PRAGMA temp_store=memory and that
> sadly did not help.
>

I believe the 'not in' does not use indexes, but 'in' does. Can you
flip your logic?


RE: [sqlite] Help needed to diagnose "NOT IN" query

2006-03-15 Thread CARTER-HITCHIN, David, FM
Hi Brett,

Many thanks for replying.  Well I tried PRAGMA temp_store=memory and that
sadly did not help.

I'm going to adopt a different approach. Say I've got:

select a,b,c 
from   d
where  c NOT IN (select c from e)

What I'm trying is:

1. select a,b,c from d into a temp1 table  (as far as I can see SQLite can't
do SELECT INTO, so I'll do it for it by creating the table and selecting and
inserting the rows - please correct me if there's an easier way).
2. select c from e into a second temp2 table
3. delete from temp1 where temp1.c = temp2.c
4. the results left in temp1 will be the rows where c NOT IN (select c from
e) [hopefully :-]

I used to do this with Sybase back in the days when Sybase was really bad
with NOT IN too - they seemed to improve on things around version 12 or
12.5...

Thanks,

David Carter-Hitchin.
--
Royal Bank of Scotland
Interest Rate Derivatives IT
135 Bishopsgate
LONDON EC2M 3TP

Tel: +44 (0) 207 085 1088


> -Original Message-
> From: Brett Wilson [mailto:[EMAIL PROTECTED] 
> Sent: 14 March 2006 16:48
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Help needed to diagnose "NOT IN" query
> 
> 
> David,
> 
> I asked a similar question, and here is drh's response to me, adapted
> to your situation. I think it is probably applicable to you as well.
> I'm not sure this is the type of query that can be made to go really
> fast no matter what. I actually haven't gotten around to doing this
> yet, so I can't comment on how well it works.
> 
> 
> To implement this, SQLite creates a temporary index that contains all
> unique values of holiday_list.number. Then it scans through the table
> and for each entry where holiday.hol_id is not in the temp index.
> 
> Do make sure that your temp tables are stored in RAM.  Compile with
> -DTEMP_STORE=2.  Or at run-time set
> 
>  PRAGMA temp_store=memory;
> 
> That will put the temporary index in RAM and things will tend 
> to go faster.
> 
> Brett
> 
> On 3/14/06, CARTER-HITCHIN, David, FM 
> <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > Hope someone out there can help - I've got this query which 
> runs VERY
> > slowly:
> >
> > SELECTab_tran.ins_num, holiday.hol_id, holiday.ins_num
> > FROM  ab_tran, holiday
> > WHERE ab_tran.ins_num = holiday.ins_num
> > AND   holiday.hol_id NOT IN ( SELECT number from holiday_list )
> >
> > All the tables are fairly chunky, except holiday_list which 
> has 89 rows.  I
> > just realised that holiday.ins_num is needlessly selected 
> but I doubt very
> > much that would be causing things to slow down massively.  
> I can run this on
> > a similar powered Sybase server and it runs in a couple of 
> minutes - with
> > SQLite, using an in-memory database I've left it all night 
> and it didn't
> > finish!  Evidently something is wrong somewhere.  I've 
> created indexes on
> > all the columns in the join and the "NOT IN" clause, but 
> that didn't seem to
> > help.
> >
> > Is there anything else I check?
> >
> > I've run the EXPLAIN (output below), but I'm a novice here, 
> not sure what
> > could be wrong.
> >
> > Any ideas will be highly appreciated.
> >
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:476 - 64 rows 
> extracted in
> > 0.03532 seconds.
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 0 
> Goto0   60
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 1 
> Integer 0   0
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 2 
> OpenRead0
> > 3
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 3 
> SetNumColumns   0
> > 7
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 4 
> Integer 0   0
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 5 
> OpenRead1
> > 5
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 6 
> SetNumColumns   1
> > 2
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 7 
> Integer 0   0
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 8 
> OpenRead3
> > 137675  keyinfo(1,BINARY)
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 9 
> Rewind  0   56
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 10
> Column  0   1
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 11
> NotNull -1  14
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 12Pop 
> 1   0
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 13
> Goto0   55
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 14
> MakeRecord  1
> > 0   i
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 15
> MemStore0
> > 0
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 16
> MoveGe  3   55
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 17
> MemLoad 0   0
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 18
> IdxGE   3   55
> > +
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 19
> RowKey  3   0
> > Tue Mar 14 12:05:10 2006 DEBUG at Cache.cpp:487 - 20
> 

[sqlite] C++ code sharing: import utility program for scripting and command line

2006-03-15 Thread Jay Sprenkle
Good afternoon all,

I've written a utility program in vanilla C++ to help with a project.
I thought I would make it available to the community.

It reads fixed format text files and loads the result into an Sqlite3 table.
The table loaded, positions of the fields within the file, and input
file are given
on the command line. You can also specify literal strings to be
loaded into table columns.

There's nothing terribly new about it but it was useful as a learning exercise
and integrates very well with shell scripting.

I will probably add the ability to handle delimited files
and index drop/recreate.

If there's any interest let me know and I'll make it available.


[sqlite] Different behaviour on Linux vs. Windows?

2006-03-15 Thread Iulian Popescu
Hello,

 

I have the following scenario that fails on Linux and executes fine on
Windows XP.

Suppose the following SQL statement is executed by calling sqlite3_exec:

 

SELECT mySqlFunction()

 

Inside the body of the mySqlFuntion() the following statements are executed

through calls to sqlite3_exec:

 

CREATE TEMP TABLE MyTempTable AS SELECT 'foo'

 

Then a:

 

DROP TABLE MyTempTable

 

The last statement execution fails on Linux (Fedora Core 4) with the

following error "database table is locked" but not on Windows XP.

What would be a reason for that?

 

Thanks,

 

Iulian.

 



Re: [sqlite] RE: SQLite memory leak on Windows CE

2006-03-15 Thread Robert Simpson

Ok, here's what I did ...

On the desktop I created a SQLite database with one table and inserted 
120,000 rows into it.  I then copied it over to the CE emulator.


Then I ran the following code on the CE (Pocket PC 2003 SE) emulator:

#include 
#include 
#include "sqlite3.h"

int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR pszCmdLine, 
int nCmdShow)

{
 sqlite3 *pdb;
 int rc;

 for (int n = 0; n < 1; n++)
 {
   rc = sqlite3_open("\\test.db3", );
   if (rc) break;
   rc = sqlite3_exec(pdb, "select * from testcase", 0, 0, 0);
   if (rc) break;
   rc = sqlite3_close(pdb);
   if (rc) break;
 }
 return 0;
}

On the first call to sqlite3_exec(), available program memory dropped from 
an initial 10.5mb to 8.45mb.  However, once that was done, available memory 
remained rock solid for the duration of the loop at a constant 8.45mb and no 
non-zero error codes were ever returned.


Robert




Re: [sqlite] RE: SQLite memory leak on Windows CE

2006-03-15 Thread Robert Simpson

What method(s) are you using to detect the memory leak?

I'll try and test this out today and see if I can come up with anything.

Robert


- Original Message - 
From: <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, March 15, 2006 6:18 AM
Subject: [sqlite] RE: SQLite memory leak on Windows CE



Hi again, i have tried your advice of changing line 192 at table.c and it 
didn´t work (it fires an exception). I do not think that the problem is 
related to sqlite3_get_table or sqlite3_free_table source code.
To make sure, i have test it with another simple program (see the source 
code below), that doesn´t make use of the sqlite_x_table stuff and Windows 
CE doesn´t free memory properly (memory only gets freed once the main 
program has exited). Please see the testing code i am using (it is quite 
simple)





[sqlite] RE: SQLite memory leak on Windows CE

2006-03-15 Thread [EMAIL PROTECTED]

Hi again, i have tried your advice of changing line 192 at table.c and it 
didn´t work (it fires an exception). I do not think that the problem is related 
to sqlite3_get_table or sqlite3_free_table source code.
To make sure, i have test it with another simple program (see the source code 
below), that doesn´t make use of the sqlite_x_table stuff and Windows CE 
doesn´t free memory properly (memory only gets freed once the main program has 
exited). Please see the testing code i am using (it is quite simple) 
void CMemoryMDlg::OnButton1() 
{   
   sqlite3 *db;
   char *zErrMsg = 0;
   int rc;
   rc = sqlite3_open(\\articulos.db, db);
   if( rc ){
   MessageBox(_T(NO),_T(),MB_OK);
   sqlite3_free(zErrMsg);
   sqlite3_close(db);
   CDialog::OnCancel();
   }
   rc = sqlite3_exec(db, select * from ARTIC ;, 0, 0, zErrMsg);
   if( rc!=SQLITE_OK ){
   sqlite3_free(zErrMsg);
   MessageBox(_T(NO2),_T(),MB_OK);
   }
   sqlite3_free(zErrMsg);
   sqlite3_close(db);
}
Thank you in advance,
Eduardo Esteban
---Mensaje original---On March 14, 2006 01:49 pm, [EMAIL PROTECTED] wrote:
 Hello again,
 Thank for your answers:
 first of all thank you who pointed that i should use a close(db) at
 line 17 and call sqlite3_free_table(result) even if there was an
 error, but these solutions didn´t solve my problem (the execution
 code never reached that point because ret value was always
 SQLITE_OK). Do anyone of you work with SQLite on Windows CE?

No, I don't have win ce either.
However, I looked at the sqlite code and there may be a bug.

In SQLite3.3.4 go to:
src\table.c line 192 and change azResult--;
changed_from-
190 if( azResult ){
191 int i, n;
192 azResult--;
193 if( azResult==0 ) return;
194 n = (int)azResult[0];
changed_to-
190 if( azResult ){
191 int i, n;
192 azResult -= sizeof(char*); changed
193 if( azResult==0 ) return;
194 n = (int)azResult[0];

Recompile sqlite and try again.
Let us know if it works.


Automóviles, telefonía, imagen y sonido, belleza... ¡encuentra gratis todo lo 
que necesitas! http://clasificados.wanadoo.es/

Re: [sqlite] RE:Re: [sqlite] SQLite memory leak on Windows CE

2006-03-15 Thread Jose Da Silva
On March 14, 2006 01:49 pm, [EMAIL PROTECTED]  wrote:
> Hello again,
> Thank for your answers:
> first of all thank you who pointed that i should use a close(db) at
> line 17 and call sqlite3_free_table(result) even if there was an
> error, but these solutions didn´t solve my problem (the execution
> code never reached that point because ret value was always
> SQLITE_OK). Do anyone of you work with SQLite on Windows CE?

No, I don't have win ce either.
However, I looked at the sqlite code and there may be a bug.

In SQLite3.3.4 go to:
"src\table.c" line 192 and change "azResult--;"
changed_from-
190  if( azResult ){
191int i, n;
192azResult--;
193if( azResult==0 ) return;
194n = (int)azResult[0];
changed_to-
190  if( azResult ){
191int i, n;
192azResult -= sizeof(char*);