Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field index bug with AS OF query and secondary index #7488

Closed
fulghum opened this issue Feb 13, 2024 · 0 comments · Fixed by #7490
Closed

Field index bug with AS OF query and secondary index #7488

fulghum opened this issue Feb 13, 2024 · 0 comments · Fixed by #7490
Assignees
Labels
bug Something isn't working good repro Easily reproducible bugs sql Issue with SQL

Comments

@fulghum
Copy link
Contributor

fulghum commented Feb 13, 2024

When using AS OF queries with a secondary index, Dolt returns a unable to find field error in some cases:

-- Create a table with a secondary index in the first Dolt commit
create table t (pk int primary key, c1 varchar(255), key c1_idx(c1));
insert into t values (1, 'one');
call dolt_commit('-Am', 'adding table t with index on main');
SET @commit1 = hashof('HEAD');

-- Trying to query with `AS OF` when using the secondary index causes an error
SELECT c1 from t as of @commit1 where c1 > 'o';
unable to find field with index 1 in row of 1 columns

-- Not using the second index works correctly
SELECT c1 from t as of @commit1;
+-----+
| c1  |
+-----+
| one |
+-----+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good repro Easily reproducible bugs sql Issue with SQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant