Hi all

I have discovered what may be a bug in either SQLLite or System.Data.SQLite
(v 1.0.66.0 using SQLite 3.6.23.1). I certainly don't understand what's
happening and I'd apprecite it if someone could help me out; perhaps I'm
missing something.

To recreate the issue create a database with the following commands:

CREATE VIRTUAL TABLE full_text USING FTS3 (id,text)
INSERT INTO full_text VALUES ('1', 'I have a foréign character.')

In case it gets lost, the e in foreign is actually an e-acute. unicode:00E9,
unicode:00C9 for the capital version.
This is significant.

The test scenarios:

The following query incorrectly returns zero rows:

SELECT id, text FROM full_text WHERE NOT(text = @source) AND text MATCH
@query

source = "foréign"
query = "FORÉIGN"

As does this one:

SELECT id, text FROM full_text WHERE NOT(text = @s) AND text MATCH @q

s = "foréign"
q = "FORÉIGN"

The following queries correctly return 1 row:

SELECT id, text FROM full_text WHERE NOT(text = @source) AND text MATCH
@query

source = "have"
query = "HAVE"

SELECT id, text FROM full_text WHERE NOT(text = @p1) AND text MATCH @p2

p1 = "foréign"
p2 = "FORÉIGN"

Not using parametrized SQL also returns a correct result.

It seems that when doing this query for a word with an e-acute and having
parameter names beginning with s and/or q gives the wrong result. Using
different parameter names, not using parameters or searching for a word
without an e-acute gives the correct result.

The attached C# class demonstrates the problem.

Any help is appreciated.

Regards,

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

Reply via email to