Is not working

Issue #10 wontfix
Ваня Берлинец created an issue

SELECT 'ФУНТ СВЯТОЙ ЕЛЕНЫ' LIKE 'ЛЕ' || '%' COLLATE NU900_NOCASE

Comments (8)

  1. Aleksey Tulinov repo owner
    • changed status to open

    I don't think it should work like that. Pattern is missing "%" at start implying string need to start from "ЛЕ" and might have any characters after it.

    sqlite> SELECT 'ФУНТ СВЯТОЙ ЕЛЕНЫ' LIKE 'ЛЕ' || '%' COLLATE NU900_NOCASE;
    0
    sqlite> SELECT 'ЛЕНЫ' LIKE 'ЛЕ' || '%' COLLATE NU900_NOCASE;
    1
    sqlite> SELECT 'ФУНТ СВЯТОЙ ЕЛЕНЫ' LIKE '%ЛЕ' || '%' COLLATE NU900_NOCASE;
    1
    
  2. Ваня Берлинец reporter
    sqlite> SELECT 'ФУНТ СВЯТОЙ ЕЛЕНЫ' GLOB 'ф' || '*' COLLATE NU900_NOCASE;
    0
    sqlite> SELECT 'ФУНТ СВЯТОЙ ЕЛЕНЫ' GLOB 'Ф' || '*' COLLATE NU900_NOCASE;
    1
    
  3. Aleksey Tulinov repo owner
    1. GLOB is not currently supported in nunicode's SQLite extension because no one requested this before. Please refer to extension description: https://bitbucket.org/alekseyt/nunicode#markdown-header-sqlite3-extension . Supported functions are:
    • upper(X)
    • lower(X)
    • X LIKE Y ESCAPE Z
    • COLLATE NU900 - case-sensitive Unicode collation
    • COLLATE NU900_NOCASE - case-insensitive Unicode collation
    1. GLOB is case-sensitive, therefore SELECT 'ФУНТ СВЯТОЙ ЕЛЕНЫ' GLOB 'ф*' is supposed to return 0 i believe
    2. To my knowledge COLLATE NU900_NOCASE has no effect on GLOB or LIKE (LIKE is case-insensitive) due to the fact that GLOB and LIKE has their own case-sensitivity rules
  4. Aleksey Tulinov repo owner
    sqlite> SELECT 'ФУНТ СВЯТОЙ ЕЛЕНЫ' GLOB upper('ф') || '*';
    1
    

    Hope this helps

  5. Log in to comment