I have a sqlite table in Python:
CREATE TABLE lookup ( id string PRIMARY KEY );
In this table I inserted a lot of rows and then I created an index:
CREATE INDEX intindex ON lookup(id);
I now want to test if my string is in the table. I tried the following:
checkval = cursor.execute("""SELECT EXISTS (SELECT 1
FROM lookup
WHERE id=?
LIMIT 1)""", (str(mystring), )).fetchone()[0]
But the problem is, this only seems to check if the first 16 or so characters of the string are identical. For example, I know that my table contains:
'95592037576585500895905906368332492139177507248814568869956683982249018785792'
However, if I check the non-existing value:
'95592037576585501898360696547541541617886282712262516411315613154848368326494'
then I also get TRUE.
Checking:
'95592137576585500895905906368332492139177507248814568869956683982249018785792'
does correctly result in FALSE.
Why is it not comparing the full string?