Skip to content

indices get corrupted if keys are too big #1

Description

@JohannesMunk
CREATE TABLE IF NOT EXISTS T1 (B TEXT, C TEXT);
CREATE INDEX IF NOT EXISTS T1_idx on T1 (C,B);
INSERT INTO T1 (B, C) VALUES ('A', 'tms_doc_cfg');
INSERT INTO T1 (B, C) VALUES (RANDOMBLOB(17000), 'tms_doc_cfg_element_trans_xslt');
SELECT * FROM T1 WHERE C = "tms_doc_cfg";

returns nothing.

SELECT C,C="tms_doc_cfg" FROM T1 WHERE C > "tms_doc_cfg";

returns 1 in the 2nd column on 'A' .. The index clearly fails..

If the key length is reduced, the select

CREATE TABLE IF NOT EXISTS T1 (B TEXT, C TEXT);
CREATE INDEX IF NOT EXISTS T1_idx on T1 (C,B);
INSERT INTO T1 (B, C) VALUES ('A', 'tms_doc_cfg');
INSERT INTO T1 (B, C) VALUES (RANDOMBLOB(1000), 'tms_doc_cfg_element_trans_xslt');
SELECT * FROM T1 WHERE C = "tms_doc_cfg";

correctly returns 'A', 'tms_doc_cfg'.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions