Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-23 Thread Scott Robison
On Thu, Jun 23, 2016 at 7:47 PM, mon siong wrote: > Thanks I will try internal hard drive. This is not virtual machine , my > application is running on linux ARM . > > 1) Make sure I need to check SQLITE_OK before i proceed to perform next > task 2) Move the sqlite file to

Re: [sqlite] Conversion failure

2016-06-23 Thread Rowan Worth
The sqlite shell, at least historically, has I think not accounted for text encoding and simply passed whatever it reads from the console into the database. There has been recent changes in this area since your last email on the subject, for sqlite 3.12.0. What version are you using, Igor?

Re: [sqlite] Conversion failure

2016-06-23 Thread Igor Korot
Kevin, On Thu, Jun 23, 2016 at 11:39 PM, Kevin Benson wrote: > -- >-- > -- > --Ô¿Ô-- > K e V i N > > On Thu, Jun 23, 2016 at 10:38 AM, Igor Korot wrote: > >> Hi, Clemens, >> >> On Thu, Jun 23, 2016 at 10:33 AM, Clemens

Re: [sqlite] Conversion failure

2016-06-23 Thread Kevin Benson
-- -- -- --Ô¿Ô-- K e V i N On Thu, Jun 23, 2016 at 10:38 AM, Igor Korot wrote: > Hi, Clemens, > > On Thu, Jun 23, 2016 at 10:33 AM, Clemens Ladisch > wrote: > > Igor Korot wrote: > >> I am trying to find out why the following

[sqlite] Correct design to split sqlite db into month and year ?

2016-06-23 Thread mon siong
Hi    I use sqlite as database for my website develop using php and a c program  keep receiving data from socket in multithread environment, and insert the data into multiple sqlite database by month . For example if the data is January data , then insert into January sqlite db and

Re: [sqlite] Conversion failure

2016-06-23 Thread Igor Korot
Simon, On Thu, Jun 23, 2016 at 8:44 PM, Simon Slavin wrote: > > On 23 Jun 2016, at 11:42pm, Igor Korot wrote: > >> OK, so are they UTF-8, UTF-16 or something else? >> And I'm talking the default one - the one which is set when I just >> open the shell

Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-23 Thread mon siong
Thanks I will try internal hard drive. This is not virtual machine , my application is running on linux ARM . 1) Make sure I need to check SQLITE_OK before i proceed to perform next task 2) Move the sqlite file to Internal hard drive 2) Add sqlite_3_config error log callback to find out which

Re: [sqlite] Conversion failure

2016-06-23 Thread Simon Slavin
On 23 Jun 2016, at 11:42pm, Igor Korot wrote: > OK, so are they UTF-8, UTF-16 or something else? > And I'm talking the default one - the one which is set when I just > open the shell tool and say CREATE TABLE() on the > empty database. > Knowing this will help with the

Re: [sqlite] Conversion failure

2016-06-23 Thread Kees Nuyt
On Thu, 23 Jun 2016 17:49:04 -0400, Igor Korot wrote: > Yes, it is a PC (a laptop with Windows). > OK, I understand and its unfortunate, but that's life. > > Now the question is: what is the best way to fix it? > From the link I posted it sounds like there is a byte sequence

Re: [sqlite] Sudden error 26 / 11

2016-06-23 Thread Richard Hipp
On Thu, Jun 23, 2016 at 6:13 PM, Jim Borden wrote: > The library will be happily running along and then suddenly a SELECT > statement will return error code 26 upon step. Error code 26 is SQLITE_NOTADB. That only happens when SQLite is reading the 100-byte header at

Re: [sqlite] Conversion failure

2016-06-23 Thread R Smith
On 2016/06/24 12:42 AM, Igor Korot wrote: Your locale should not have any effect on what goes into a SQLite database. All strings must be translated into Unicode before they are passed to the SQLite API. And by 'All strings' I include SQL commands like the ones which create tables and

Re: [sqlite] Conversion failure

2016-06-23 Thread Igor Korot
Simon, On Thu, Jun 23, 2016 at 6:14 PM, Simon Slavin wrote: > > On 23 Jun 2016, at 10:53pm, Igor Korot wrote: > >> So what I'm trying to do is to see what will happen if I get a >> database with the German character(s) >> or Asian characters in the

Re: [sqlite] Sudden error 26 / 11

2016-06-23 Thread Simon Slavin
On 23 Jun 2016, at 11:13pm, Jim Borden wrote: > From what I have read, error 11 is extremely hard to cause through library > usage alone. The key offences seem to be: > > 1) Using two versions of SQLite at once in an application > 2) Bad OS file locking > 3) A rogue

Re: [sqlite] Conversion failure

2016-06-23 Thread Simon Slavin
On 23 Jun 2016, at 10:53pm, Igor Korot wrote: > So what I'm trying to do is to see what will happen if I get a > database with the German character(s) > or Asian characters in the table/field name and they will be entered > the same way. All table/field names in a SQLite

[sqlite] Sudden error 26 / 11

2016-06-23 Thread Jim Borden
I’m having an issue with a library I am writing. This has not happened before in the 1 ½ years I have been developing the library, but for some reason now it’s rearing its ugly head from time to time. The library will be happily running along and then suddenly a SELECT statement will return

Re: [sqlite] Conversion failure

2016-06-23 Thread Igor Korot
Hi, Ralf, On Thu, Jun 23, 2016 at 12:38 PM, Ralf Junker wrote: > If you are on Windows, you can use SQLiteSpy to correct such wrongly entered > ANSI text to Unicode throughout an entire database: It is not wrongly entered text. I am using Windows with English locale only. So

