yifan-c commented on PR #4411:
URL: https://github.com/apache/cassandra/pull/4411#issuecomment-3528964860
> Found one major issue. Please see the example below.
>
> ```sql
> cqlsh> CREATE KEYSPACE keyspace1 WITH replication = {'class':
'SimpleStrategy', 'replication_factor': '1'};
> cqlsh> CREATE TABLE keyspace1.tbl (key int PRIMARY KEY);
> cqlsh> COMMENT ON COLUMN keyspace1.tbl.key is 'a''b'; <-- the comment text
uses the escaped single quote, ''. It is allowed.
> cqlsh> DESC TABLE keyspace1.tbl;
>
> CREATE TABLE keyspace1.tbl (
> key int PRIMARY KEY
> ) WITH ...;
> COMMENT ON COLUMN keyspace1.tbl.key IS 'a'b';
> ```
>
> The output `COMMENT ON COLUMN keyspace1.tbl.key IS 'a'b';` cannot be
imported into another Cassandra database.
>
> I think you either reject `'` in comment (and security label too) or print
the escaped single quote in the `DESC` output.
I was able to put this comment :)
```
cqlsh> COMMENT ON COLUMN keyspace1.tbl.key is 'a''; DROP TABLE
keyspace1.tbl;';
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]