OmniSciDB  ba1bac9284
 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 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 ( std::string *  n)
inline

Definition at line 2018 of file ParserNode.h.

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

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 5790 of file ParserNode.cpp.

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

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

5790  {
5791  if (!session.get_currentUser().isSuper) {
5792  throw std::runtime_error("Only super user can drop users.");
5793  }
5794  SysCatalog::instance().dropUser(*user_name);
5795 }
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:2023
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:73
std::atomic< bool > isSuper
Definition: SysCatalog.h:99

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 2019 of file ParserNode.h.

References user_name.

2019 { return user_name; }
std::unique_ptr< std::string > user_name
Definition: ParserNode.h:2023

Member Data Documentation

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

Definition at line 2023 of file ParserNode.h.

Referenced by getUserName().


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