Re: [sqlite] Conversion failure

2016-06-23 Thread Igor Korot
Hi, Gunter, On Thu, Jun 23, 2016 at 12:16 PM, Hick Gunter wrote: > Your data entry device (I guess a PC running a flavor of windows) is > generating a certain sequence of bytes when you press ALT+225. This sequence > is probably ISO/ANSI encoded instead of UTF-8 encoded. It

Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-23 Thread Scott Robison
On Thu, Jun 23, 2016 at 11:08 AM, mon siong wrote: > > You have idea why the journal and shm file is corrupt ? > My first thought was a remote file system. My next instinct is to suspect the USB device or interface is suspect. Can you try it on an internal hard drive? Is

Re: [sqlite] SQlite database corrupt , PHP and multithread C program accessing same database

2016-06-23 Thread mon siong
You have idea why the journal and shm file is corrupt  ? From the previous Thread (http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/2016-January/063830.html),   you mention to use showdb to check the DB corrupt . Where to download the showdb program ? On Thursday,

Re: [sqlite] Conversion failure

2016-06-23 Thread Ralf Junker
If you are on Windows, you can use SQLiteSpy to correct such wrongly entered ANSI text to Unicode throughout an entire database: http://yunqa.de/delphi/products/sqlitespy/index Open the database and from the menu pick Execute -> Text to Unicode Convertsion ... A dialog opens where you

Re: [sqlite] Conversion failure

2016-06-23 Thread Hick Gunter
Your data entry device (I guess a PC running a flavor of windows) is generating a certain sequence of bytes when you press ALT+225. This sequence is probably ISO/ANSI encoded instead of UTF-8 encoded. It has nothing to do with sqlite itself. Sqlite will faithfully reproduce whatever byte

Re: [sqlite] Conversion failure

2016-06-23 Thread Igor Korot
Hi, Gunter, On Thu, Jun 23, 2016 at 10:59 AM, Hick Gunter wrote: > Open the editor application, type in your command, save to file and the view > with a hex editor. I suspect it will be in ISO encoding. According to https://sqlite.org/src4/doc/trunk/www/data_encoding.wiki,

Re: [sqlite] Conversion failure

2016-06-23 Thread Hick Gunter
Open the editor application, type in your command, save to file and the view with a hex editor. I suspect it will be in ISO encoding. -Ursprüngliche Nachricht- Von: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Igor

Re: [sqlite] Conversion failure

2016-06-23 Thread Igor Korot
Hi, Clemens, On Thu, Jun 23, 2016 at 10:33 AM, Clemens Ladisch wrote: > Igor Korot wrote: >> I am trying to find out why the following code fails to do proper conversion. >> It works if the tableName have "abcd", but fails if it has "abcß" (the >> German letter for the "ss"

Re: [sqlite] when to expect "no such table"

2016-06-23 Thread Richard Hipp
On Thu, Jun 23, 2016 at 10:23 AM, Mark Brand wrote: > > Thanks. I'm curious about the thinking behind this change. What are the > benefits that offset the increased risk that a particular database will > seem to have been created correctly only to fail at runtime? I'm not >

Re: [sqlite] Conversion failure

2016-06-23 Thread Clemens Ladisch
Igor Korot wrote: > I am trying to find out why the following code fails to do proper conversion. > It works if the tableName have "abcd", but fails if it has "abcß" (the > German letter for the "ss" (looks like Greek letter beta)). > > const unsigned char *tableName = sqlite3_column_text( stmt, 0

Re: [sqlite] when to expect "no such table"

2016-06-23 Thread Mark Brand
On 23/06/16 16:08, Richard Hipp wrote: On Thu, Jun 23, 2016 at 9:54 AM, Mark Brand wrote: Hi, Just wondering about the apparent variation among sqlite3 versions and/or configurations with respect to the "no such table" error. In some cases it's enforced at view creation

Re: [sqlite] when to expect "no such table"

2016-06-23 Thread Richard Hipp
On Thu, Jun 23, 2016 at 9:54 AM, Mark Brand wrote: > > Hi, > > Just wondering about the apparent variation among sqlite3 versions and/or > configurations with respect to the "no such table" error. In some cases > it's enforced at view creation and in others at execution. > >

[sqlite] Conversion failure

2016-06-23 Thread Igor Korot
Hi, I am trying to find out why the following code fails to do proper conversion. It works if the tableName have "abcd", but fails if it has "abcß" (the German letter for the "ss" (looks like Greek letter beta)). struct Table { std::wstring name; std::vector fields; std::vector

[sqlite] when to expect "no such table"

2016-06-23 Thread Mark Brand
Hi, Just wondering about the apparent variation among sqlite3 versions and/or configurations with respect to the "no such table" error. In some cases it's enforced at view creation and in others at execution. Mark SQLite version 3.8.7.1 2014-10-29 13:59:56 Enter ".help" for usage hints.

Re: [sqlite] Potentially uninitialized pointer variables

2016-06-23 Thread Richard Hipp
I get zero warnings with MSVC 2010. And your line numbers are wrong, probably because the warnings happen beyond the 64K line mark and MSVC is unable to track lines beyond 64K. If you can, please compile "sqlite3-all.c" instead of "sqlite3.c" from canonical sources (sqlite-src-313.zip

[sqlite] Potentially uninitialized pointer variables

2016-06-23 Thread Sean M. Pappalardo - D.J. Pegasus
Hello. When linking SQLite into a Windows application using Microsoft Visual C++ 2015 (v14,) I get the following errors: Generating code E:\sqlite-amalgamation-313\sqlite3.c(57057) : error C4703: potentially uninitialized local pointer variable 'pDbPage' used