mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 01:20:39 +00:00
cql3: Enable truncate statement grammar definition
Truncate statement AST class is converted to C++ (although its functionality is unimplemented). Enable the CQL grammar definition so that users get an "not implemented" error instead of a syntax error. Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
This commit is contained in:
@@ -34,6 +34,7 @@ options {
|
||||
#include "cql3/statements/create_keyspace_statement.hh"
|
||||
#include "cql3/statements/create_table_statement.hh"
|
||||
#include "cql3/statements/property_definitions.hh"
|
||||
#include "cql3/statements/truncate_statement.hh"
|
||||
#include "cql3/statements/select_statement.hh"
|
||||
#include "cql3/statements/update_statement.hh"
|
||||
#include "cql3/statements/delete_statement.hh"
|
||||
@@ -253,9 +254,7 @@ cqlStatement returns [shared_ptr<parsed_statement> stmt]
|
||||
| st4= batchStatement { $stmt = st4; }
|
||||
| st5= deleteStatement { $stmt = st5; }
|
||||
| st6= useStatement { $stmt = st6; }
|
||||
#if 0
|
||||
| st7= truncateStatement { $stmt = st7; }
|
||||
#endif
|
||||
| st8= createKeyspaceStatement { $stmt = st8; }
|
||||
| st9= createTableStatement { $stmt = st9; }
|
||||
#if 0
|
||||
@@ -839,14 +838,16 @@ dropIndexStatement returns [DropIndexStatement expr]
|
||||
: K_DROP K_INDEX (K_IF K_EXISTS { ifExists = true; } )? index=indexName
|
||||
{ $expr = new DropIndexStatement(index, ifExists); }
|
||||
;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* TRUNCATE <CF>;
|
||||
*/
|
||||
truncateStatement returns [TruncateStatement stmt]
|
||||
: K_TRUNCATE cf=columnFamilyName { $stmt = new TruncateStatement(cf); }
|
||||
truncateStatement returns [::shared_ptr<truncate_statement> stmt]
|
||||
: K_TRUNCATE cf=columnFamilyName { $stmt = ::make_shared<truncate_statement>(cf); }
|
||||
;
|
||||
|
||||
#if 0
|
||||
/**
|
||||
* GRANT <permission> ON <resource> TO <username>
|
||||
*/
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace cql3 {
|
||||
|
||||
namespace statements {
|
||||
|
||||
class truncate_statement : public cf_statement, public virtual cql_statement, public ::enable_shared_from_this<truncate_statement> {
|
||||
class truncate_statement : public cf_statement, public cql_statement, public ::enable_shared_from_this<truncate_statement> {
|
||||
public:
|
||||
truncate_statement(::shared_ptr<cf_name>&& name)
|
||||
truncate_statement(::shared_ptr<cf_name> name)
|
||||
: cf_statement{std::move(name)}
|
||||
{ }
|
||||
|
||||
@@ -47,6 +47,10 @@ public:
|
||||
return ::make_shared<parsed_statement::prepared>(this->shared_from_this());
|
||||
}
|
||||
|
||||
virtual bool uses_function(const sstring& ks_name, const sstring& function_name) const override {
|
||||
return parsed_statement::uses_function(ks_name, function_name);
|
||||
}
|
||||
|
||||
virtual void check_access(const service::client_state& state) override {
|
||||
throw std::runtime_error("not implemented");
|
||||
#if 0
|
||||
|
||||
Reference in New Issue
Block a user