OmniSciDB  8fa3bf436f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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  RenameDatabaseStmt
 
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< RenameDatabaseStmt >
 
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 3919 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:66
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:72
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 5601 of file ParserNode.cpp.

References CHECK.

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

5602  {
5603  CHECK(p);
5604  if (!dynamic_cast<const StringLiteral*>(p->get_value())) {
5605  throw std::runtime_error(option_name + " option must be a string literal.");
5606  }
5607 }
#define CHECK(condition)
Definition: Logger.h:203

+ Here is the caller graph for this function:

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

Definition at line 5005 of file ParserNode.cpp.

References DashboardDBObjectType.

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

5005  {
5006  if (objectType == DashboardDBObjectType) {
5007  int32_t dashboard_id = -1;
5008  if (!objectName.empty()) {
5009  try {
5010  dashboard_id = stoi(objectName);
5011  } catch (const std::exception&) {
5012  throw std::runtime_error(
5013  "Privileges on dashboards should be changed via integer dashboard ID");
5014  }
5015  }
5016  return DBObject(dashboard_id, objectType);
5017  } else {
5018  return DBObject(objectName, objectType);
5019  }
5020 }

+ 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 5815 of file ParserNode.cpp.

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

5817  {
5818  CHECK(!ddl_statement.empty());
5819  VLOG(2) << "Parsing JSON DDL from Calcite: " << ddl_statement;
5820  rapidjson::Document ddl_query;
5821  ddl_query.Parse(ddl_statement);
5822  CHECK(ddl_query.IsObject());
5823  CHECK(ddl_query.HasMember("payload"));
5824  CHECK(ddl_query["payload"].IsObject());
5825  const auto& payload = ddl_query["payload"].GetObject();
5826  CHECK(payload.HasMember("command"));
5827  CHECK(payload["command"].IsString());
5828 
5829  const auto& ddl_command = std::string_view(payload["command"].GetString());
5830  if (ddl_command == "CREATE_TABLE") {
5831  auto create_table_stmt = Parser::CreateTableStmt(payload);
5832  create_table_stmt.execute(*session_ptr);
5833  } else if (ddl_command == "DROP_TABLE") {
5834  auto drop_table_stmt = Parser::DropTableStmt(payload);
5835  drop_table_stmt.execute(*session_ptr);
5836  } else if (ddl_command == "CREATE_VIEW") {
5837  auto create_view_stmt = Parser::CreateViewStmt(payload);
5838  create_view_stmt.execute(*session_ptr);
5839  } else if (ddl_command == "DROP_VIEW") {
5840  auto drop_view_stmt = Parser::DropViewStmt(payload);
5841  drop_view_stmt.execute(*session_ptr);
5842  } else if (ddl_command == "RENAME_TABLE") {
5843  auto rename_table_stmt = Parser::RenameTableStmt(payload);
5844  rename_table_stmt.execute(*session_ptr);
5845  } else if (ddl_command == "ALTER_TABLE") {
5846  Parser::AlterTableStmt::delegateExecute(payload, *session_ptr);
5847  } else {
5848  throw std::runtime_error("Unsupported DDL command");
5849  }
5850 }
static void delegateExecute(const rapidjson::Value &payload, const Catalog_Namespace::SessionInfo &session)
#define CHECK(condition)
Definition: Logger.h:203
#define VLOG(n)
Definition: Logger.h:297

+ 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 4868 of file ParserNode.cpp.

References splitObjectHierName().

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

4870  {
4871  std::string objectName;
4872  std::vector<std::string> componentNames = splitObjectHierName(objectHierName);
4873  if (objectType.compare("DATABASE") == 0) {
4874  if (componentNames.size() == 1) {
4875  objectName = componentNames[0];
4876  } else {
4877  throw std::runtime_error("DB object name is not correct " + objectHierName);
4878  }
4879  } else {
4880  if (objectType.compare("TABLE") == 0 || objectType.compare("DASHBOARD") == 0 ||
4881  objectType.compare("VIEW") == 0 || objectType.compare("SERVER") == 0) {
4882  switch (componentNames.size()) {
4883  case (1): {
4884  objectName = componentNames[0];
4885  break;
4886  }
4887  case (2): {
4888  objectName = componentNames[1];
4889  break;
4890  }
4891  default: {
4892  throw std::runtime_error("DB object name is not correct " + objectHierName);
4893  }
4894  }
4895  } else {
4896  throw std::runtime_error("DB object type " + objectType + " is not supported.");
4897  }
4898  }
4899  return objectName;
4900 }
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 2570 of file ParserNode.cpp.

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

2574  {},
2575  bool allow_interrupt = false) {
2576  auto const session = query_state_proxy.getQueryState().getConstSessionInfo();
2577  auto& catalog = session->getCatalog();
2578 
2580 #ifdef HAVE_CUDA
2581  const auto device_type = session->get_executor_device_type();
2582 #else
2583  const auto device_type = ExecutorDeviceType::CPU;
2584 #endif // HAVE_CUDA
2585  auto calcite_mgr = catalog.getCalciteMgr();
2586 
2587  // TODO MAT this should actually get the global or the session parameter for
2588  // view optimization
2589  const auto query_ra =
2590  calcite_mgr
2591  ->process(query_state_proxy, pg_shim(select_stmt), {}, true, false, false, true)
2592  .plan_result;
2593  RelAlgExecutor ra_executor(executor.get(),
2594  catalog,
2595  query_ra,
2596  query_state_proxy.getQueryState().shared_from_this());
2598  const auto& query_hints = ra_executor.getParsedQueryHints();
2599  const auto cpu_mode_enabled = query_hints.isHintRegistered(QueryHint::kCpuMode);
2600  if (cpu_mode_enabled) {
2601  co.device_type = ExecutorDeviceType::CPU;
2602  }
2604  // TODO(adb): Need a better method of dropping constants into this ExecutionOptions
2605  // struct
2606  ExecutionOptions eo = {false,
2607  true,
2608  false,
2609  true,
2610  false,
2611  false,
2612  validate_only,
2613  false,
2614  10000,
2615  false,
2616  false,
2617  1000,
2618  allow_interrupt,
2622  outer_fragment_indices};
2623  ExecutionResult result{std::make_shared<ResultSet>(std::vector<TargetInfo>{},
2626  nullptr,
2627  nullptr,
2628  0,
2629  0),
2630  {}};
2631  result = ra_executor.executeRelAlgQuery(co, eo, false, nullptr);
2632  targets = result.getTargetsMeta();
2633 
2634  return result.getRows();
2635 }
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:163
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:79
std::string pg_shim(const std::string &query)
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:366

+ 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 1561 of file ParserNode.h.

References CHECK.

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

1562  {
1563  CHECK(l);
1564  for (auto str : *l) {
1565  v.push_back(*str);
1566  delete str;
1567  }
1568  delete l;
1569 }
#define CHECK(condition)
Definition: Logger.h:203

+ 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 4902 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().

4905  {
4906  static const std::map<std::pair<const std::string, const DBObjectType>,
4907  std::pair<const AccessPrivileges, const DBObjectType>>
4908  privileges_lookup{
4909  {{"ALL"s, DatabaseDBObjectType},
4912  {{"ALL"s, DashboardDBObjectType},
4915  {{"ALL"s, ServerDBObjectType},
4917 
4918  {{"CREATE TABLE"s, DatabaseDBObjectType},
4920  {{"CREATE"s, DatabaseDBObjectType},
4922  {{"SELECT"s, DatabaseDBObjectType},
4924  {{"INSERT"s, DatabaseDBObjectType},
4926  {{"TRUNCATE"s, DatabaseDBObjectType},
4928  {{"UPDATE"s, DatabaseDBObjectType},
4930  {{"DELETE"s, DatabaseDBObjectType},
4932  {{"DROP"s, DatabaseDBObjectType},
4934  {{"ALTER"s, DatabaseDBObjectType},
4936 
4937  {{"SELECT"s, TableDBObjectType},
4939  {{"INSERT"s, TableDBObjectType},
4941  {{"TRUNCATE"s, TableDBObjectType},
4943  {{"UPDATE"s, TableDBObjectType},
4945  {{"DELETE"s, TableDBObjectType},
4947  {{"DROP"s, TableDBObjectType},
4949  {{"ALTER"s, TableDBObjectType},
4951 
4952  {{"CREATE VIEW"s, DatabaseDBObjectType},
4954  {{"SELECT VIEW"s, DatabaseDBObjectType},
4956  {{"DROP VIEW"s, DatabaseDBObjectType},
4958  {{"SELECT"s, ViewDBObjectType},
4961 
4962  {{"CREATE DASHBOARD"s, DatabaseDBObjectType},
4964  {{"EDIT DASHBOARD"s, DatabaseDBObjectType},
4966  {{"VIEW DASHBOARD"s, DatabaseDBObjectType},
4968  {{"DELETE DASHBOARD"s, DatabaseDBObjectType},
4970  {{"VIEW"s, DashboardDBObjectType},
4972  {{"EDIT"s, DashboardDBObjectType},
4974  {{"DELETE"s, DashboardDBObjectType},
4976 
4977  {{"CREATE SERVER"s, DatabaseDBObjectType},
4979  {{"DROP SERVER"s, DatabaseDBObjectType},
4981  {{"DROP"s, ServerDBObjectType},
4983  {{"ALTER SERVER"s, DatabaseDBObjectType},
4985  {{"ALTER"s, ServerDBObjectType},
4987  {{"USAGE"s, ServerDBObjectType},
4989  {{"SERVER USAGE"s, DatabaseDBObjectType},
4991 
4992  {{"VIEW SQL EDITOR"s, DatabaseDBObjectType},
4994  {{"ACCESS"s, DatabaseDBObjectType},
4996 
4997  auto result = privileges_lookup.find(std::make_pair(privs, objectType));
4998  if (result == privileges_lookup.end()) {
4999  throw std::runtime_error("Privileges " + privs + " on DB object " + object_name +
5000  " are not correct.");
5001  }
5002  return result->second;
5003 }
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 5669 of file ParserNode.cpp.

References CHECK.

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

5670  {
5671  CHECK(p);
5672  const std::string* str =
5673  static_cast<const StringLiteral*>(p->get_value())->get_stringval();
5674  if (boost::iequals(*str, "true")) {
5675  return true;
5676  } else if (boost::iequals(*str, "false")) {
5677  return false;
5678  } else {
5679  throw std::runtime_error("Value to " + option_name + " must be TRUE or FALSE.");
5680  }
5681 }
#define CHECK(condition)
Definition: Logger.h:203

+ Here is the caller graph for this function:

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

Definition at line 4862 of file ParserNode.cpp.

References split().

Referenced by extractObjectNameFromHierName().

4862  {
4863  std::vector<std::string> componentNames;
4864  boost::split(componentNames, hierName, boost::is_any_of("."));
4865  return componentNames;
4866 }
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: