Search code examples
iossqlitefmdb

Full Text Search SQL has different effect between ios8 and ios7


I have use the "*" symbols to do selecting on ios7 sqlite which the effect what i want, but ios8 sqlite does not supporting "*" and show "no result". Is the FMDB problem or the ios 8 does not support the "*" symbols?

SQL(with FMDB):

db.executeStatements("create virtual table if not exists TABLE_1 using fts3(col_1,Result)")    
db.executeQuery("SELECT * FROM TABLE_1 WHERE col_1 MATCH ?",withArgumentsInArray:["*A*"])

Table:

    +==============================+
    |     Name: TABLE_1            |
    +------------------------------+
    |   col_1     |     Result     |
    +==============================+
    |     A       |      result 1  |
    +------------------------------+
    |     B       |      result 2  |
    +------------------------------+
    |     AAB     |      result 3  |
    +------------------------------+

Solution

  • iOS 8 does not support "*A*", but does support "A*":

    db.executeQuery("SELECT * FROM TABLE_1 WHERE col_1 MATCH ?",withArgumentsInArray:["A*"])