OmniSciDB  0fdbebe030
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parser::DumpTableStmt Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::DumpTableStmt:
+ Collaboration diagram for Parser::DumpTableStmt:

Public Member Functions

 DumpTableStmt (std::string *tab, std::string *path, std::list< NameValueAssign * > *options)
 
void execute (const Catalog_Namespace::SessionInfo &session) override
 
- Public Member Functions inherited from Parser::DumpRestoreTableStmtBase
 DumpRestoreTableStmtBase (std::string *tab, std::string *path, std::list< NameValueAssign * > *options, const bool is_restore)
 
const std::string * getTable () const
 
const std::string * getPath () const
 
const std::string getCompression () const
 
- Public Member Functions inherited from Parser::DDLStmt
void setColumnDescriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Additional Inherited Members

- Protected Attributes inherited from Parser::DumpRestoreTableStmtBase
std::unique_ptr< std::string > table
 
std::unique_ptr< std::string > path
 
std::string compression
 

Detailed Description

Definition at line 1402 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::DumpTableStmt::DumpTableStmt ( std::string *  tab,
std::string *  path,
std::list< NameValueAssign * > *  options 
)
inline

Definition at line 1404 of file ParserNode.h.

1405  : DumpRestoreTableStmtBase(tab, path, options, false) {}
DumpRestoreTableStmtBase(std::string *tab, std::string *path, std::list< NameValueAssign * > *options, const bool is_restore)
Definition: ParserNode.h:1333
std::unique_ptr< std::string > path
Definition: ParserNode.h:1398

Member Function Documentation

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

Implements Parser::DDLStmt.

Definition at line 4651 of file ParserNode.cpp.

References Catalog_Namespace::SessionInfo::checkDBAccessPrivileges(), AccessPrivileges::CREATE_TABLE, TableArchiver::dumpTable(), Catalog_Namespace::SessionInfo::getCatalog(), AccessPrivileges::SELECT_FROM_TABLE, and TableDBObjectType.

4651  {
4652  // check access privileges
4653  if (!session.checkDBAccessPrivileges(
4655  throw std::runtime_error("Table " + *table +
4656  " will not be dumped. User has no select privileges.");
4657  }
4660  throw std::runtime_error("Table " + *table +
4661  " will not be dumped. User has no create privileges.");
4662  }
4663  auto& catalog = session.getCatalog();
4664  const TableDescriptor* td = catalog.getMetadataForTable(*table);
4665  TableArchiver table_archiver(&catalog);
4666  table_archiver.dumpTable(td, *path, compression);
4667 }
std::unique_ptr< std::string > path
Definition: ParserNode.h:1398
static const AccessPrivileges SELECT_FROM_TABLE
Definition: DBObject.h:160
std::unique_ptr< std::string > table
Definition: ParserNode.h:1397
static const AccessPrivileges CREATE_TABLE
Definition: DBObject.h:158
Catalog & getCatalog() const
Definition: SessionInfo.h:76
specifies the content in-memory of a row in the table metadata table
bool checkDBAccessPrivileges(const DBObjectType &permissionType, const AccessPrivileges &privs, const std::string &objectName="") const
Definition: SessionInfo.cpp:24

+ Here is the call graph for this function:


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