Re: [sqlite] Question about UTF8 encoding in SQLite version 2.8.13

2004-11-04 Thread Liz Steel
Sorry to keep on about this, but I raised a ticket on Tuesday (number 981) 
with severity and priority of 1 (since this is a major issue for my projet) 
and I haven't heard anything back yet.

Even if it is not going to be fixed, I really need to know, as then we can 
take some other action with this.

Thanks,
Liz.
_
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


Re: [sqlite] Question about UTF8 encoding in SQLite version 2.8.13

2004-11-02 Thread Liz Steel
Thanks for your reply, however, wcstombs uses the default code page rather 
that UTF8, which is where I was going wrong with using it originally.

Unfortunately, it is unlikely that I will get approval to use libiconv as it 
is third-party software.

How much effort is involved with converting to SQLite 3.x? I'm not sure if I 
can get approval to use that either, but if that's the only way I'm going to 
get it to work, then I may have to do it.

Liz.
Original Message Follows
From: Cory Nelson <[EMAIL PROTECTED]>
Reply-To: Cory Nelson <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] Question about UTF8 encoding in SQLite version 2.8.13
Date: Tue, 2 Nov 2004 08:41:25 -0800
Well, wcstombs uses WideCharToMultiByte() internally, with some more
locality checks added in.  Maybe you are using it wrong?
If you cant get that to work, libiconv is great for converting charsets.
Is there any reason you can't use sqlite 3.x?  It has native unicode 
support.

On Tue, 02 Nov 2004 15:50:59 +0000, Liz Steel <[EMAIL PROTECTED]> wrote:
> Hello - I hope somebody can help me!
>
> I am using SQLite version 2.8.13 as a DLL with a windows C++ application. 
I
> have the SQLITE_UTF8 macro defined.
>
> I have no problems adding and retrieving strings to and from the database 
-
> I am using WideCharToMultiByte and MultiByteToWideChar to convert from
> CString (Wide) to char * (Multibyte).
>
> (Previously I was using wcstombs and mbstowcs to convert, but this 
doesn't
> support Greek and Russian characters, and I don't think it was actually
> converting the strings properly.)
>
> However, when I call sqlite_open with a multibyte string, it doesn't seem 
to
> work as I expect.
>
> To clarify: I have a database name with Swedish characters in, which are
> converted to multibyte characters, however, the filename that is created
> treats each of the characters separately, which then causes problems 
later.
> As an example, the string "Ändrad" is converted to "Ändrad".
>
> If I use wcstombs to convert the filename string, this works OK for 
Swedish
> characters, but then doesn't work for Greek characters.
>
> Does anyone have any ideas?
>
> Thanks,
>
> Liz.
>
> _
> Use MSN Messenger to send music and pics to your friends
> http://www.msn.co.uk/messenger
>
>

--
Cory Nelson
http://www.int64.org
_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger



Re: [sqlite] Effectiveness of PRAGMA integrity_check;

2004-04-15 Thread Liz Steel
Hello again,

I'm not sure if you received my last email, so I'm sending it to the list in 
the hope that someone can help me.

You say that I shouldn't get a corrupt database when I pull the power, but I 
am consistently getting this. I am using SQLite version 2.8.9 using the C++ 
interface running on Windows XP Home. Is there anything I can do to stop 
this happening?

Thanks,

Liz.

Original Message Follows
From: "D. Richard Hipp" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [sqlite] Effectiveness of PRAGMA integrity_check;
Date: Wed, 14 Apr 2004 10:50:28 -0400
Liz Steel wrote:
I am trying to do a similar sort of thing with my database. The only way 
I've found to fairly reliably create a corrupt database file is to pull the 
battery out of my laptop whilst my application is accessing the 
database

I've just tried it, and I get a code 11 (SQLITE_CORRUPT) returned from the 
PRAGMA integrity_check command. Is this correct behaviour?

