Skip to content

storage-cassandra: the migration runner reports an UPDATE it doesn't handle as a statement that names no table #676

Open

Description

@LeeroyHannigan

#638 has the Cassandra migration runner write the keyspace into each statement's table name, and fail a file when it can't (qualify_statement in crates/storage-cassandra/src/migrations.rs). The error is:

Migration file {filename} has a statement that names no table the runner can qualify with a keyspace: {first line}

That's wrong for a statement that names a table in a form the runner doesn't handle, such as UPDATE settings SET value = '1' WHERE key = 'a' or DROP TABLE settings. @jcshepherd pointed this out in review on #638 and suggested uses a statement form the runner does not support: <first line>. Supported: CREATE TABLE, CREATE INDEX, ALTER TABLE, INSERT INTO.

That wording would be wrong for statements that reach the same error in a form the runner handles:

A message that names both causes is right for both groups:

Migration file {filename} has a statement the runner cannot qualify with a keyspace: {first line}. The runner supports CREATE TABLE, CREATE INDEX, ALTER TABLE and INSERT INTO, each naming an unquoted table without a keyspace.

rejects_statements_it_cannot_qualify only checks that each input fails. It should also check the message for one input from each group.

Activity

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

Metadata

Metadata

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