[sqlite] sqlite3_open16_v2 / ticket 2869

2009-09-06 Thread Sherief N. Farouk
Is there any reason not to incorporate the diff posted for ticket 2869 into
the main branch and have sqlite3_open16_v2()?

 

-  Sherief

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


[sqlite] sqlite3_exec() documentation

2009-06-19 Thread Sherief N. Farouk
The documentation found at http://sqlite.org/c3ref/exec.html is unclear
about some parts: is it possible to not request an error message (via
passing NULL as the errmsg parameter)? And what are the possible return
values?

- Sherief

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


Re: [sqlite] Problems with file locks on USB keys

2009-04-03 Thread Sherief N. Farouk
> Hi - it only happens on Windows systems that are using U3 USB keys.
> None of
> the queries are intensive - they are pretty simple and shouldn't take
> longer
> than a few milliseconds.
> 
> On harddisks it *always* works. Never had an issue there.
> 

Like Teg said, you can use procmon in addition to a useful utility by
sysinternals called "handle" - tells you what processes has open handles.
"handle X:" will list open handles to files on drive X.

I want to blame the awful U3 software though.

- Sherief

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


Re: [sqlite] A bit OT: Good CVS client for Windows

2009-02-26 Thread Sherief N. Farouk


On Feb 26, 2009, at 16:28, "J. R. Westmoreland"  wrote:

> Can someone please give me a suggestion for a good client for CVS  
> that runs
> under Windows?
>
> I have my linux system but figured it would be nice to have a client  
> in both
> places, a belt and suspenders kind of person I guess.
>
>
>
> Thanks,
>
> J. R.
>
>
>
> 
>
> J. R. Westmoreland
>
> E-mail: j...@jrw.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] A bit OT: Good CVS client for Windows

2009-02-26 Thread Sherief N. Farouk
Try TortoiseCVS.

- Sherief

On Feb 26, 2009, at 16:28, "J. R. Westmoreland"  wrote:

> Can someone please give me a suggestion for a good client for CVS  
> that runs
> under Windows?
>
> I have my linux system but figured it would be nice to have a client  
> in both
> places, a belt and suspenders kind of person I guess.
>
>
>
> Thanks,
>
> J. R.
>
>
>
> 
>
> J. R. Westmoreland
>
> E-mail: j...@jrw.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] Error message This program cannot be run in DOS

2009-02-08 Thread Sherief N. Farouk
> Here is what I did
> 
> I downloaded
> sqlite-3_6_10.zip  245,575  bytes
> which unzipped to
> sqlite3.exe501,456

Why not post a cryptographic hash of the exe file you have, and the output
of the "ver" command when ran from your "command prompt".

- Sherief

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


Re: [sqlite] codepages

2009-01-24 Thread Sherief N. Farouk
> dear users
> I use sqlite for vb6, utf-8 database,
> when insert arabic data to database
> and search it with 'like' operator
> (within % syntax), return all records!!!
> Please help me...
> thanks
> John Smith
> ___

Arabic, in general, is one hell of a language to deal with. Can you provide
some sample data, like a db file and sample query?

- Sherief

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


Re: [sqlite] Transaction within script

2009-01-02 Thread Sherief N. Farouk
> SAVEPOINTs is the way PostgreSQL and MySQL do it, as well as many
> other SQL database engines.  We want to maximize compatibility.
> 
> We have discussed letting you used named transactions using BEGIN.  We
> might add that in the future.  But for now, SAVEPOINT seems to be the
> safest way to do things - and the least likely to cause compatibility
> problems.
> 

Makes perfect sense. I'm still hoping for nested transactions sometime soon,
hope the savepoint code makes it easier ;)

..pretty please?..

- Sherief

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


Re: [sqlite] Transaction within script

2009-01-02 Thread Sherief N. Farouk
> Preliminary documentation can be seen at
> http://www.sqlite.org/draft/lang_savepoint.html


Why savepoints? Why not just add support for named transactions? Is there
some semantic difference I'm missing?

- Sherief 

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-27 Thread Sherief N. Farouk
> The given code is correct. The lower-case string is a C# alias for the
> System.String class. System.Int64 is an opaque 64-bit pointer value.

Seems like the grasping deficiencies are on my side :D.

