yugabyte/yugabyte-db

[YCQL] Make it clear that transactions can't be enabled after table creation

Open

#1.048 aberto em 21 de mar. de 2019

Ver no GitHub
 (3 comments) (0 reactions) (0 assignees)C (1.003 forks)batch import
area/ycqlhelp wantedkind/enhancementpriority/medium

Métricas do repositório

Stars
 (8.229 stars)
Métricas de merge de PR
 (Mesclagem média 17d 21h) (92 fundiu PRs em 30d)

Description

Jira Link: DB-4701

This is a YCQL issue. YSQL is not affected by this because all tables are transactional by default.

Right now, attempting to use ALTER TABLE to enable transactions given conflicting error messages complaining on the type only:

cqlsh> ALTER TABLE k.num WITH transactions.enabled = true;
SyntaxException: Invalid SQL Statement. syntax error, unexpected '.', expecting '='
ALTER TABLE k.num WITH transactions.enabled = true;
                                   ^
 (error -11)
cqlsh> ALTER TABLE k.num WITH transactions = '{"enabled": true}';
InvalidRequest: Error from server: code=2200 [Invalid query] message="Datatype Mismatch. Invalid value for option 'transactions'. Value must be a map
ALTER TABLE k.num WITH transactions = '{"enabled": true}';
                       ^^^^^^^^^^^^
 (error -201)"
cqlsh> ALTER TABLE k.num WITH transactions = {'enabled': true};
SyntaxException: Invalid SQL Statement. syntax error, unexpected '{'
ALTER TABLE k.num WITH transactions = {'enabled': true};
                                      ^
 (error -11)

So, error message asks user to use map value but complains about unexpected '{' if he does.

Proposal:

  • Any attempt to alter read-only property must report that clearly, e.g. cannot change read-only property
  • Transactions property being immutable should be explicitly mentioned in our docs

Guia do colaborador