OmniSciDB  21ac014ffc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser Namespace Reference

Namespaces

 anonymous_namespace{ParserNode.cpp}
 

Classes

class  Node
 
class  SQLType
 
class  Expr
 
class  Literal
 
class  NullLiteral
 
class  StringLiteral
 
class  IntLiteral
 
class  FixedPtLiteral
 
class  FloatLiteral
 
class  DoubleLiteral
 
class  TimestampLiteral
 
class  UserLiteral
 
class  ArrayLiteral
 
class  OperExpr
 
class  SubqueryExpr
 
class  IsNullExpr
 
class  InExpr
 
class  InSubquery
 
class  InValues
 
class  BetweenExpr
 
class  CharLengthExpr
 
class  CardinalityExpr
 
class  LikeExpr
 
class  RegexpExpr
 
class  LikelihoodExpr
 
class  ExistsExpr
 
class  ColumnRef
 
class  FunctionRef
 
class  CastExpr
 
class  ExprPair
 
class  CaseExpr
 
class  TableRef
 
class  Stmt
 
class  DMLStmt
 
class  DDLStmt
 
class  TableElement
 
class  ColumnConstraintDef
 
class  CompressDef
 
class  ColumnDef
 
class  TableConstraintDef
 
class  UniqueDef
 
class  ForeignKeyDef
 
class  CheckDef
 
class  SharedDictionaryDef
 
class  ShardKeyDef
 
class  NameValueAssign
 
class  CreateTableBaseStmt
 
class  CreateTableStmt
 
struct  DistributedConnector
 
struct  LocalConnector
 
class  CreateDataframeStmt
 
class  InsertIntoTableAsSelectStmt
 
class  CreateTableAsSelectStmt
 
class  AlterTableStmt
 
class  DropTableStmt
 
class  TruncateTableStmt
 
class  OptimizeTableStmt
 
class  ValidateStmt
 
class  RenameDBStmt
 
class  RenameUserStmt
 
class  RenameTableStmt
 
class  RenameColumnStmt
 
class  AddColumnStmt
 
class  DropColumnStmt
 
class  AlterTableParamStmt
 
class  DumpRestoreTableStmtBase
 
class  DumpTableStmt
 
class  RestoreTableStmt
 
class  CopyTableStmt
 
class  CreateRoleStmt
 
class  DropRoleStmt
 
class  GrantPrivilegesStmt
 
class  RevokePrivilegesStmt
 
class  ShowPrivilegesStmt
 
class  GrantRoleStmt
 
class  RevokeRoleStmt
 
class  QueryExpr
 
class  UnionQuery
 
class  SelectEntry
 
class  QuerySpec
 
class  OrderSpec
 
class  SelectStmt
 
class  ShowCreateTableStmt
 
class  ExportQueryStmt
 
class  CreateViewStmt
 
class  DropViewStmt
 
class  CreateDBStmt
 
class  DropDBStmt
 
class  CreateUserStmt
 
class  AlterUserStmt
 
class  DropUserStmt
 
class  InsertStmt
 
class  InsertValuesStmt
 
class  Assignment
 
class  UpdateStmt
 
class  DeleteStmt
 
struct  DefaultValidate
 
struct  DefaultValidate< IntLiteral >
 
struct  PositiveOrZeroValidate
 
struct  DefaultValidate< StringLiteral >
 
struct  CaseSensitiveValidate
 
struct  ShouldInvalidateSessionsByDB
 
struct  ShouldInvalidateSessionsByUser
 
struct  ShouldInvalidateSessionsByDB< DropDBStmt >
 
struct  ShouldInvalidateSessionsByUser< DropUserStmt >
 
struct  ShouldInvalidateSessionsByDB< RenameDBStmt >
 
struct  ShouldInvalidateSessionsByUser< RenameUserStmt >
 
class  TrackedPtr
 
class  TrackedListPtr
 

Typedefs

using SubstituteMap = std::map< std::string, std::string >
 

Functions

template<typename DDLSTMT >
auto parseDDL (const std::string &stmt_type, const std::string &stmt_str)
 
bool checkInterrupt (const QuerySessionId &query_session, Executor *executor)
 
std::shared_ptr< ResultSetgetResultSet (QueryStateProxy query_state_proxy, const std::string select_stmt, std::vector< TargetMetaInfo > &targets, bool validate_only=false, std::vector< size_t > outer_fragment_indices={}, bool allow_interrupt=false)
 
void check_alter_table_privilege (const Catalog_Namespace::SessionInfo &session, const TableDescriptor *td)
 
std::vector< std::string > splitObjectHierName (const std::string &hierName)
 
std::string extractObjectNameFromHierName (const std::string &objectHierName, const std::string &objectType, const Catalog_Namespace::Catalog &cat)
 
static std::pair
< AccessPrivileges,
DBObjectType
parseStringPrivs (const std::string &privs, const DBObjectType &objectType, const std::string &object_name)
 
static DBObject createObject (const std::string &objectName, DBObjectType objectType)
 
static void checkStringLiteral (const std::string &option_name, const std::unique_ptr< NameValueAssign > &p)
 
static bool readBooleanLiteral (const std::string &option_name, const std::unique_ptr< NameValueAssign > &p)
 
void execute_calcite_ddl (const std::string &ddl_statement, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr)
 
void parser_slistval_to_vector (std::list< std::string * > *l, std::vector< std::string > &v)
 

Typedef Documentation

using Parser::SubstituteMap = typedef std::map<std::string, std::string>

Definition at line 3931 of file ParserNode.cpp.

Function Documentation

void Parser::check_alter_table_privilege ( const Catalog_Namespace::SessionInfo session,
const TableDescriptor td 
)

Definition at line 3843 of file ParserNode.cpp.

References AccessPrivileges::ALTER_TABLE, Catalog_Namespace::SessionInfo::get_currentUser(), Catalog_Namespace::SessionInfo::getCatalog(), Catalog_Namespace::UserMetadata::isSuper, DBObject::loadKey(), DBObject::setPrivileges(), TableDBObjectType, TableDescriptor::tableName, TableDescriptor::userId, and Catalog_Namespace::UserMetadata::userId.

Referenced by Parser::AddColumnStmt::check_executable(), Parser::RenameTableStmt::execute(), Parser::RenameColumnStmt::execute(), Parser::DropColumnStmt::execute(), and Parser::AlterTableParamStmt::execute().

3844  {
3845  if (session.get_currentUser().isSuper ||
3846  session.get_currentUser().userId == td->userId) {
3847  return;
3848  }
3849  std::vector<DBObject> privObjects;
3850  DBObject dbObject(td->tableName, TableDBObjectType);
3851  dbObject.loadKey(session.getCatalog());
3852  dbObject.setPrivileges(AccessPrivileges::ALTER_TABLE);
3853  privObjects.push_back(dbObject);
3854  if (!SysCatalog::instance().checkPrivileges(session.get_currentUser(), privObjects)) {
3855  throw std::runtime_error("Current user does not have the privilege to alter table: " +
3856  td->tableName);
3857  }
3858 }
std::string tableName
static const AccessPrivileges ALTER_TABLE
Definition: DBObject.h:167
Catalog & getCatalog() const
Definition: SessionInfo.h:67
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:73
std::atomic< bool > isSuper
Definition: SysCatalog.h:99

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Parser::checkInterrupt ( const QuerySessionId query_session,
Executor executor 
)

Definition at line 94 of file ParserNode.cpp.

References g_enable_non_kernel_time_query_interrupt.

94  {
96  mapd_shared_lock<mapd_shared_mutex> session_read_lock(executor->getSessionLock());
97  const auto isInterrupted =
98  executor->checkIsQuerySessionInterrupted(query_session, session_read_lock);
99  return isInterrupted;
100  }
101  return false;
102 }
bool g_enable_non_kernel_time_query_interrupt
Definition: Execute.cpp:115
static void Parser::checkStringLiteral ( const std::string &  option_name,
const std::unique_ptr< NameValueAssign > &  p 
)
static