> The code so far is correct. What is missing though is the calling
> convention, which by default is cdecl, but .NET doesn't use that one
> by default for P/Invoke. It uses stdcall/winapi as the default calling
> convention. Change the CallingConvention in the DllImport line.
> 
> Additionally using CharSet=CharSet.Unicode adds an implicit W as per
> Win32 calling conventions to the function name. Since the
> sqlite3_open16
> doesn't have that you need to use ExactSpelling to prevent it from
> adding
> that W.

Off topic: God, that's ugly.

> Instead of rolling your own P/Invoke wrapper I'd suggest using one of
> the available .NET wrappers for SQLite.

Best idea so far!

- Sherief

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-27 Thread Sherief N. Farouk
> I am calling now this:
> 
> [DllImport("sqlite3.dll", CharSet = CharSet.Unicode)]
> internal static extern System.Int64 sqlite3_open16(string
> filename, out IntPtr handle);
> 
> I now finds an entry point, but i returned to the previous error:
> An attempt was made to read program in invalid format.
> 
> But now everything is 64bit.
> 
> Ti Ny
> 

No offense, but I'm beginning to believe you don't fully grasp what you're
trying to do. First of all, if DW can't find the entry point then it's not
there. Second, I don't think the CLR type corresponding to the return value
of sqlite3_open16 is System.Int64, and I'm not sure what string is (CLR's
string type is String, capital S). How about you upload that DLL of your
somewhere, send a link and I wouldn't mind checking it for you.

- Sherief

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-26 Thread Sherief N. Farouk
> 
> It throws an exception: unable to find entry point sqlite3_open16

Try opening the DLL with Dependency Walker, make sure the entry point *is*
there?

- Sherief

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


Re: [sqlite] CMAKE support for sqlite3

2008-11-25 Thread Sherief N. Farouk
> SET( CMAKE_INSTALL_PREFIX "f:/doof" )

This *will* cause problems for some people ;).

Otherwise, I love CMake, so I'm all for this. Any chance a stable CMake file
would be hosted on sqlite.org?

- Sherief

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


Re: [sqlite] sqlite3_open16 fails on Windows Vista 64b

2008-11-25 Thread Sherief N. Farouk
Does sqlite3_open fail too?

- Sherief

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


Re: [sqlite] sqlite3_prepare memory leak

2008-11-16 Thread Sherief N. Farouk
> Hi,
> 
> Sherief, thank you for our kind help.

You're welcome :).

> I really did use globals.
> I found a way to run DumpMemorLeaks after all globals and static
> variables are deallocated, I used
> _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);

I should've RTFMed harder :(.

> I made some malloc and new leaks around the code I'm interested in to
> see if it works - worked great, but I found
> NO leaks in sqlite sqlite3_prepare.

As expected.

> I'm not sure if it means that there is an error in Deleaker or
> CrtDumpMemoryLeaks doesn't report mallocs from DLL ( i bet on Deleaker
> because it claims that there is a leak in heap so CrtDumpMemoryLeaks
> should show this  ).
> 
> How do you think?
>
> Bartek

The behavior of _CrtDumpMemoryLeaks() is a bit tricky across module
barriers. Though not in MSDN, but from a simple app/dll combination I built
I found out that _CrtDumpMemoryLeaks() reports memory leaks caused by the
calling module only (exe or dll: if dll leaks and exe calls it, no leak will
be reported). Also, it doesn't watch memory not allocated by the CRT, such
as via Heap*() functions. How much do you know about the DLLs you're using?
Are they reliable? Does your leak checker support some sort of stack-trace
option to show where the leaked memory was allocated? How does it handle
non-CRT allocations (not malloc() and new)?

- Sherief

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


Re: [sqlite] sqlite3_prepare memory leak

2008-11-05 Thread Sherief N. Farouk
> I really don't see any way to use  _CrtDumpMemoryLeaks(). It always
> shows hundreds of blocks even if I'm sure that nothing was allocated
> (no malloc or new). I know that this is not a place to learn how to
> use VC++. Maybe it's true that Deleaker just freaks out. I will try to
> track it down another way. All ideas appreciated.
> 
> Bartek

TFM should be helpful. Do something like:

Int main()
{
//Note the extra scope..
{
//...app work goes here
}
_CrtDumpMemoryLeaks(); //I hope you're not using globals, if so
deallocate them before this call.
Return 0;
}

Watch the output window, and if leaks are detected (and your app's
allocation behavior is pretty deterministic), _CrtSetBreakAlloc() is you
best friend.

- Sherief

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


Re: [sqlite] Slow INSERT on fast machine, fast INSERT on slow machine

2008-11-05 Thread Sherief N. Farouk
> I found that win function FlushFileBuffers (used by SQLite) slows down
> performances,
> but still don't have explanation why this funcion on some machines
> works 10x slower then on others.
> 
> I have used win xp sp2 on all machines where I have tested the
> behaviour.

Try using CodeAnalyst, see where the time is being spent..

- Sherief

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


Re: [sqlite] sqlite3_prepare memory leak - OT

2008-11-04 Thread Sherief N. Farouk
>   SQLite also does some "interesting" things with pointers.  There are
>   a few areas of the code where an array of memory is allocated and
>   then the pointer is backed up a record (under-running the allocated
> space)
>   to make the array 1-based rather than 0-based.  All of the access is
>   correct and inside the valid memory, but many analysis tools freak
> out
>   and get very worried (and rightfully so) over that kind of behavior.
> 
>-j

I'd be willing to bet good money that this lies somewhere in a b/r tree
implementation. I did a similar thing when I needed to implement the b-tree
algorithms from CLRS's Intro. To Algorithms under a very tight time schedule
:).

- Sherief

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


Re: [sqlite] Slow INSERT on fast machine, fast INSERT on slow machine

2008-11-04 Thread Sherief N. Farouk
> The problem is that I'm getting better performance on AMD machine with
> ATA disk,
> but 10 times slower on DualCore machine with SATA disk (both disks are
> at 7200 rpm)...
> I don't understand the source of this behaviour...

OS? Tried VSTS profiler, VTune or the free CodeAnalyst to look at where the
time is being spent?

- Sherief

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


Re: [sqlite] sqlite3_prepare memory leak

2008-11-03 Thread Sherief N. Farouk
> As you can see I use sqlite3_prepare/sqlite3_finalize pairs. My memory
> leak checker ( Deleaker : www.deleaker.com ) reports memory leak at
> sqlite3_prepare :
> 
> msvcrt.dll!malloc
> sqlite3.dll!sqlite3_malloc + 120 bytes
> sqlite3.dll!sqlite3_realloc + 27 bytes
> sqlite3.dll!sqlite3_release_memory + 200 bytes
> sqlite3.dll!sqlite3_release_memory + 242 bytes
> sqlite3.dll!sqlite3_set_authorizer + 1072 bytes
> sqlite3.dll!sqlite3_set_authorizer + 22149 bytes
> sqlite3.dll!sqlite3_declare_vtab + 11632 bytes
> sqlite3.dll!sqlite3_prepare16_v2 + 18070 bytes
> sqlite3.dll!sqlite3_declare_vtab + 27000 bytes
> sqlite3.dll!sqlite3_declare_vtab + 31896 bytes
> sqlite3.dll!sqlite3_declare_vtab + 36104 bytes
> sqlite3.dll!sqlite3_reset_auto_extension + 12492 bytes
> sqlite3.dll!sqlite3_reset_auto_extension + 13270 bytes
> sqlite3.dll!sqlite3_prepare + 31 bytes
> RSR2.exe!SQLite3pp::readBlob Line 164
> (c:\furtado\furtado\sqlite\sqlite3pp.cpp)
> 
> I am closing database properly.
> Am I doing something wrong or is it some kind of bug?

99% of the time the leaks are due to API abuse. Post a small sample app
(that build and runs) exhibiting the behavior, if possible. What does
_CrtDumpMemoryLeaks() say?

- Sherief

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


Re: [sqlite] BLOB Incremental IO

2008-10-31 Thread Sherief N. Farouk
> I have a problem with BLOB writing. I need to write
> some binary stream into sqlite table. As I understood, incremental
> BLOB I/O requires space of constant size to be preallocated
> with zeroblob, but I don't know the size of stream in advance.
> And sqlite doesn't allow to change the size of BLOB field.
> The stream can be large, so I don't want to preload all the data
> from it to memory.
> So, is there a way to organize streamed output in my case?

Here's what I do: Split the blob into multiple pieces, stored in a table
with their sequence number as the primary key. For sequential writes, this
shouldn't be any hard. For random I/O, however, I needed to make quite some
changes. What's your usage scenario like?

- Sherief

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


Re: [sqlite] SQLite on Nintndo DS?

2008-10-31 Thread Sherief N. Farouk
> I have the DevKit and all the goodies and am able to make the DS jump
> though
> hoops. But I always have trouble with SQLite. I'm one of those who gets
> the
> very irritating huge numbers of compile errors that have something to
> do with
> compiler version versus SQLite version versus header file version. I
> was hoping
> to find the answer before spending the time to figure out the
> tools/versions
> fixes since if it won't fit, it is a total waste of time.

Why don't you tell us (what you can) about the errors you're getting?

> I use it built in on iPhone -- oops. Can't talk about iPhone.

Ahahahaha.

- Sherief

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


Re: [sqlite] SQLite on Nintndo DS?

2008-10-30 Thread Sherief N. Farouk
> Has anyone used SQLite on the NintendoDS? Can it fit? Arm7 and ARM9 and
> a
> cartridge like an SD card. The database can be static in FLASH. But the
> rest?
> 
> -- Charlie Springer
> 

[Sherief N. Farouk] 

If you have an official devkit, or care to grab a copy of the
I-don't-know-if-it's-legal DevKit Pro, you can try it out yourself and let
us know how it works.

- Sherief

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


Re: [sqlite] SQLITE_STATIC and bind*()

2008-10-13 Thread Sherief N. Farouk
> > Sqlite3_bind_text(Statement, S.c_str(), S.size() + 1,
> > SQLITE_[TRANSIENT | STATIC?]);
> 
> Drop +1. It's unlikely that you actually want terminating NUL to be
> part
> of the string in the database.
> 

Sorry, mixed that one with the nByte parameter of prepare_v2. It's "-1" in
code though, so my program shouldn't exhibit a problem. I wrote the snippet
in this email on the fly :).

> > Is SQLITE_STATIC suitable for this situation?
> 
> Yes, as long as "use statement" part involves calling sqlite3_reset or
> sqlite3_finalize on Statement.

So no accesses happen after a finalize or reset, perfect :).

Thanks a lot for the help.

- Sherief

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


[sqlite] SQLITE_STATIC and bind*()

2008-10-13 Thread Sherief N. Farouk
Does the bind text family attempt to access the data pointed to by the
passed parameter after the lifetime of the function call? I have a situation
similar to the following:

 

Std::string S("Blah");
foo(S);

Rest_of_program();

 

Where foo() is:

 

Void foo(string& S)

{

//prepare a statement

Sqlite3_bind_text(Statement, S.c_str(), S.size() + 1, SQLITE_[TRANSIENT |
STATIC?]);

//use statement

}

Is SQLITE_STATIC suitable for this situation? The string S is guaranteed to
be "alive" until foo returns, but not afterwards. If S was terminated after
the call to foo(), is my program well formed or do I need to use
SQLITE_TRANSIENT?

 

-  Sherief

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


Re: [sqlite] Compile SQLite3 for MS Windows Driver Kit user-modeapplication

2008-10-07 Thread Sherief N. Farouk
I agree with Michael. Some of these warnings can be stopped with trivially
small code modifications, and they do try to prevent human error. Consider
this line (from my 3.5.9 amalgamation):

X1 = 365.25*(Y+4716); //X1 is an int

Which produces the following warning in VC++2008:

warning C4244: '=' : conversion from 'double' to 'int', possible loss of
data

This is useful. It's the compiler telling you "Watch out, a truncation is
taking place here. Was that your original intention?"

It can easily be suppressed by changing the line into:

X1 = (int) (365.25*(Y+4716)); //Yes, truncation is taking place, that's how
I want it.

So why not fix this? I can understand (and even recommend ;) using
_CRT_SECURE_NO_WARNINGS on VC++, but fixing these small ones won't hurt
anyone, and makes the code slightly easier to read for a new comer. 

- Sherief

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of Michael Ruck
> Sent: Tuesday, October 07, 2008 11:33 AM
> To: 'General Discussion of SQLite Database'
> Subject: Re: [sqlite] Compile SQLite3 for MS Windows Driver Kit user-
> modeapplication
> 
> Dan,
> 
> While I do understand the position chosen by SQLite, these warnings do
> try
> to prevent human error. In case of Visual C++, Microsoft has added lots
> of
> tests in order to make porting code from 32-bits to 64-bits easier. And
> those
> problems Mark wrote about were certainly reported as warnings since
> 2002 -
> maybe even earlier.
> 
> The point I'm trying to make is that generally turning off warnings is
> a bad
> idea. If you dislike a warning for "stylistic purposes", that's fine -
> then
> only turn of those warnings with appropriate pragmas.
> 
> Generally hiding warnings is a mistake IMHO.
> 
> Mike
> 
> > -Urspr√ľngliche Nachricht-
> > Von: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] Im Auftrag von Dan
> > Gesendet: Dienstag, 7. Oktober 2008 16:30
> > An: General Discussion of SQLite Database
> > Betreff: Re: [sqlite] Compile SQLite3 for MS Windows Driver
> > Kit user-modeapplication
> >
> > > The flood of warnings is a pain.  SQLite dev claims they are all
> > > spurious, but with so many I wouldn't venture to guess how they can
> > > tell.
> >
> >http://www.sqlite.org/faq.html#q17
> >
> >
> > ___
> > 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] looking for tools to map SQLite to C++ objects

2008-09-25 Thread Sherief N. Farouk
> What do you mean by "Mapping".  There are several api wrappers for
> sqlite written in C++.  See
> http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers
> 

After checking some of the things on that list, ruling out some for
superficial reasons (like thinking that C++ is Java and writingLikeThis), I
found sqlite3pp (http://code.google.com/p/sqlite3pp/ ) to be pretty darn
neat. My own version actually uses the same sqlite3pp namespace (lending
this one more points of course ;), and the google-hosted one has some of the
cleanest API designs I've ever seen, including the oh-so-neat iterators for
SELECT results. I'd say if you're looking for a C++ wrapper, go with this
one (I realize the OP might not be looking for an API wrapper). I didn't
look at the implementation (because I'm working on an already so-close
library), but I do hope it's not commented in Korean ;).

- Sherief

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


Re: [sqlite] looking for tools to map SQLite to C++ objects

2008-09-25 Thread Sherief N. Farouk
> Does anyone know of any tools that are either open source or reasonably
> priced (less then 600 USD) for mapping SQLite to C++?
> 
> Sam

[Sherief N. Farouk] 

No tools that I know of, but I have a small bunch of classes that I wrote to
wrap sqlite3 objects, in order to make some things easier (like not having
to remember to close() the DB object at every single return statement), all
of which are convertible to the underlying sqlite types for interoperability
with the native API. If someone's interested, I could arrange for a BSD
release.

- Sherief

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


Re: [sqlite] prices

2008-09-21 Thread Sherief N. Farouk
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of Arvind M
> Sent: Sunday, September 21, 2008 3:30 AM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] prices
> 
> dear sir
> 
> i am interested in  purchase of licence of sqlite server
> 
> kindly send me the detail
> 
> arvind
> systime

[Sherief N. Farouk] 

Dear Pointy Haired Boss,

Please let Dilbert handle this one instead.

Best Regards,

- Sherief

(I'm sorry. I saw this and I just couldn't resist. I deserve everything you
throw at me, but this is even better than the Windows Cache Manager bashing
a few days ago.)

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


Re: [sqlite] Vista frustrations

2008-09-17 Thread Sherief N. Farouk

> I ran some tests using the command-line sqlite3.exe, and observed that
> Windows Vista (SP1) is actually trying to cache the entire 5gb file
> into
> memory during the table scan!  The system slows to a complete crawl and
> becomes unresponsive.  The sqlite3.exe's memory remains very minimal,
> but
> Vista itself eats every last scrap of physical memory, forcing all
> other
> apps to the paging file trying to cache the contents of the database.

[Sherief N. Farouk] 

Any chance you could make a small C program to reproduce this case (via
procedurally creating a similarly-sized database)? Out of curiosity, was
that on x86 or x64?

- Sherief

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


