Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-07 Thread Igor Tandetnik

On 6/7/2016 9:49 PM, Wang, Wei wrote:

Thanks for your reply! But I found the Latin-1 encoded characters are listed in 
the Unicode chart. http://unicode.org/charts/PDF/U0080.pdf


All the characters available in Latin-1 codepage are indeed also 
available in Unicode. However, the same character is represented by a 
different sequence of bytes when encoded in an ANSI codepage, in UTF-8, 
and in UTF-16.


For example, character Ç (aka U+00C7) is represented by a single byte C7 
in ANSI Latin-1 encoding, by two bytes C3 87 in UTF-8, and by two bytes 
C7 00 in UTF-16LE.


I suggest you read  http://www.joelonsoftware.com/articles/Unicode.html  .
--
Igor Tandetnik

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


Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-07 Thread Wang, Wei
Thanks for your reply! But I found the Latin-1 encoded characters are listed in 
the Unicode chart. http://unicode.org/charts/PDF/U0080.pdf


Best Regards,
Wang Wei

-Original Message-
From: sqlite-users-boun...@mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Igor 
Tandetnik
Sent: Tuesday, June 07, 2016 10:20 PM
To: sqlite-users@mailinglists.sqlite.org
Subject: Re: [sqlite] Latin-1 characters cannot be supported for Unicode

On 6/7/2016 3:43 AM, Wang, Wei wrote:
> I met a problem that was maybe caused by the encoding of SQLite. I inserted a 
> item which including some Latin1 characters like Ç and  Ã  into a table. Then 
> I opened the database with SQLite Developer. After I setting the encoding to 
> ANSI, the display and the query result for that table were OK.
> However after I setting the encoding to Unicode, these Latin1 characters 
> could not be displayed normally, and could not be queried out. Please see the 
> attached pictures for the details.

A byte sequence containing Latin-1-encoded characters Ç or à is not in fact a 
valid byte sequence in any Unicode encoding - neither UTF-8 nor
UTF-16 nor any other. If you want Unicode data in your database, then store 
Unicode data, and not ANSI, in your database.
--
Igor Tandetnik

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


Re: [sqlite] SQL / SQLite for Beginners

2016-06-07 Thread R.A. Nagy
That was what I was trying to say - thanks for the superior spelling.

Also - for wee Java folks, I cobbled together a CRUD generator for SQLite
last night:

https://sourceforge.net/projects/sqlmate

Also on:

https://github.com/soft9000/SQLMate



Sharing is caring,


-Rn





On Tue, Jun 7, 2016 at 12:24 AM, James K. Lowden 
wrote:

> On Thu, 26 May 2016 10:54:30 -0400
> r.a.n...@gmail.com wrote:
>
> > FWIW, since it's inception, S.Q.L has been pronounced allot like
> > CICS.
>
> This may be more true than you know.  It's not too hard to find
> old-timers who pronounce it "kicks".
>
> --jkl
>
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] UPDATE statement without FROM clause

2016-06-07 Thread skywind mailing lists
Hi,

of course there is in general a difference between syntax complexity and 
performance but unfortunately not in this case. And the „just“ is very often 
the most difficult part.

Regards,
Hartwig

> Am 2016-06-07 um 07:39 schrieb James K. Lowden :
> 
> On Sat, 4 Jun 2016 18:18:36 +0200
> skywind mailing lists  wrote:
> 
>> At the moment I have to run something like:
>> 
>> UPDATE A SET item1=(SELECT B.item FROM B WHERE B.ID=A.ID),...
>> itemN=... WHERE EXISTS (SELECT 1 FROM B WHERE B.ID=A.ID);
>> 
>> Using a FROM clause I just need one scan through B (at least in
>> principle). Now, I need N+1 scans.
> 
> Nonsense.  SQL provides no instruction to the implementation on how to
> organize or traverse the data.  SQLite is free to scan B once, twice,
> or not at all.  
> 
> Syntax has nothing to do with performance.  A correlated subquery is an
> expression of logic; it's not meant to be taken literally, and often
> isn't.  This particular form "just" needs to be recognized by the
> optimizer.  
> 
> --jkl
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> 

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


Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-07 Thread Hick Gunter
As already stated, this is not a problem of SQLite.

SQLite assumes all input to be correctly encoded in UTF (unicode), the precise 
flavor of which may be set (once, between creating a db file and the first 
insert) by a pragma.

If you insert ISO (latin) encoded strings, SQLite will faithfully reproduce the 
exact sequence of bytes presented on insert. As long as you use the same 
encoding to display the results, everything seems tob e ok, even though the 
byte sequence stored is technically worng.

If you insist on interpreting these using a different encoding and without 
explicitly converting, then you will experience problems with characters that 
encode differently.

-Ursprüngliche Nachricht-
Von: sqlite-users-boun...@mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Wang, Wei
Gesendet: Dienstag, 07. Juni 2016 09:43
An: sqlite-users@mailinglists.sqlite.org
Betreff: [sqlite] Latin-1 characters cannot be supported for Unicode

Hi,

I met a problem that was maybe caused by the encoding of SQLite. I inserted a 
item which including some Latin1 characters like Ç and  Ã  into a table. Then I 
opened the database with SQLite Developer. After I setting the encoding to 
ANSI, the display and the query result for that table were OK.
However after I setting the encoding to Unicode, these Latin1 characters could 
not be displayed normally, and could not be queried out. Please see the 
attached pictures for the details.


Best Regards,
Wang Wei



___
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


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


Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-07 Thread Simon Slavin

On 7 Jun 2016, at 8:43am, Wang, Wei  wrote:

> Then I opened the database with SQLite Developer.

SQLite Developer is not supported by the team which wrote SQLite.  It's just a 
program which uses SQLite.  If it allows you to pick character encoding then it 
is not correctly showing you the contents of your database so you should not 
necessarily trust what you see.

If you want to see what's really in your database please use the SQLite shell 
tool, which was written by the team which wrote SQLite and is understood to be 
100% correct.

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


Re: [sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-07 Thread Igor Tandetnik

On 6/7/2016 3:43 AM, Wang, Wei wrote:

I met a problem that was maybe caused by the encoding of SQLite. I inserted a 
item which including some Latin1 characters like Ç and  Ã  into a table. Then I 
opened the database with SQLite Developer. After I setting the encoding to 
ANSI, the display and the query result for that table were OK.
However after I setting the encoding to Unicode, these Latin1 characters could 
not be displayed normally, and could not be queried out. Please see the 
attached pictures for the details.


A byte sequence containing Latin-1-encoded characters Ç or à is not in 
fact a valid byte sequence in any Unicode encoding - neither UTF-8 nor 
UTF-16 nor any other. If you want Unicode data in your database, then 
store Unicode data, and not ANSI, in your database.

--
Igor Tandetnik

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


[sqlite] [BugReport]Data changes cannot actually flush to disk

2016-06-07 Thread 刘翔

Dear SQLite developers,

Sqlite version: 3.8.8.3
Linux version: 3.10.31-ltsi

Problem:
When update database and power off immediately, it cannnot actually make 
changes to database file in the disk.

Although the HAVE_FDATASYNC comile-time option is true.
If manually called sync() after executing a SQL statement, it does flush 
the database file to disk.


I think the OSTRACE log can be helpful, so I toke it.
Could you help to analyse it and tell me why fdatasync() doesn't work?

LOCK154 SHARED was NONE(NONE,0) pid=2289 (unix)
LOCK154 SHARED ok (unix)
READ15416  24 0
LOCK154 RESERVED was SHARED(SHARED,1) pid=2289 (unix)
LOCK154 RESERVED ok (unix)
OPENX   168 /var/user/aaa/bbb.db-journal 0400102
OPEN168 /var/user/aaa/bbb.db-journal
WRITE   168   512   0 0
WRITE   168 4 512 0
WRITE   168  1024 516 0
WRITE   168 41540 0
LOCK154 EXCLUSIVE was RESERVED(RESERVED,1) pid=2289 (unix)
LOCK154 EXCLUSIVE ok (unix)
WRITE   168 41544 0
WRITE   168  10241548 0
WRITE   168 42572 0
READ168 03072 0
SYNC168
DIRSYNC /var/user/aaa/bbb.db-journal (have_fullfsync=0 fullsync=0)
OPENDIR 169 /var/user/aaa
WRITE   16812   0 0
SYNC168
READ154 4  24 0
WRITE   154  1024   0 0
WRITE   154  1024   20480 0
SYNC154
CLOSE   -1
UNLOCK  154 1 was 4(4,1) pid=2289 (unix)
UNLOCK  154 0 was 1(1,1) pid=2289 (unix)



Cordially yours

LiuXiang

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


[sqlite] Latin-1 characters cannot be supported for Unicode

2016-06-07 Thread Wang, Wei
Hi,

I met a problem that was maybe caused by the encoding of SQLite. I inserted a 
item which including some Latin1 characters like Ç and  Ã  into a table. Then I 
opened the database with SQLite Developer. After I setting the encoding to 
ANSI, the display and the query result for that table were OK.
However after I setting the encoding to Unicode, these Latin1 characters could 
not be displayed normally, and could not be queried out. Please see the 
attached pictures for the details.


Best Regards,
Wang Wei

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