Definition at line 5627 of file ParserNode.cpp.

References CHECK.

Referenced by Parser::CreateDBStmt::execute(), Parser::CreateUserStmt::execute(), and Parser::AlterUserStmt::execute().

5628  {
5629  CHECK(p);
5630  if (!dynamic_cast<const StringLiteral*>(p->get_value())) {
5631  throw std::runtime_error(option_name + " option must be a string literal.");
5632  }
5633 }
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the caller graph for this function:

static DBObject Parser::createObject ( const std::string &  objectName,
DBObjectType  objectType 
)
static

Definition at line 5031 of file ParserNode.cpp.

References DashboardDBObjectType.

Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().

5031  {
5032  if (objectType == DashboardDBObjectType) {
5033  int32_t dashboard_id = -1;
5034  if (!objectName.empty()) {
5035  try {
5036  dashboard_id = stoi(objectName);
5037  } catch (const std::exception&) {
5038  throw std::runtime_error(
5039  "Privileges on dashboards should be changed via integer dashboard ID");
5040  }
5041  }
5042  return DBObject(dashboard_id, objectType);
5043  } else {
5044  return DBObject(objectName, objectType);
5045  }
5046 }

+ Here is the caller graph for this function:

void Parser::execute_calcite_ddl ( const std::string &  plan_result,
std::shared_ptr< Catalog_Namespace::SessionInfo const session_ptr 
)

A helper function for parsing the DDL returned from calcite as part of the plan result to a parser node in this class. Currently only used in QueryRunner/DistributedQueryRunner, where we do not want to link in the thrift dependencies wich DdlCommandExecutor currently brings along.

Definition at line 5943 of file ParserNode.cpp.

References CHECK, Parser::AlterTableStmt::delegateExecute(), and VLOG.

5945  {
5946  CHECK(!ddl_statement.empty());
5947  VLOG(2) << "Parsing JSON DDL from Calcite: " << ddl_statement;
5948  rapidjson::Document ddl_query;
5949  ddl_query.Parse(ddl_statement);
5950  CHECK(ddl_query.IsObject());
5951  CHECK(ddl_query.HasMember("payload"));
5952  CHECK(ddl_query["payload"].IsObject());
5953  const auto& payload = ddl_query["payload"].GetObject();
5954  CHECK(payload.HasMember("command"));
5955  CHECK(payload["command"].IsString());
5956 
5957  const auto& ddl_command = std::string_view(payload["command"].GetString());
5958  if (ddl_command == "CREATE_TABLE") {
5959  auto create_table_stmt = Parser::CreateTableStmt(payload);
5960  create_table_stmt.execute(*session_ptr);
5961  } else if (ddl_command == "DROP_TABLE") {
5962  auto drop_table_stmt = Parser::DropTableStmt(payload);
5963  drop_table_stmt.execute(*session_ptr);
5964  } else if (ddl_command == "CREATE_VIEW") {
5965  auto create_view_stmt = Parser::CreateViewStmt(payload);
5966  create_view_stmt.execute(*session_ptr);
5967  } else if (ddl_command == "DROP_VIEW") {
5968  auto drop_view_stmt = Parser::DropViewStmt(payload);
5969  drop_view_stmt.execute(*session_ptr);
5970  } else if (ddl_command == "RENAME_TABLE") {
5971  auto rename_table_stmt = Parser::RenameTableStmt(payload);
5972  rename_table_stmt.execute(*session_ptr);
5973  } else if (ddl_command == "ALTER_TABLE") {
5974  Parser::AlterTableStmt::delegateExecute(payload, *session_ptr);
5975  } else if (ddl_command == "CREATE_DB") {
5976  auto create_db_stmt = Parser::CreateDBStmt(payload);
5977  create_db_stmt.execute(*session_ptr);
5978  } else if (ddl_command == "DROP_DB") {
5979  auto drop_db_stmt = Parser::DropDBStmt(payload);
5980  drop_db_stmt.execute(*session_ptr);
5981  } else if (ddl_command == "RENAME_DB") {
5982  auto rename_db_stmt = Parser::RenameDBStmt(payload);
5983  rename_db_stmt.execute(*session_ptr);
5984  } else if (ddl_command == "CREATE_USER") {
5985  auto create_user_stmt = Parser::CreateUserStmt(payload);
5986  create_user_stmt.execute(*session_ptr);
5987  } else if (ddl_command == "DROP_USER") {
5988  auto drop_user_stmt = Parser::DropUserStmt(payload);
5989  drop_user_stmt.execute(*session_ptr);
5990  } else if (ddl_command == "ALTER_USER") {
5991  auto alter_user_stmt = Parser::AlterUserStmt(payload);
5992  alter_user_stmt.execute(*session_ptr);
5993  } else if (ddl_command == "RENAME_USER") {
5994  auto rename_user_stmt = Parser::RenameUserStmt(payload);
5995  rename_user_stmt.execute(*session_ptr);
5996  } else {
5997  throw std::runtime_error("Unsupported DDL command");
5998  }
5999 }
static void delegateExecute(const rapidjson::Value &payload, const Catalog_Namespace::SessionInfo &session)
#define CHECK(condition)
Definition: Logger.h:206
#define VLOG(n)
Definition: Logger.h:300