Re: [sqlite] Difference in performance between 32 and 64 bit versions of SQLite?

2008-09-01 Thread Sherief N. Farouk
I can't speak for SQLite, but off of the top of my head, a 64-bit platform
will give you enough virtual address space to memory map the files, which
usually proves to be a win. I'd say go with the 64-bit systems and as much
ram as you can afford.

- Sherief

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
> Sent: Monday, September 01, 2008 3:10 PM
> To: General Discussion of SQLite Database
> Subject: [sqlite] Difference in performance between 32 and 64 bit
> versions of SQLite?
> 
> Does anyone have any benchmarks to share that compare common SQLite
> operations running under a 32 and 64 bit versions of SQLite? This
> question is OS neutral so please feel to share your experience with 32
> and 64 bit versions of Windows or Linux.
> 
> Background: Will 64 bit versions of SQLite buy us any significant
> difference in performance? I may have a chance to get our department 64
> bit AMD workstations with 8G, but I need to justify the extra cost
> against a reasonable guess at what the performance improvement may be
> against an equivalent 32 bit AMD 4G workstation. These workstations
> will
> be processing very large text based log files (> 16G each). We will be
> using Python 2.52 as our SQLite scripting tool.
> 
> Thank you,
> Malcolm
> ___
> 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] Hard time with blobs

2008-07-25 Thread Sherief N. Farouk
That will make this case legal. What's the general behavior though? Is it
not guaranteed to be consumed during the call to bind_blob? In other words,
without providing SQLITE_TRANSIENT, can I get into trouble with this?

- Sherief

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of Dan
> Sent: Friday, July 25, 2008 3:22 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Hard time with blobs
> 
> 
> On Jul 25, 2008, at 12:05 PM, Sherief N. Farouk wrote:
> 
> > I'm having a problem with the last parameter, the function used to
> > dispose
> > of the blob. Does sqlite defer actually inserting the blob into the
> > database
> > somehow? In other words, will I get into trouble if I do:
> >
> > Sqlite3_bind_blob(Statement, 1, BlobData, BlobSize, do_nothing);
> > Delete [] BlobData;
> >
> 
> Use SQLITE_TRANSIENT.
> 
> Dan.
> 
> > ?
> >
> > - Sherief
> >
> >> -Original Message-
> >> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> >> [EMAIL PROTECTED] On Behalf Of Dan
> >> Sent: Friday, July 25, 2008 12:51 AM
> >> To: General Discussion of SQLite Database
> >> Subject: Re: [sqlite] Hard time with blobs
> >>
> >>
> >> On Jul 25, 2008, at 10:35 AM, Sherief N. Farouk wrote:
> >>
> >>> I want to use blobs to store binary objects in the database, but
> >>> I'm having
> >>> a hard time understanding how they work. First of all, I don't see
> >>> a way to
> >>> set a blob's size, and sqlite3_blob_write doesn't increase the size
> >>> of the
> >>> blob, which is putting me in a weird catch-22 situation.
> >>>
> >>> What's the best solution for storing a bunch of binary objects,
> >>> given the
> >>> two alternatives: They may be immutable (write once, read many), or
> >>> mutable
> >>> (write many, possibly overwriting regions or appending, write
> many)?
> >>
> >> You can work with blobs without using the sqlite3_blob_XXX() APIs.
> >> Insert
> >> blobs by binding them with sqlite3_bind_blob(), retrieve them using
> >> sqlite3_column_blob().
> >>
> >> Sometimes it is better to use the sqlite3_blob_XXX() APIs because
> >> they
> >> allow sqlite to work with large blobs without creating a copy of the
> >> blob in memory. To create a large zeroed blob in the database, use
> >> either sqlite3_bind_zeroblob() or the "zeroblob" SQL function. Then
> >> populate it using sqlite3_blob_XXX() after it has been inserted.
> >>
> >> Dan.
> >>
> >> ___
> >> 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-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] Hard time with blobs

2008-07-24 Thread Sherief N. Farouk
I'm having a problem with the last parameter, the function used to dispose
of the blob. Does sqlite defer actually inserting the blob into the database
somehow? In other words, will I get into trouble if I do:

Sqlite3_bind_blob(Statement, 1, BlobData, BlobSize, do_nothing);
Delete [] BlobData;

