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

CASSANDRA-16233 - remove replace from cql reserved words #792

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
98 changes: 49 additions & 49 deletions .circleci/config.yml
Expand Up @@ -3,10 +3,10 @@ jobs:
j8_jvm_upgrade_dtests:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 1
parallelism: 2
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -94,10 +94,10 @@ jobs:
j8_cqlsh-dtests-py2-with-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -171,10 +171,10 @@ jobs:
j11_unit_tests:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -263,10 +263,10 @@ jobs:
j8_cqlsh-dtests-py38-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -340,10 +340,10 @@ jobs:
j11_cqlsh-dtests-py3-with-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -418,10 +418,10 @@ jobs:
j11_cqlsh-dtests-py3-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -496,10 +496,10 @@ jobs:
j11_cqlsh-dtests-py38-with-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -574,10 +574,10 @@ jobs:
j8_cqlsh-dtests-py3-with-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -651,10 +651,10 @@ jobs:
j8_cqlsh-dtests-py2-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -728,10 +728,10 @@ jobs:
j11_cqlsh-dtests-py2-with-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -806,10 +806,10 @@ jobs:
j11_dtests-with-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 25
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -887,10 +887,10 @@ jobs:
j8_dtests-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 25
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -945,10 +945,10 @@ jobs:
j8_upgradetests-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1044,7 +1044,7 @@ jobs:
utests_stress:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 1
Expand Down Expand Up @@ -1089,10 +1089,10 @@ jobs:
j8_unit_tests:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 35
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1180,10 +1180,10 @@ jobs:
j11_jvm_dtests:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 1
parallelism: 10
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1353,10 +1353,10 @@ jobs:
j11_cqlsh-dtests-py2-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1431,10 +1431,10 @@ jobs:
j8_dtests-with-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 25
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1489,10 +1489,10 @@ jobs:
j11_cqlsh-dtests-py38-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1567,10 +1567,10 @@ jobs:
j8_jvm_dtests:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 1
parallelism: 14
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1738,10 +1738,10 @@ jobs:
j8_cqlsh-dtests-py3-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1815,10 +1815,10 @@ jobs:
j8_cqlsh-dtests-py38-with-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -1892,7 +1892,7 @@ jobs:
utests_long:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 1
Expand Down Expand Up @@ -1937,7 +1937,7 @@ jobs:
utests_fqltool:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 1
Expand Down Expand Up @@ -1982,10 +1982,10 @@ jobs:
j11_dtests-no-vnodes:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 25
steps:
- attach_workspace:
at: /home/cassandra
Expand Down Expand Up @@ -2063,10 +2063,10 @@ jobs:
utests_compression:
docker:
- image: nastra/cassandra-testing-ubuntu1910-java11-w-dependencies:20200603
resource_class: medium
resource_class: xlarge
working_directory: ~/
shell: /bin/bash -eo pipefail -l
parallelism: 4
parallelism: 20
steps:
- attach_workspace:
at: /home/cassandra
Expand Down
2 changes: 1 addition & 1 deletion src/antlr/Parser.g
Expand Up @@ -1830,7 +1830,7 @@ non_type_ident returns [ColumnIdentifier id]

unreserved_keyword returns [String str]
: u=unreserved_function_keyword { $str = u; }
| k=(K_TTL | K_COUNT | K_WRITETIME | K_KEY | K_CAST | K_JSON | K_DISTINCT) { $str = $k.text; }
| k=(K_TTL | K_COUNT | K_WRITETIME | K_KEY | K_CAST | K_JSON | K_DISTINCT | K_REPLACE) { $str = $k.text; }
;

unreserved_function_keyword returns [String str]
Expand Down
1 change: 0 additions & 1 deletion src/java/org/apache/cassandra/cql3/ReservedKeywords.java
Expand Up @@ -85,7 +85,6 @@ class ReservedKeywords
"NAN",
"INFINITY",
"OR",
"REPLACE",
"DEFAULT",
"UNSET",
"MBEAN",
Expand Down
35 changes: 35 additions & 0 deletions test/unit/org/apache/cassandra/cql3/NotReservedTest.java
@@ -0,0 +1,35 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.cassandra.cql3;

import org.junit.Assert;
import org.junit.Test;

public class NotReservedTest extends CQLTester
{
@Test
public void replace() throws Throwable
{
createTable("CREATE TABLE %s (id text PRIMARY KEY, replace text);");
execute("INSERT INTO %s (id, replace) VALUES ('a', 'b')");
UntypedResultSet result = execute("SELECT id, replace FROM %s WHERE id='a'");
UntypedResultSet.Row row = result.one();
Assert.assertNotNull(row);
Assert.assertEquals("b", row.getString("replace"));
}
}