+ Here is the call graph for this function:

std::string Parser::extractObjectNameFromHierName ( const std::string &  objectHierName,
const std::string &  objectType,
const Catalog_Namespace::Catalog cat 
)

Definition at line 4894 of file ParserNode.cpp.

References splitObjectHierName().

Referenced by Parser::GrantPrivilegesStmt::execute(), Parser::RevokePrivilegesStmt::execute(), and Parser::ShowPrivilegesStmt::execute().

4896  {
4897  std::string objectName;
4898  std::vector<std::string> componentNames = splitObjectHierName(objectHierName);
4899  if (objectType.compare("DATABASE") == 0) {
4900  if (componentNames.size() == 1) {
4901  objectName = componentNames[0];
4902  } else {
4903  throw std::runtime_error("DB object name is not correct " + objectHierName);
4904  }
4905  } else {
4906  if (objectType.compare("TABLE") == 0 || objectType.compare("DASHBOARD") == 0 ||
4907  objectType.compare("VIEW") == 0 || objectType.compare("SERVER") == 0) {
4908  switch (componentNames.size()) {
4909  case (1): {
4910  objectName = componentNames[0];
4911  break;
4912  }
4913  case (2): {
4914  objectName = componentNames[1];
4915  break;
4916  }
4917  default: {
4918  throw std::runtime_error("DB object name is not correct " + objectHierName);
4919  }
4920  }
4921  } else {
4922  throw std::runtime_error("DB object type " + objectType + " is not supported.");
4923  }
4924  }
4925  return objectName;
4926 }
std::vector< std::string > splitObjectHierName(const std::string &hierName)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr<ResultSet> Parser::getResultSet ( QueryStateProxy  query_state_proxy,
const std::string  select_stmt,
std::vector< TargetMetaInfo > &  targets,
bool  validate_only = false,
std::vector< size_t >  outer_fragment_indices = {},
bool  allow_interrupt = false 
)

Definition at line 2593 of file ParserNode.cpp.

Referenced by Parser::LocalConnector::query().