?

- Sherief

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of Dan
> Sent: Friday, July 25, 2008 12:51 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Hard time with blobs
> 
> 
> On Jul 25, 2008, at 10:35 AM, Sherief N. Farouk wrote:
> 
> > I want to use blobs to store binary objects in the database, but
> > I'm having
> > a hard time understanding how they work. First of all, I don't see
> > a way to
> > set a blob's size, and sqlite3_blob_write doesn't increase the size
> > of the
> > blob, which is putting me in a weird catch-22 situation.
> >
> > What's the best solution for storing a bunch of binary objects,
> > given the
> > two alternatives: They may be immutable (write once, read many), or
> > mutable
> > (write many, possibly overwriting regions or appending, write many)?
> 
> You can work with blobs without using the sqlite3_blob_XXX() APIs.
> Insert
> blobs by binding them with sqlite3_bind_blob(), retrieve them using
> sqlite3_column_blob().
> 
> Sometimes it is better to use the sqlite3_blob_XXX() APIs because they
> allow sqlite to work with large blobs without creating a copy of the
> blob in memory. To create a large zeroed blob in the database, use
> either sqlite3_bind_zeroblob() or the "zeroblob" SQL function. Then
> populate it using sqlite3_blob_XXX() after it has been inserted.
> 
> Dan.
> 
> ___
> 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] Hard time with blobs

2008-07-24 Thread Sherief N. Farouk
I want to use blobs to store binary objects in the database, but I'm having
a hard time understanding how they work. First of all, I don't see a way to
set a blob's size, and sqlite3_blob_write doesn't increase the size of the
blob, which is putting me in a weird catch-22 situation.

What's the best solution for storing a bunch of binary objects, given the
two alternatives: They may be immutable (write once, read many), or mutable
(write many, possibly overwriting regions or appending, write many)?

- Sherief

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


Re: [sqlite] Transaction Files / SQLite?

2008-07-23 Thread Sherief N. Farouk
I looked into that, and there seems to be one problem: How to expand the
size of a blob? A write won't expand it, according to (my understanding) of
the docs.

- Sherief

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of Dennis Cote
> Sent: Wednesday, July 23, 2008 10:22 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Transaction Files / SQLite?
> 
> Sherief N. Farouk wrote:
> >
> > Streams are parallel 'bags of bytes' of a file. As in, you can
> > open("x.txt"). or open("x.txt:SomeStream"). Or open
> > ("x.txt:SomeOtherStream"). When you copy x.txt, the streams get
> copied with
> > it (assuming, of course, the destination filesystem is NTFS).
> >
> > TxF is simple: modifications to the file aren't visible to other apps
> till
> > you commit, and the commit is atomic: other processes see the file as
> either
> > before or after the transaction. Basically, I don't want the contents
> > written while another process is doing a read().
> >
> > Hope that made things clearer.
> >
> 
> Yes, much clearer.
> 
> It seems to me that you could use blobs and the blob I/O support in
> SQLite to implement the streams of one (or more files) in a single
> database file. The transactions and built in locking in SQLite should
> provide all the functionality you need to provide atomic multiple
> reader
> single writer access to the database file.
> 
> Dennis Cote
> 
> 
> ___
> 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] Transaction Files / SQLite?

2008-07-23 Thread Sherief N. Farouk
In a nutshell:

Streams are parallel 'bags of bytes' of a file. As in, you can
open("x.txt"). or open("x.txt:SomeStream"). Or open
("x.txt:SomeOtherStream"). When you copy x.txt, the streams get copied with
it (assuming, of course, the destination filesystem is NTFS).

TxF is simple: modifications to the file aren't visible to other apps till
you commit, and the commit is atomic: other processes see the file as either
before or after the transaction. Basically, I don't want the contents
written while another process is doing a read().

Hope that made things clearer.

