OmniSciDB  467d548b97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 1957 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 1959 of file ParserNode.h.

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

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 4851 of file ParserNode.cpp.

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

4851  {
4852  if (!session.get_currentUser().isSuper) {
4853  throw std::runtime_error("Only super user can drop users.");
4854  }
4855  SysCatalog::instance().dropUser(*user_name);
4856 }
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:1964
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:68
std::atomic< bool > isSuper
Definition: SysCatalog.h:94

+ Here is the call graph for this function:

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

Definition at line 1960 of file ParserNode.h.

References user_name.

1960 { return user_name; }
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:1964

Member Data Documentation

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

Definition at line 1964 of file ParserNode.h.

Referenced by getUserName().

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