2597  {},
2598  bool allow_interrupt = false) {
2599  auto const session = query_state_proxy.getQueryState().getConstSessionInfo();
2600  auto& catalog = session->getCatalog();
2601 
2603 #ifdef HAVE_CUDA
2604  const auto device_type = session->get_executor_device_type();
2605 #else
2606  const auto device_type = ExecutorDeviceType::CPU;
2607 #endif // HAVE_CUDA
2608  auto calcite_mgr = catalog.getCalciteMgr();
2609 
2610  // TODO MAT this should actually get the global or the session parameter for
2611  // view optimization
2612  const auto query_ra =
2613  calcite_mgr
2614  ->process(query_state_proxy, pg_shim(select_stmt), {}, true, false, false, true)
2615  .plan_result;
2616  RelAlgExecutor ra_executor(executor.get(),
2617  catalog,
2618  query_ra,
2619  query_state_proxy.getQueryState().shared_from_this());
2621  const auto& query_hints = ra_executor.getParsedQueryHints();
2622  const auto cpu_mode_enabled = query_hints.isHintRegistered(QueryHint::kCpuMode);
2623  if (cpu_mode_enabled) {
2624  co.device_type = ExecutorDeviceType::CPU;
2625  }
2627  // TODO(adb): Need a better method of dropping constants into this ExecutionOptions
2628  // struct
2629  ExecutionOptions eo = {false,
2630  true,
2631  false,
2632  true,
2633  false,
2634  false,
2635  validate_only,
2636  false,
2637  10000,
2638  false,
2639  false,
2640  1000,
2641  allow_interrupt,
2645  outer_fragment_indices};
2646  ExecutionResult result{std::make_shared<ResultSet>(std::vector<TargetInfo>{},
2649  nullptr,
2650  nullptr,
2651  0,
2652  0),
2653  {}};
2654  result = ra_executor.executeRelAlgQuery(co, eo, false, nullptr);
2655  targets = result.getTargetsMeta();
2656 
2657  return result.getRows();
2658 }
double g_running_query_interrupt_freq
Definition: Execute.cpp:118
unsigned g_pending_query_interrupt_freq
Definition: Execute.cpp:117
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters())
Definition: Execute.cpp:167
QueryState & getQueryState()
Definition: QueryState.h:175
static CompilationOptions defaults(const ExecutorDeviceType device_type=ExecutorDeviceType::GPU)
std::shared_ptr< Catalog_Namespace::SessionInfo const > getConstSessionInfo() const
Definition: QueryState.cpp:80
std::string pg_shim(const std::string &query)
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:367

+ Here is the caller graph for this function:

template<typename DDLSTMT >
auto Parser::parseDDL ( const std::string &  stmt_type,
const std::string &  stmt_str 
)

Definition at line 29 of file ParseDDL.h.

References run_benchmark_import::parser.

29  {
30  std::list<std::unique_ptr<Parser::Stmt>> parse_trees;
31  std::string last_parsed;
32  SQLParser parser;
33  if (parser.parse(stmt_str, parse_trees, last_parsed) > 0) {
34  throw std::runtime_error("Syntax error in " + stmt_type + " \"" + stmt_str +
35  "\" at " + last_parsed);
36  }
37  if (auto ddl_stmt = dynamic_cast<DDLSTMT*>(parse_trees.front().get())) {
38  parse_trees.front().release();
39  return std::unique_ptr<DDLSTMT>(ddl_stmt);
40  }
41  throw std::runtime_error("Expected " + stmt_type + " is not found in \"" + stmt_str +
42  "\"");
43 }
void Parser::parser_slistval_to_vector ( std::list< std::string * > *  l,
std::vector< std::string > &  v 
)
inline

Definition at line 1566 of file ParserNode.h.

References CHECK.

Referenced by Parser::GrantPrivilegesStmt::GrantPrivilegesStmt(), Parser::GrantRoleStmt::GrantRoleStmt(), Parser::RevokePrivilegesStmt::RevokePrivilegesStmt(), and Parser::RevokeRoleStmt::RevokeRoleStmt().

1567  {
1568  CHECK(l);
1569  for (auto str : *l) {
1570  v.push_back(*str);
1571  delete str;
1572  }
1573  delete l;
1574 }
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the caller graph for this function:

static std::pair<AccessPrivileges, DBObjectType> Parser::parseStringPrivs ( const std::string &  privs,
const DBObjectType objectType,
const std::string &  object_name 
)
static

Definition at line 4928 of file ParserNode.cpp.

References AccessPrivileges::ACCESS, AccessPrivileges::ALL_DASHBOARD, AccessPrivileges::ALL_DATABASE, AccessPrivileges::ALL_SERVER, AccessPrivileges::ALL_TABLE, AccessPrivileges::ALL_VIEW, AccessPrivileges::ALTER_SERVER, AccessPrivileges::ALTER_TABLE, AccessPrivileges::CREATE_DASHBOARD, AccessPrivileges::CREATE_SERVER, AccessPrivileges::CREATE_TABLE, AccessPrivileges::CREATE_VIEW, DashboardDBObjectType, DatabaseDBObjectType, AccessPrivileges::DELETE_DASHBOARD, AccessPrivileges::DELETE_FROM_TABLE, AccessPrivileges::DROP_SERVER, AccessPrivileges::DROP_TABLE, AccessPrivileges::DROP_VIEW, AccessPrivileges::EDIT_DASHBOARD, AccessPrivileges::INSERT_INTO_TABLE, run_benchmark_import::result, AccessPrivileges::SELECT_FROM_TABLE, AccessPrivileges::SELECT_FROM_VIEW, AccessPrivileges::SERVER_USAGE, ServerDBObjectType, TableDBObjectType, AccessPrivileges::TRUNCATE_TABLE, AccessPrivileges::UPDATE_IN_TABLE, AccessPrivileges::VIEW_DASHBOARD, AccessPrivileges::VIEW_SQL_EDITOR, and ViewDBObjectType.

Referenced by Parser::GrantPrivilegesStmt::execute(), and Parser::RevokePrivilegesStmt::execute().