- Sherief

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of Dennis Cote
> Sent: Wednesday, July 23, 2008 9:46 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Transaction Files / SQLite?
> 
> Sherief N. Farouk wrote:
> > I'm currently trying to port an application that does a lot of work
> based on
> > two NTFS features: Streams, and Transactional NTFS. Since TxF is a
> HUGE
> > feature, with a lot of potential pitfalls, I thought I might do this
> as a
> > layer over SQLite: a db file with one table, multiple rows: one for
> each
> > stream. I'd love to hear what everyone thinks, and if there's a more
> > obvious/performance oriented way to do this. How should I go around
> storing
> > the stream data, as the files are not text (and indeed, lots of NULLs
> lie
> > within). I'll mostly need to read/write sub-regions of the file from
> > multiple apps, all running at the same time.
> >
> 
> That was pretty vague, at least to me.
> 
> Can you explain what NTFS streams and transactions do and how you use
> them? Can you tell us how your application uses these features?
> 
> Without more information about what you are trying to do I don't think
> I
> can comment on the efficacy of using SQLite.
> 
> Dennis Cote
> ___
> 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] Ignoring "The"

2008-07-23 Thread Sherief N. Farouk
Can you define a custom less-than operator for sorting? If this were C++,
I'd do std::sort(Result.begin(), Results.end(), MyCustomOperator());

- Sherief

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of Andrew Gatt
> Sent: Wednesday, July 23, 2008 9:41 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Ignoring "The"
> 
> 
> >> I have a table of music artist names which i'd like to output in
> order.
> >> Normally i just use:
> >>
> >> select * from artists order by artist_name;
> >>
> >> What i'd really like to do is order the artists by name but ignore
> any
> >> "the" or "the," preceding it.
> >>
> >> Any ideas?
> >>
> >> Thanks
> >>
> >> Andrew
> >>
> >>
> > Store it like "Beatles, The" them make the transformation latter, if
> > necessary?
> >
> > That's one idea.
> >
> > Best,
> > Daniel
> >
> >
> Thanks for the reply, I may be able to use this approach in future. But
> there are already many entries in the table and so an SQL statement
> that
> does it for me would be good!
> 
> Andrew
> ___
> 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] Transaction Files / SQLite?

2008-07-23 Thread Sherief N. Farouk
I'm currently trying to port an application that does a lot of work based on
two NTFS features: Streams, and Transactional NTFS. Since TxF is a HUGE
feature, with a lot of potential pitfalls, I thought I might do this as a
layer over SQLite: a db file with one table, multiple rows: one for each
stream. I'd love to hear what everyone thinks, and if there's a more
obvious/performance oriented way to do this. How should I go around storing
the stream data, as the files are not text (and indeed, lots of NULLs lie
within). I'll mostly need to read/write sub-regions of the file from
multiple apps, all running at the same time.

 

Thanks,

-  Sherief

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


Re: [sqlite] Scour.com invite from harish

2008-07-17 Thread Sherief N. Farouk
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of harish
> Sent: Thursday, July 17, 2008 1:17 AM
> To: sqlite-users@sqlite.org
> Subject: [sqlite] Scour.com invite from harish
> 
> Hey,
> 
> Did you hear about Scour? It is the next gen search engine with
> Google/Yahoo/MSN results and user comments all on one page. Best of all
> we get paid for using it by earning points with every search, comment
> and vote. The points are redeemable for Visa gift cards! It's like
> earning credit card or airline points just for searching! Hit the link
> below to join for free and we will both get points!
> 
> http://scour.com/invite/harishdixit1/
> 
> I know you'll like it!
> 
> - harish

[Sherief N. Farouk] 

Are you, seriously: spamming a development mailing list, using your
@corp.scour.com email to do so, with a link that ends in
/invite/?

If I couldn't get funding for my stab/IP system before, I think I will now.

- Sherief

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


Re: [sqlite] problem compiling loadable extensions usingVisualStudio

2008-07-09 Thread Sherief N. Farouk
> Have you actually tried it? Build a DLL with this code, check with
> Dependency Walker. These two functions get exported under the following
> names:
> 
> [EMAIL PROTECTED]
> ?PI_TestEx@@[EMAIL PROTECTED]
> 
> The first name is decorated, the second is mangled (there's a
> difference
> between these two things, but it doesn't matter in this context where
> all you want is to get an exported name exactly as it is in your code).
> 
> Igor Tandetnik
> 

[Sherief N. Farouk] 

The decoration is due to the stdcall convention (APIENTRY). It's in the form
_FunctionName@. If you don't want that, use cdecl.

- Sherief

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