OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dbhandler Namespace Reference

Functions

bool is_info_schema_db (const std::string &db_name)
 
void check_not_info_schema_db (const std::string &db_name, bool throw_db_exception)
 

Function Documentation

void dbhandler::check_not_info_schema_db ( const std::string &  db_name,
bool  throw_db_exception 
)

Definition at line 4811 of file DBHandler.cpp.

References is_info_schema_db(), shared::kInfoSchemaDbName, and THROW_DB_EXCEPTION.

Referenced by DBHandler::create_dashboard(), DBHandler::delete_dashboards(), DBHandler::replace_dashboard(), and DBHandler::sql_execute_impl().

4811  {
4812  if (is_info_schema_db(db_name)) {
4813  std::string error_message{"Write requests/queries are not allowed in the " +
4814  shared::kInfoSchemaDbName + " database."};
4815  if (throw_db_exception) {
4816  THROW_DB_EXCEPTION(error_message)
4817  } else {
4818  throw std::runtime_error(error_message);
4819  }
4820  }
4821 }
const std::string kInfoSchemaDbName
bool is_info_schema_db(const std::string &db_name)
Definition: DBHandler.cpp:4806
#define THROW_DB_EXCEPTION(errstr)
Definition: DBHandler.cpp:139

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool dbhandler::is_info_schema_db ( const std::string &  db_name)

Definition at line 4806 of file DBHandler.cpp.

References lockmgr::instance(), shared::kInfoSchemaDbName, and shared::kInfoSchemaMigrationName.

Referenced by check_not_info_schema_db().

4806  {
4807  return (db_name == shared::kInfoSchemaDbName &&
4808  SysCatalog::instance().hasExecutedMigration(shared::kInfoSchemaMigrationName));
4809 }
const std::string kInfoSchemaDbName
T & instance()
Definition: LockMgr.cpp:101
const std::string kInfoSchemaMigrationName

+ Here is the call graph for this function:

+ Here is the caller graph for this function: