OmniSciDB  c07336695a
Parser::DropUserStmt Class Reference

#include <ParserNode.h>

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

Public Member Functions

 DropUserStmt (std::string *n)
auto const & getUserName ()
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 1786 of file ParserNode.h.

Constructor & Destructor Documentation

◆ DropUserStmt()

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

Definition at line 1788 of file ParserNode.h.

1788 : user_name(n) {}
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:1793

Member Function Documentation

◆ execute()

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

Implements Parser::DDLStmt.

Definition at line 4538 of file ParserNode.cpp.

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

4538  {
4539  if (!session.get_currentUser().isSuper) {
4540  throw std::runtime_error("Only super user can drop users.");
4541  }
4542  SysCatalog::instance().dropUser(*user_name);
4543 }
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:93
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:1793
+ Here is the call graph for this function:

◆ getUserName()

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

Definition at line 1789 of file ParserNode.h.

References session.

1789 { return user_name; }
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:1793

Member Data Documentation

◆ user_name

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

Definition at line 1793 of file ParserNode.h.

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