OmniSciDB  1dac507f6e
 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 1887 of file ParserNode.h.

Constructor & Destructor Documentation

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

Definition at line 1889 of file ParserNode.h.

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

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 4606 of file ParserNode.cpp.

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

4606  {
4607  if (!session.get_currentUser().isSuper) {
4608  throw std::runtime_error("Only super user can drop users.");
4609  }
4610  SysCatalog::instance().dropUser(*user_name);
4611 }
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:1894
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:93
std::atomic< bool > isSuper
Definition: SysCatalog.h:85

+ Here is the call graph for this function:

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

Definition at line 1890 of file ParserNode.h.

References user_name.

1890 { return user_name; }
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:1894

Member Data Documentation

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

Definition at line 1894 of file ParserNode.h.

Referenced by getUserName().


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