No, this is not correct.  SQLite is suppose to survive an abrupt
power loss with no loss of data.  (Uncommitted transactions will be
rolled back, but committed transactions should persist and be
consistent.)
I believe that SQLite does survive power loss without problems
on Linux.  However, I have received reports that the windows API
function FlushFileBuffers() sometimes lies and does not really
flush contents to the disk surface as it claims it does.  This
is just hearsay - I have not independently verified those reports.
If FlushFileBuffers() does lie and a power loss occurred in the
middle of a COMMIT, then database corruption is possible on
windows.  This is a bug in the OS and there is not anything
SQLite (or any other database engine) can do about it.
There was a bug in SQLite version 2.8.12 that could cause
database corruption if a power loss occurred at a particularly
inauspicious moment in the middle of a COMMIT.  That problem
was fixed with version 2.8.13.
If you are seeing database corruption following power loss
on Linux with SQLite version 2.8.13, please let us know about
it right away.  If you are seeing corruption on Windows, let
us know there too - the problem might be the FlushFileBuffers()
bug or it might be something else - either way we want to
investigate.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

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


RE: [sqlite] Effectiveness of PRAGMA integrity_check;

2004-04-14 Thread Liz Steel
Hello!

I am trying to do a similar sort of thing with my database. The only way 
I've found to fairly reliably create a corrupt database file is to pull the 
battery out of my laptop whilst my application is accessing the database. I 
haven't used the "PRAGMA integrity_check;" command, but I will try it now 
and see if that detects my corrupt database. At the moment, I am selecting 
every row from every table, but I can see this getting a bit slow when my 
database gets bigger.

I've just tried it, and I get a code 11 (SQLITE_CORRUPT) returned from the 
PRAGMA integrity_check command. Is this correct behaviour? Will I always get 
this error returned? The website says something about it returning "ok" but 
I didn't check this as I am using sqlite_exec.

I haven't managed to find anything on the website about using the journal 
file that is created. Can anyone point me in the right direction to using 
this file to re-create my database? Would I need to take a backup of the 
database file before every transaction to use this?

Thanks,

Liz.

Original Message Follows
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [sqlite] Effectiveness of PRAGMA integrity_check;
Date: Wed, 14 Apr 2004 15:48:57 +1000
G'day,

I'm trying to write some defensive code that is able to recover from
database corruption. The idea is that if a disk fails and a database
becomes corrupt it can be detected and synchronised from a backup copy.
To this end, I've just been trying to write a function that returns true
only when it is sure the database is ok. I use PRAGMA integrity check; and
compare the returned string with "ok". When I tried this with a few random
database changes, though, I had a hard time trying to get the corruption
to trigger. I did the following:
CREATE TABLE foo(bar);
INSERT INTO foo VALUES("bar");
I then went in with a text editor and started modifying the bar record. I
changed "bar" to "car", but the change was not detected. I started
modifying characters to the left and right of the "car" string, but still
no corruption. I was able to get corruption to be detected when I
truncated the file.
Can I take it from this behaviour that there isn't any checksum checking
going on apart from headers and the BTrees themselves? Will the
integrity_check at least guarantee me that I won't at some later stage get
an SQLITE_CORRUPT return?
Benjamin.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Tired of 56k? Get a FREE BT Broadband connection 
http://www.msn.co.uk/specials/btbroadband

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


[sqlite] Corrupt database problem.

2004-01-09 Thread Liz Steel
I'm getting an error in my code when I perform a sqlite_finalize on a 
particular table. I have stepped through the code and no rows are returned, 
but why do I get the error here, rather than on sqlite_compile, or 
sqlite_open?

I've looked at the database using the command line interface, and when I do 
a select on this table, I get quite a lot of rows, and then an error:

SQL error: database disk image is malformed

Can anyone shed any light on why I might get this error? What does it mean? 
Is there any way to repair the database?

Thanks in advance,

Liz.

_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

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