Re: [sqlite] Sqlite problem possible bug

2015-01-07 Thread RSmith


On 2015/01/07 12:13, The Responsa Project wrote:

To Whom it amy concern


I am trying to use SQLITE and the like statement with wildcards and hebrew

when I put in an english string it works correctly, such as

Select  * from dbname where colname like '%123%'

I will get all the entries from that column that contain 123 anywhere in the 
column.

However if I substitute 123 with hebrew letters - it matches all the entries, 
not just the ones containing what I asked for.

If I do not use the wilcards in the like it matches the exact word properly. In 
version 3.2.2 of sqlite this worked fine (with wildcards), later versions it does 
not. So for example "SELECT * from dbname where colname like '%אב%' will give 
me all the entries not only the ones matching only אב.

I tried GLOB, which also did not work.?


I would like to (and need to) upgrade to the latest version of Sqlite but I 
cannot because of this issue.


Is this a bug? Am I doing something wrong?


Not a bug in the latest version - works fine for me, but I am not sure which other versions you have tested. Are you using the C api 
directly or going through some wrapper? (It might mess with the UTF8 or whatever encoding you start off with). Is  your DB in UTF-8 
mode?


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


Re: [sqlite] Sqlite problem possible bug

2015-01-07 Thread Richard Hipp
On 1/7/15, The Responsa Project  wrote:
> To Whom it amy concern
>
>
> I am trying to use SQLITE and the like statement with wildcards and hebrew
>
> when I put in an english string it works correctly, such as
>
> Select  * from dbname where colname like '%123%'
>
> I will get all the entries from that column that contain 123 anywhere in the
> column.
>
> However if I substitute 123 with hebrew letters - it matches all the
> entries, not just the ones containing what I asked for.
>
> If I do not use the wilcards in the like it matches the exact word properly.
> In version 3.2.2 of sqlite this worked fine (with wildcards), later versions
> it does not. So for example "SELECT * from dbname where colname like '%אב%'
> will give me all the entries not only the ones matching only אב.
>

It should work.  Here is the test case I used:

CREATE TABLE t1(x TEXT);
INSERT INTO t1(x) VALUES('abc'),('אב'),
  ('בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ'),
  ('וְהָאָ֗רֶץ הָיְתָ֥ה תֹ֙הוּ֙ וָבֹ֔הוּ '),('xyz');
.print --- all ---
SELECT rowid, x FROM t1;
.print --- Using %אב% ---
SELECT rowid, x FROM t1 WHERE x LIKE '%אב%';

The above gives me this output:

--- all ---
1|abc
2|אב
3|בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ
4|וְהָאָ֗רֶץ הָיְתָ֥ה תֹ֙הוּ֙ וָבֹ֔הוּ
5|xyz
--- Using %אב% ---
2|אב

Which is exactly what you would expect, no?

Perhaps you can give us more details about how you are invoking
SQLite.  The problem might be in the interface to your programming
language, not in SQLite itself.


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


Re: [sqlite] Sqlite problem possible bug

2015-01-07 Thread Yongil Jang
How about to use dynamic binding?
For example, is your SQL(SELECT * from dbname where colname like '%אב%'),
use '?' instead of 'אב'.
In my guess, 'אב' can have same ASCII code of wildcard(%).

Full SQL can be as like as follows.

SELECT * from dbname where colname like '%?%'

To do this, you need to use sqlite3_bind*** functions in c API.

Regards
YONGIL.
2015. 1. 7. 오후 9:34에 "The Responsa Project" 님이 작성:

> To Whom it amy concern
>
>
> I am trying to use SQLITE and the like statement with wildcards and hebrew
>
> when I put in an english string it works correctly, such as
>
> Select  * from dbname where colname like '%123%'
>
> I will get all the entries from that column that contain 123 anywhere in
> the column.
>
> However if I substitute 123 with hebrew letters - it matches all the
> entries, not just the ones containing what I asked for.
>
> If I do not use the wilcards in the like it matches the exact word
> properly. In version 3.2.2 of sqlite this worked fine (with wildcards),
> later versions it does not. So for example "SELECT * from dbname where
> colname like '%אב%' will give me all the entries not only the ones matching
> only אב.
>
> I tried GLOB, which also did not work.?
>
>
> I would like to (and need to) upgrade to the latest version of Sqlite but
> I cannot because of this issue.
>
>
> Is this a bug? Am I doing something wrong?
>
>
> All help is appreciated, thanks in advance
>
>
> Sincerely,Sharon Gottlieb
>
>
> The Responsa Project
> Bar-Ilan University
> Ramat-Gan 52900, ISRAEL
> Tel: 972-3-5318-411 / Fax: 972-3-5341-850
> Email: respo...@mail.biu.ac.il
> Internet http://responsa.biu.ac.il
> ___
> 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] Sqlite problem possible bug

2015-01-07 Thread The Responsa Project
To Whom it amy concern


I am trying to use SQLITE and the like statement with wildcards and hebrew

when I put in an english string it works correctly, such as

Select  * from dbname where colname like '%123%'

I will get all the entries from that column that contain 123 anywhere in the 
column.

However if I substitute 123 with hebrew letters - it matches all the entries, 
not just the ones containing what I asked for.

If I do not use the wilcards in the like it matches the exact word properly. In 
version 3.2.2 of sqlite this worked fine (with wildcards), later versions it 
does not. So for example "SELECT * from dbname where colname like '%אב%' will 
give me all the entries not only the ones matching only אב.

I tried GLOB, which also did not work.?


I would like to (and need to) upgrade to the latest version of Sqlite but I 
cannot because of this issue.


Is this a bug? Am I doing something wrong?


All help is appreciated, thanks in advance


Sincerely,Sharon Gottlieb


The Responsa Project
Bar-Ilan University
Ramat-Gan 52900, ISRAEL
Tel: 972-3-5318-411 / Fax: 972-3-5341-850
Email: respo...@mail.biu.ac.il
Internet http://responsa.biu.ac.il
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users