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

Impossible to set list element to null using scylla_timeuuid_index #6828

Closed
haaawk opened this issue Jul 13, 2020 · 6 comments
Closed

Impossible to set list element to null using scylla_timeuuid_index #6828

haaawk opened this issue Jul 13, 2020 · 6 comments
Assignees

Comments

@haaawk
Copy link
Contributor

haaawk commented Jul 13, 2020

Having the following table:

create table tb(
pk int,
ck int,
v list<int>,
primary key(pk, ck)
}

It is ok to run

update tb set v[1]=null where pk = 1 and ck = 1

but running

update tb set v[scylla_timeuuid_list_index(4bec89c0-c52b-11ea-92db-000000000000)] = null where pk = 1 and ck = 2

causes

ServerError: std::get: wrong index for variant

On the same time, running

update tb set v[scylla_timeuuid_list_index(4bec89c0-c52b-11ea-92db-000000000000)] = 3 where pk = 1 and ck = 2

works just fine.

@haaawk haaawk self-assigned this Jul 13, 2020
@avikivity
Copy link
Member

@haaawk what about DELETE v[scylla_timeuuid_list_index(...)] FROM tb?

@haaawk
Copy link
Contributor Author

haaawk commented Jul 14, 2020

Haven't tried. Will check it out and let you know.

@haaawk
Copy link
Contributor Author

haaawk commented Jul 14, 2020

> DELETE v[scylla_timeuuid_list_index(4bec89c0-c52b-11ea-92db-000000000000)] FROM tb ;
SyntaxException: line 1:9 no viable alternative at input 'scylla_timeuuid_list_index'

but that's sort of expected. I think the grammar was changed only for SET to support scylla_timeuuid_list_index.

@avikivity
Copy link
Member

We could (should?) support it.

@elcallio
Copy link
Contributor

It looks like a regression. Trying to do the same as above and run it though sstableloader hits the same error.

elcallio pushed a commit to elcallio/scylla that referenced this issue Jul 14, 2020
Fixes scylladb#6828

When using the scylla list index from UUID extension,
null values were not handled properly causing throws
from underlying layer.
avikivity pushed a commit that referenced this issue Aug 3, 2020
Fixes #6828

When using the scylla list index from UUID extension,
null values were not handled properly causing throws
from underlying layer.

(cherry picked from commit 3b74b95)
avikivity pushed a commit that referenced this issue Aug 3, 2020
Fixes #6828

When using the scylla list index from UUID extension,
null values were not handled properly causing throws
from underlying layer.

(cherry picked from commit 3b74b95)
avikivity pushed a commit that referenced this issue Aug 3, 2020
Fixes #6828

When using the scylla list index from UUID extension,
null values were not handled properly causing throws
from underlying layer.

(cherry picked from commit 3b74b95)
@avikivity
Copy link
Member

Backported to 4.0, 4.1, 4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants