Re: [sqlite] Bounds Checker

2006-08-12 Thread Shawn Walker
Thanks! I will run that test on Monday and let you know what 
BoundsChecker finds.


Thanks,
Shawn

[EMAIL PROTECTED] wrote:

Shawn Walker <[EMAIL PROTECTED]> wrote:
What regression testing did you use?  I would like to run the same test 
with Bounds Checker and see what I see.




valgrind ./testfixture ../sqlite/test/quick.test

--
D. Richard Hipp   <[EMAIL PROTECTED]>



Re: [sqlite] Bounds Checker

2006-08-12 Thread Shawn Walker
What regression testing did you use?  I would like to run the same test 
with Bounds Checker and see what I see.


Shawn

[EMAIL PROTECTED] wrote:

Shawn Walker <[EMAIL PROTECTED]> wrote:
Has anybody run Bounds Checker on SQLite 3? 


valgrind (http://valgrind.org/) shows that SQLite3 is free
of memory leaks and buffer overruns.

--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] Bounds Checker

2006-08-11 Thread Shawn Walker
Has anybody run Bounds Checker on SQLite 3?  I'm getting a lot of memory 
leaks, overruns, etc that is being reported by Bounds Checker.  But, what is 
strange is that the warning message doesn't match up with the source for 
some reason.  For example:


Memory Leak Leaving Scope: Variable z references address 0x080FC710 (154) 
allocated by malloc.


void *sqlite3MallocRaw(int n){
  void *p;
  if( n==0 ) return 0;
  if( (p = malloc(n))==0 ){
if( n>0 ) sqlite3_malloc_failed++;
  }
  return p;
}

Bounds Checker is highlighting "if( (p = malloc(n))==0 ){", but there is no 
"z variable".


Thanks,
Shawn


[sqlite] Compiling SQLite 3 on Windows

2006-08-11 Thread Shawn Walker
Do I need to compile SQLite 3 source code with "-DNDEBUG" for the no debug 
version?  I see "NDEBUG" in the source, but wasn't sure.


Thanks,
Shawn


Re: [sqlite] How to get the size of the value

2005-07-28 Thread Shawn Walker



Dennis Cote wrote:

Shawn Walker wrote:

How do I determine the size of the value of the string/blob that is in 
the database?  I would like to know how big the data so that I can 
determine how to handle the data if it's a large data so that I can 
put the data in a file instead of in memory.



Shawn,

You can use the sqlite3_column_bytes() API function to get the size of a 
string or blob, but by the time you can do this (i.e. after calling 
sqlite3_step()) it is already in memory and ready to be returned to you 
using sqlite3_column_blob() or sqlite3_column_text(). These functions 
return pointers to the buffer that holds the blob or string. You could 
perhaps use this to copy each individual blob to a file so you only have 
the current one in memory (rather than having many large blobs in memory).


Sqlite deals with blobs a single objects, and doesn't let you read or 
write the value in small chunks as you seem to be looking for. You can't 
store and retrieve blobs that are bigger than your available memory.


For large blobs, the consensus seems to be that you are best off storing 
the data in a file and storing the filename in your database. However 
you do lose the nice "one file per database" characteristic of sqlite by 
doing this.


HTH
Dennis Cote



Thanks Dennis,

We are currently storing very large data in a seperate file and store 
the filename in the database.  The type of strings/blob that we are 
storing the DB can sometimes get big, but not so big that we require 
those to be in a file.  The reason I would like to get the size of the 
data before they are in memory is to decide if I want to store that 
string/blob in memory or redirect them to a temporary file for the user

to view the data.

Shawn


[sqlite] How to get the size of the value

2005-07-28 Thread Shawn Walker
How do I determine the size of the value of the string/blob that is in 
the database?  I would like to know how big the data so that I can 
determine how to handle the data if it's a large data so that I can put 
the data in a file instead of in memory.


Thanks,
Shawn


Re: [sqlite] Limit how much data to read

2005-07-25 Thread Shawn Walker
Where in the documentation that explains how to use the sqlite substr() 
function?


Cory Nelson wrote:

Try the substr() function

On 7/25/05, Shawn Walker <[EMAIL PROTECTED]> wrote:


Is there a way to tell sqlite to read up to X bytes?  For example, there
are some data that can be quite large, but I don't need all of them,
just a little bit of it to show the user some of the data and they can
select that data to get the rest of the data from the DB.







[sqlite] Limit how much data to read

2005-07-25 Thread Shawn Walker
Is there a way to tell sqlite to read up to X bytes?  For example, there 
are some data that can be quite large, but I don't need all of them, 
just a little bit of it to show the user some of the data and they can 
select that data to get the rest of the data from the DB.


Re: [sqlite] Reading strings and blobs

2005-07-22 Thread Shawn Walker

D. Richard Hipp wrote:

On Fri, 2005-07-22 at 19:15 -0500, Shawn Walker wrote:

Is there a way to have sqlite to call a callback function to read in 
strings and blobs? 



No.

If your blobs are too big to fit in memory, perhaps you should
consider storing them each in a separate file and then store
just the filename in the database.


They are not too big for the memory, the point is that reading from sql 
is one set of memory and then I need put that blob into another a file. 
 If there was a way that callback could be done, that small set of 
memory would pass it to the call back and then I can set it into a file.


[sqlite] How Disable Journaling on Windows

2004-10-12 Thread Shawn Walker
How do I disable Journalling in SQLite 3.0?  I thought setting "PRAGMA 
temp_store=MEMORY;" would do that?

Thanks,
Shawn