-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using indexes with the not equal operator (<>), the query returns incorrect results. After creating an index, SELECT * FROM id_table WHERE id <> 1 returns empty results instead of all rows where id is not equal to 1.
Fast Reproduce Steps(Required)
- Create table:
CREATE TABLE id_table(id int); - Insert test data:
INSERT INTO id_table VALUES (1); INSERT INTO id_table VALUES (2); INSERT INTO id_table VALUES (3); INSERT INTO id_table VALUES (10); INSERT INTO id_table VALUES (6); INSERT INTO id_table VALUES (7); INSERT INTO id_table VALUES (8);
- Verify query without index:
SELECT * FROM id_table WHERE id <> 1;(returns 2,3,10,6,7,8) - Create index:
CREATE INDEX index_id on id_table(id); - Execute same query with index:
SELECT * FROM id_table WHERE id <> 1;(incorrectly returns empty)
Expected behavior
The query should either:
- Return the correct results (2,3,10,6,7,8) when using the index, OR
- Return FAILURE if the not equal operator with indexes is not implemented
Actual Behavior
The query returns empty results but shows SUCCESS, indicating incorrect data is returned without proper error indication.
Additional context
- Equality queries (
id = 1) and range queries (id > 1) work correctly with indexes - The issue is specific to the not equal operator (
<>) when indexes are used - The system incorrectly handles index scanning for non-equality conditions
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working