4931  {
4932  static const std::map<std::pair<const std::string, const DBObjectType>,
4933  std::pair<const AccessPrivileges, const DBObjectType>>
4934  privileges_lookup{
4935  {{"ALL"s, DatabaseDBObjectType},
4938  {{"ALL"s, DashboardDBObjectType},
4941  {{"ALL"s, ServerDBObjectType},
4943 
4944  {{"CREATE TABLE"s, DatabaseDBObjectType},
4946  {{"CREATE"s, DatabaseDBObjectType},
4948  {{"SELECT"s, DatabaseDBObjectType},
4950  {{"INSERT"s, DatabaseDBObjectType},
4952  {{"TRUNCATE"s, DatabaseDBObjectType},
4954  {{"UPDATE"s, DatabaseDBObjectType},
4956  {{"DELETE"s, DatabaseDBObjectType},
4958  {{"DROP"s, DatabaseDBObjectType},
4960  {{"ALTER"s, DatabaseDBObjectType},
4962 
4963  {{"SELECT"s, TableDBObjectType},
4965  {{"INSERT"s, TableDBObjectType},
4967  {{"TRUNCATE"s, TableDBObjectType},
4969  {{"UPDATE"s, TableDBObjectType},
4971  {{"DELETE"s, TableDBObjectType},
4973  {{"DROP"s, TableDBObjectType},
4975  {{"ALTER"s, TableDBObjectType},
4977 
4978  {{"CREATE VIEW"s, DatabaseDBObjectType},
4980  {{"SELECT VIEW"s, DatabaseDBObjectType},
4982  {{"DROP VIEW"s, DatabaseDBObjectType},
4984  {{"SELECT"s, ViewDBObjectType},
4987 
4988  {{"CREATE DASHBOARD"s, DatabaseDBObjectType},
4990  {{"EDIT DASHBOARD"s, DatabaseDBObjectType},
4992  {{"VIEW DASHBOARD"s, DatabaseDBObjectType},
4994  {{"DELETE DASHBOARD"s, DatabaseDBObjectType},
4996  {{"VIEW"s, DashboardDBObjectType},
4998  {{"EDIT"s, DashboardDBObjectType},
5000  {{"DELETE"s, DashboardDBObjectType},
5002 
5003  {{"CREATE SERVER"s, DatabaseDBObjectType},
5005  {{"DROP SERVER"s, DatabaseDBObjectType},
5007  {{"DROP"s, ServerDBObjectType},
5009  {{"ALTER SERVER"s, DatabaseDBObjectType},
5011  {{"ALTER"s, ServerDBObjectType},
5013  {{"USAGE"s, ServerDBObjectType},
5015  {{"SERVER USAGE"s, DatabaseDBObjectType},
5017 
5018  {{"VIEW SQL EDITOR"s, DatabaseDBObjectType},
5020  {{"ACCESS"s, DatabaseDBObjectType},
5022 
5023  auto result = privileges_lookup.find(std::make_pair(privs, objectType));
5024  if (result == privileges_lookup.end()) {
5025  throw std::runtime_error("Privileges " + privs + " on DB object " + object_name +
5026  " are not correct.");
5027  }
5028  return result->second;
5029 }
static const AccessPrivileges VIEW_SQL_EDITOR
Definition: DBObject.h:154
static const AccessPrivileges VIEW_DASHBOARD
Definition: DBObject.h:173
static const AccessPrivileges DROP_SERVER
Definition: DBObject.h:191
static const AccessPrivileges ALL_DATABASE
Definition: DBObject.h:153
static const AccessPrivileges ALTER_TABLE
Definition: DBObject.h:167
static const AccessPrivileges TRUNCATE_TABLE
Definition: DBObject.h:166
static const AccessPrivileges INSERT_INTO_TABLE
Definition: DBObject.h:163
static const AccessPrivileges CREATE_DASHBOARD
Definition: DBObject.h:172
static const AccessPrivileges SERVER_USAGE
Definition: DBObject.h:193
static const AccessPrivileges SELECT_FROM_TABLE
Definition: DBObject.h:162
static const AccessPrivileges ALL_VIEW
Definition: DBObject.h:179
static const AccessPrivileges ALTER_SERVER
Definition: DBObject.h:192
static const AccessPrivileges DROP_TABLE
Definition: DBObject.h:161
static const AccessPrivileges ALL_SERVER
Definition: DBObject.h:189
static const AccessPrivileges CREATE_SERVER
Definition: DBObject.h:190
static const AccessPrivileges DELETE_FROM_TABLE
Definition: DBObject.h:165
static const AccessPrivileges CREATE_TABLE
Definition: DBObject.h:160
static const AccessPrivileges SELECT_FROM_VIEW
Definition: DBObject.h:182
static const AccessPrivileges ALL_DASHBOARD
Definition: DBObject.h:171
static const AccessPrivileges ACCESS
Definition: DBObject.h:155
static const AccessPrivileges ALL_TABLE
Definition: DBObject.h:159
static const AccessPrivileges DROP_VIEW
Definition: DBObject.h:181
static const AccessPrivileges CREATE_VIEW
Definition: DBObject.h:180
static const AccessPrivileges DELETE_DASHBOARD
Definition: DBObject.h:175
static const AccessPrivileges EDIT_DASHBOARD
Definition: DBObject.h:174
static const AccessPrivileges UPDATE_IN_TABLE
Definition: DBObject.h:164

+ Here is the caller graph for this function:

static bool Parser::readBooleanLiteral ( const std::string &  option_name,
const std::unique_ptr< NameValueAssign > &  p 
)
static

Definition at line 5734 of file ParserNode.cpp.

References CHECK.

Referenced by Parser::CreateUserStmt::execute(), and Parser::AlterUserStmt::execute().

5735  {
5736  CHECK(p);
5737  const std::string* str =
5738  static_cast<const StringLiteral*>(p->get_value())->get_stringval();
5739  if (boost::iequals(*str, "true")) {
5740  return true;
5741  } else if (boost::iequals(*str, "false")) {
5742  return false;
5743  } else {
5744  throw std::runtime_error("Value to " + option_name + " must be TRUE or FALSE.");
5745  }
5746 }
#define CHECK(condition)
Definition: Logger.h:206

+ Here is the caller graph for this function:

std::vector<std::string> Parser::splitObjectHierName ( const std::string &  hierName)

Definition at line 4888 of file ParserNode.cpp.

References split().

Referenced by extractObjectNameFromHierName().

4888  {
4889  std::vector<std::string> componentNames;
4890  boost::split(componentNames, hierName, boost::is_any_of("."));
4891  return componentNames;
4892 }
std::vector< std::string > split(std::string_view str, std::string_view delim, std::optional< size_t > maxsplit)
split apart a string into a vector of substrings

+ Here is the call graph for this function:

+ Here is the caller graph for this function: