OmniSciDB  eb3a3d0a03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser::DropUserStmt Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::DropUserStmt:
+ Collaboration diagram for Parser::DropUserStmt:

Public Member Functions

 DropUserStmt (const rapidjson::Value &payload)
 DropUserStmt (std::string *n)
auto constgetUserName ()
void execute (const Catalog_Namespace::SessionInfo &session) override
- Public Member Functions inherited from Parser::DDLStmt
void setColumnDescriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
- Public Member Functions inherited from Parser::Node
virtual ~Node ()

Private Attributes

std::unique_ptr< std::string > user_name_

Detailed Description

Definition at line 2016 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::DropUserStmt::DropUserStmt ( const rapidjson::Value &  payload)

Definition at line 6178 of file ParserNode.cpp.

References CHECK, and json_str().

6178  {
6179  CHECK(payload.HasMember("name"));
6180  user_name_ = std::make_unique<std::string>(json_str(payload["name"]));
6181 }
const std::string json_str(const rapidjson::Value &obj) noexcept
Definition: JsonAccessors.h:44
std::unique_ptr< std::string > user_name_
Definition: ParserNode.h:2024
#define CHECK(condition)
Definition: Logger.h:209

+ Here is the call graph for this function:

Parser::DropUserStmt::DropUserStmt ( std::string *  n)

Definition at line 2019 of file ParserNode.h.

2019 : user_name_(n) {}
std::unique_ptr< std::string > user_name_
Definition: ParserNode.h:2024
constexpr double n
Definition: Utm.h:40

Member Function Documentation

void Parser::DropUserStmt::execute ( const Catalog_Namespace::SessionInfo session)

Implements Parser::DDLStmt.

Definition at line 6183 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::get_currentUser(), and Catalog_Namespace::UserMetadata::isSuper.

Referenced by omnisci.cursor.Cursor::executemany().

6183  {
6184  if (!session.get_currentUser().isSuper) {
6185  throw std::runtime_error("Only super user can drop users.");
6186  }
6187  SysCatalog::instance().dropUser(*user_name_);
6188 }
std::unique_ptr< std::string > user_name_
Definition: ParserNode.h:2024
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:73
std::atomic< bool > isSuper
Definition: SysCatalog.h:118

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

auto const& Parser::DropUserStmt::getUserName ( )

Definition at line 2020 of file ParserNode.h.

References user_name_.

2020 { return user_name_; }
std::unique_ptr< std::string > user_name_
Definition: ParserNode.h:2024

Member Data Documentation

std::unique_ptr<std::string> Parser::DropUserStmt::user_name_

Definition at line 2024 of file ParserNode.h.

Referenced by getUserName().

The documentation for this class was generated from the following files: