OmniSciDB  2e3a973ef4
DBHandler.cpp File Reference
#include "DBHandler.h"
#include "DistributedLoader.h"
#include "MapDServer.h"
#include "QueryEngine/UDFCompiler.h"
#include "TokenCompletionHints.h"
#include "MapDRelease.h"
#include "Calcite/Calcite.h"
#include "gen-cpp/CalciteServer.h"
#include "QueryEngine/RelAlgExecutor.h"
#include "Catalog/Catalog.h"
#include "Catalog/DdlCommandExecutor.h"
#include "DataMgr/ForeignStorage/ArrowCsvForeignStorage.h"
#include "DataMgr/ForeignStorage/DummyForeignStorage.h"
#include "DataMgr/ForeignStorage/ForeignStorageInterface.h"
#include "DistributedHandler.h"
#include "Fragmenter/InsertOrderFragmenter.h"
#include "Geospatial/Transforms.h"
#include "Geospatial/Types.h"
#include "ImportExport/GDAL.h"
#include "ImportExport/Importer.h"
#include "LockMgr/LockMgr.h"
#include "OSDependent/omnisci_hostname.h"
#include "Parser/ParserWrapper.h"
#include "Parser/ReservedKeywords.h"
#include "Parser/parser.h"
#include "QueryEngine/ArrowResultSet.h"
#include "QueryEngine/CalciteAdapter.h"
#include "QueryEngine/Execute.h"
#include "QueryEngine/ExtensionFunctionsWhitelist.h"
#include "QueryEngine/GpuMemUtils.h"
#include "QueryEngine/JoinFilterPushDown.h"
#include "QueryEngine/JsonAccessors.h"
#include "QueryEngine/QueryDispatchQueue.h"
#include "QueryEngine/TableFunctions/TableFunctionsFactory.h"
#include "QueryEngine/TableOptimizer.h"
#include "QueryEngine/ThriftSerializers.h"
#include "Shared/StringTransform.h"
#include "Shared/import_helpers.h"
#include "Shared/mapd_shared_mutex.h"
#include "Shared/measure.h"
#include "Shared/scope.h"
#include <fcntl.h>
#include <picosha2.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <boost/make_shared.hpp>
#include <boost/process/search_path.hpp>
#include <boost/program_options.hpp>
#include <boost/regex.hpp>
#include <boost/tokenizer.hpp>
#include <cmath>
#include <csignal>
#include <fstream>
#include <future>
#include <map>
#include <memory>
#include <random>
#include <regex>
#include <string>
#include <thread>
#include <typeinfo>
#include <arrow/api.h>
#include <arrow/io/api.h>
#include <arrow/ipc/api.h>
#include "Shared/ArrowUtil.h"

Go to the source code of this file.

Classes

struct  anonymous_namespace{DBHandler.cpp}::ForceDisconnect
 
struct  anonymous_namespace{DBHandler.cpp}::ProjectionTokensForCompletion
 

Namespaces

 anonymous_namespace{DBHandler.cpp}
 

Macros

#define ENABLE_GEO_IMPORT_COLUMN_MATCHING   0
 
#define INVALID_SESSION_ID   ""
 
#define THROW_MAPD_EXCEPTION(errstr)
 
#define ARROW_THRIFT_THROW_NOT_OK(s)
 
#define THROW_COLUMN_ATTR_MISMATCH_EXCEPTION(attr, got, expected)
 
#define EXPOSE_THRIFT_MAP(TYPENAME)
 

Typedefs

using RecordBatchVector = std::vector< std::shared_ptr< arrow::RecordBatch > >
 

Functions

SessionMap::iterator anonymous_namespace{DBHandler.cpp}::get_session_from_map (const TSessionId &session, SessionMap &session_map)
 
ProjectionTokensForCompletion anonymous_namespace{DBHandler.cpp}::extract_projection_tokens_for_completion (const std::string &sql)
 
static TDBObject serialize_db_object (const std::string &roleName, const DBObject &inObject)
 
std::string anonymous_namespace{DBHandler.cpp}::dump_table_col_names (const std::map< std::string, std::vector< std::string >> &table_col_names)
 
void anonymous_namespace{DBHandler.cpp}::fixup_geo_column_descriptor (TColumnType &col_type, const SQLTypes subtype, const int output_srid)
 
void anonymous_namespace{DBHandler.cpp}::check_table_not_sharded (const TableDescriptor *td)
 
RecordBatchVector anonymous_namespace{DBHandler.cpp}::loadArrowStream (const std::string &stream)
 
void anonymous_namespace{DBHandler.cpp}::add_vsi_network_prefix (std::string &path)
 
void anonymous_namespace{DBHandler.cpp}::add_vsi_geo_prefix (std::string &path)
 
void anonymous_namespace{DBHandler.cpp}::add_vsi_archive_prefix (std::string &path)
 
std::string anonymous_namespace{DBHandler.cpp}::remove_vsi_prefixes (const std::string &path_in)
 
bool anonymous_namespace{DBHandler.cpp}::path_is_relative (const std::string &path)
 
bool anonymous_namespace{DBHandler.cpp}::path_has_valid_filename (const std::string &path)
 
bool anonymous_namespace{DBHandler.cpp}::is_a_supported_geo_file (const std::string &path, bool include_gz)
 
bool anonymous_namespace{DBHandler.cpp}::is_a_supported_archive_file (const std::string &path)
 
std::string anonymous_namespace{DBHandler.cpp}::find_first_geo_file_in_archive (const std::string &archive_path, const import_export::CopyParams &copy_params)
 
bool anonymous_namespace{DBHandler.cpp}::is_local_file (const std::string &file_path)
 
void anonymous_namespace{DBHandler.cpp}::validate_import_file_path_if_local (const std::string &file_path)
 
static bool is_allowed_on_dashboard (const Catalog_Namespace::SessionInfo &session_info, int32_t dashboard_id, AccessPrivileges requestedPermissions)
 
bool anonymous_namespace{DBHandler.cpp}::TTypeInfo_IsGeo (const TDatumType::type &t)
 
std::map< std::string, std::string > get_device_parameters (bool cpu_only)
 
ExtArgumentType mapfrom (const TExtArgumentType::type &t)
 
table_functions::OutputBufferSizeType mapfrom (const TOutputBufferSizeType::type &t)
 
std::vector< ExtArgumentTypemapfrom (const std::vector< TExtArgumentType::type > &v)
 

Macro Definition Documentation

◆ ARROW_THRIFT_THROW_NOT_OK

#define ARROW_THRIFT_THROW_NOT_OK (   s)
Value:
do { \
::arrow::Status _s = (s); \
if (UNLIKELY(!_s.ok())) { \
TOmniSciException ex; \
ex.error_msg = _s.ToString(); \
LOG(ERROR) << s.ToString(); \
throw ex; \
} \
} while (0)
#define UNLIKELY(x)
Definition: likely.h:25

Definition at line 2574 of file DBHandler.cpp.

Referenced by anonymous_namespace{DBHandler.cpp}::loadArrowStream().

◆ ENABLE_GEO_IMPORT_COLUMN_MATCHING

#define ENABLE_GEO_IMPORT_COLUMN_MATCHING   0

Definition at line 106 of file DBHandler.cpp.

◆ EXPOSE_THRIFT_MAP

#define EXPOSE_THRIFT_MAP (   TYPENAME)
Value:
{ \
std::map<int, const char*>::const_iterator it = \
_##TYPENAME##_VALUES_TO_NAMES.begin(); \
while (it != _##TYPENAME##_VALUES_TO_NAMES.end()) { \
_return.insert(std::pair<std::string, std::string>( \
#TYPENAME "." + std::string(it->second), std::to_string(it->first))); \
it++; \
} \
}
std::string to_string(char const *&&v)

Definition at line 5947 of file DBHandler.cpp.

Referenced by DBHandler::get_device_parameters().

◆ INVALID_SESSION_ID

#define INVALID_SESSION_ID   ""

Definition at line 111 of file DBHandler.cpp.

Referenced by DBHandler::getInvalidSessionId().

◆ THROW_COLUMN_ATTR_MISMATCH_EXCEPTION

#define THROW_COLUMN_ATTR_MISMATCH_EXCEPTION (   attr,
  got,
  expected 
)
Value:
THROW_MAPD_EXCEPTION("Could not append geo file '" + file_path.filename().string() + \
"' to table '" + table_name + "'. Column '" + cd->columnName + \
"' " + attr + " mismatch (got '" + got + "', expected '" + \
expected + "')");
#define THROW_MAPD_EXCEPTION(errstr)
Definition: DBHandler.cpp:113

Definition at line 3945 of file DBHandler.cpp.

Referenced by DBHandler::import_geo_table().

◆ THROW_MAPD_EXCEPTION

#define THROW_MAPD_EXCEPTION (   errstr)
Value:
{ \
TOmniSciException ex; \
ex.error_msg = errstr; \
LOG(ERROR) << ex.error_msg; \
throw ex; \
}

Definition at line 113 of file DBHandler.cpp.

Referenced by anonymous_namespace{DBHandler.cpp}::add_vsi_network_prefix(), DBHandler::broadcast_serialized_rows(), DBHandler::check_read_only(), DBHandler::check_table_consistency(), DBHandler::check_table_load_privileges(), DBHandler::clear_cpu_memory(), DBHandler::clear_gpu_memory(), DBHandler::clone_session(), DBHandler::connect(), DBHandler::convert_rows(), DBHandler::create_dashboard(), DBHandler::create_link(), DBHandler::create_table(), DBHandler::delete_dashboards(), DBHandler::detect_column_types(), DBHandler::execute_next_render_step(), DBHandler::execute_query_step(), DBHandler::get_all_files_in_archive(), DBHandler::get_all_roles_for_user(), DBHandler::get_dashboard(), DBHandler::get_dashboard_grantees(), DBHandler::get_db_object_privs(), DBHandler::get_db_objects_for_grantee(), DBHandler::get_first_geo_file_in_archive(), DBHandler::get_heap_profile(), DBHandler::get_layers_in_geo_file(), DBHandler::get_link_view(), DBHandler::get_result_row_for_pixel(), anonymous_namespace{DBHandler.cpp}::get_session_from_map(), DBHandler::get_session_it_unsafe(), DBHandler::get_table_details_impl(), DBHandler::get_tables_meta(), DBHandler::get_tables_meta_impl(), DBHandler::get_valid_groups(), DBHandler::has_dashboard_permission(), DBHandler::has_database_permission(), DBHandler::has_object_privilege(), DBHandler::has_role(), DBHandler::has_table_permission(), DBHandler::has_view_permission(), DBHandler::import_geo_table(), DBHandler::import_table(), DBHandler::insert_data(), DBHandler::internal_connect(), DBHandler::krb5_connect(), DBHandler::load_table(), DBHandler::load_table_binary(), DBHandler::load_table_binary_arrow(), DBHandler::load_table_binary_columnar(), DBHandler::populateThriftColumnType(), DBHandler::query_get_outer_fragment_count(), DBHandler::register_runtime_extension_functions(), DBHandler::render_vega(), DBHandler::replace_dashboard(), DBHandler::set_license_key(), DBHandler::set_table_epochs(), DBHandler::shareOrUnshareDashboards(), DBHandler::sql_execute(), DBHandler::sql_execute_df(), DBHandler::sql_validate(), DBHandler::start_heap_profile(), DBHandler::start_query(), DBHandler::start_render_query(), DBHandler::stop_heap_profile(), DBHandler::switch_database(), DBHandler::thrift_to_copyparams(), DBHandler::validateDashboardIdsForSharing(), and DBHandler::validateGroups().

Typedef Documentation

◆ RecordBatchVector

using RecordBatchVector = std::vector<std::shared_ptr<arrow::RecordBatch> >

Definition at line 2572 of file DBHandler.cpp.

Function Documentation

◆ get_device_parameters()

std::map<std::string, std::string> get_device_parameters ( bool  cpu_only)

Definition at line 708 of file NativeCodegen.cpp.

References checkCudaErrors(), cpu_threads(), get_gpu_data_layout(), get_gpu_target_triple_string(), run_benchmark_import::result, and to_string().

Referenced by DBHandler::max_bytes_for_thrift().

708  {
709  std::map<std::string, std::string> result;
710 
711  result.insert(std::make_pair("cpu_name", llvm::sys::getHostCPUName()));
712  result.insert(std::make_pair("cpu_triple", llvm::sys::getProcessTriple()));
713  result.insert(
714  std::make_pair("cpu_cores", std::to_string(llvm::sys::getHostNumPhysicalCores())));
715  result.insert(std::make_pair("cpu_threads", std::to_string(cpu_threads())));
716 
717  llvm::StringMap<bool> cpu_features;
718  if (llvm::sys::getHostCPUFeatures(cpu_features)) {
719  std::string features_str = "";
720  for (auto it = cpu_features.begin(); it != cpu_features.end(); ++it) {
721  features_str += (it->getValue() ? " +" : " -");
722  features_str += it->getKey().str();
723  }
724  result.insert(std::make_pair("cpu_features", features_str));
725  }
726 
727 #ifdef HAVE_CUDA
728  if (!cpu_only) {
729  int device_count = 0;
730  checkCudaErrors(cuDeviceGetCount(&device_count));
731  if (device_count) {
732  CUdevice device{};
733  char device_name[256];
734  int major = 0, minor = 0;
735  checkCudaErrors(cuDeviceGet(&device, 0)); // assuming homogeneous multi-GPU system
736  checkCudaErrors(cuDeviceGetName(device_name, 256, device));
737  checkCudaErrors(cuDeviceGetAttribute(
738  &major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device));
739  checkCudaErrors(cuDeviceGetAttribute(
740  &minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device));
741 
742  result.insert(std::make_pair("gpu_name", device_name));
743  result.insert(std::make_pair("gpu_count", std::to_string(device_count)));
744  result.insert(std::make_pair("gpu_compute_capability",
745  std::to_string(major) + "." + std::to_string(minor)));
746  result.insert(std::make_pair("gpu_triple", get_gpu_target_triple_string()));
747  result.insert(std::make_pair("gpu_datalayout", get_gpu_data_layout()));
748  }
749  }
750 #endif
751 
752  return result;
753 }
void checkCudaErrors(CUresult err)
Definition: sample.cpp:38
llvm::StringRef get_gpu_data_layout()
std::string to_string(char const *&&v)
llvm::StringRef get_gpu_target_triple_string()
int CUdevice
Definition: nocuda.h:20
int cpu_threads()
Definition: thread_count.h:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_allowed_on_dashboard()

static bool is_allowed_on_dashboard ( const Catalog_Namespace::SessionInfo session_info,
int32_t  dashboard_id,
AccessPrivileges  requestedPermissions 
)
static

Definition at line 3332 of file DBHandler.cpp.

References DashboardDBObjectType, Catalog_Namespace::SessionInfo::get_currentUser(), and Catalog_Namespace::SessionInfo::getCatalog().

Referenced by DBHandler::get_dashboard(), DBHandler::get_dashboards(), and DBHandler::replace_dashboard().

3334  {
3335  DBObject object(dashboard_id, DashboardDBObjectType);
3336  auto& catalog = session_info.getCatalog();
3337  auto& user = session_info.get_currentUser();
3338  object.loadKey(catalog);
3339  object.setPrivileges(requestedPermissions);
3340  std::vector<DBObject> privs = {object};
3341  return SysCatalog::instance().checkPrivileges(user, privs);
3342 }
const UserMetadata & get_currentUser() const
Definition: SessionInfo.h:68
Catalog & getCatalog() const
Definition: SessionInfo.h:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapfrom() [1/3]

ExtArgumentType mapfrom ( const TExtArgumentType::type &  t)

Definition at line 5972 of file DBHandler.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, Cursor, Double, Float, GeoLineString, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, UNREACHABLE, and Void.

Referenced by mapfrom(), and DBHandler::register_runtime_extension_functions().

5972  {
5973  switch (t) {
5974  case TExtArgumentType::Int8:
5975  return ExtArgumentType::Int8;
5976  case TExtArgumentType::Int16:
5977  return ExtArgumentType::Int16;
5978  case TExtArgumentType::Int32:
5979  return ExtArgumentType::Int32;
5980  case TExtArgumentType::Int64:
5981  return ExtArgumentType::Int64;
5982  case TExtArgumentType::Float:
5983  return ExtArgumentType::Float;
5985  return ExtArgumentType::Double;
5986  case TExtArgumentType::Void:
5987  return ExtArgumentType::Void;
5988  case TExtArgumentType::PInt8:
5989  return ExtArgumentType::PInt8;
5990  case TExtArgumentType::PInt16:
5991  return ExtArgumentType::PInt16;
5992  case TExtArgumentType::PInt32:
5993  return ExtArgumentType::PInt32;
5994  case TExtArgumentType::PInt64:
5995  return ExtArgumentType::PInt64;
5996  case TExtArgumentType::PFloat:
5997  return ExtArgumentType::PFloat;
5998  case TExtArgumentType::PDouble:
5999  return ExtArgumentType::PDouble;
6000  case TExtArgumentType::PBool:
6001  return ExtArgumentType::PBool;
6002  case TExtArgumentType::Bool:
6003  return ExtArgumentType::Bool;
6004  case TExtArgumentType::ArrayInt8:
6006  case TExtArgumentType::ArrayInt16:
6008  case TExtArgumentType::ArrayInt32:
6010  case TExtArgumentType::ArrayInt64:
6012  case TExtArgumentType::ArrayFloat:
6014  case TExtArgumentType::ArrayDouble:
6016  case TExtArgumentType::ArrayBool:
6018  case TExtArgumentType::GeoPoint:
6020  case TExtArgumentType::GeoLineString:
6022  case TExtArgumentType::Cursor:
6023  return ExtArgumentType::Cursor;
6024  case TExtArgumentType::GeoPolygon:
6026  case TExtArgumentType::GeoMultiPolygon:
6028  case TExtArgumentType::ColumnInt8:
6030  case TExtArgumentType::ColumnInt16:
6032  case TExtArgumentType::ColumnInt32:
6034  case TExtArgumentType::ColumnInt64:
6036  case TExtArgumentType::ColumnFloat:
6038  case TExtArgumentType::ColumnDouble:
6040  case TExtArgumentType::ColumnBool:
6042  }
6043  UNREACHABLE();
6044  return ExtArgumentType{};
6045 }
#define UNREACHABLE()
Definition: Logger.h:241
+ Here is the caller graph for this function:

◆ mapfrom() [2/3]

table_functions::OutputBufferSizeType mapfrom ( const TOutputBufferSizeType::type &  t)

◆ mapfrom() [3/3]

std::vector<ExtArgumentType> mapfrom ( const std::vector< TExtArgumentType::type > &  v)

Definition at line 6060 of file DBHandler.cpp.

References mapfrom(), run_benchmark_import::result, and run_benchmark_import::type.

6060  {
6061  std::vector<ExtArgumentType> result;
6062  std::transform(v.begin(),
6063  v.end(),
6064  std::back_inserter(result),
6065  [](TExtArgumentType::type c) -> ExtArgumentType { return mapfrom(c); });
6066  return result;
6067 }
ExtArgumentType mapfrom(const TExtArgumentType::type &t)
Definition: DBHandler.cpp:5972
+ Here is the call graph for this function:

◆ serialize_db_object()

static TDBObject serialize_db_object ( const std::string &  roleName,
const DBObject inObject 
)
static

Definition at line 1499 of file DBHandler.cpp.

References DatabasePrivileges::ACCESS, TablePrivileges::ALTER_TABLE, CHECK, DashboardPrivileges::CREATE_DASHBOARD, DatabasePrivileges::CREATE_DATABASE, TablePrivileges::CREATE_TABLE, ViewPrivileges::CREATE_VIEW, DashboardDBObjectType, DatabaseDBObjectType, DashboardPrivileges::DELETE_DASHBOARD, TablePrivileges::DELETE_FROM_TABLE, ViewPrivileges::DELETE_FROM_VIEW, DatabasePrivileges::DROP_DATABASE, TablePrivileges::DROP_TABLE, ViewPrivileges::DROP_VIEW, DashboardPrivileges::EDIT_DASHBOARD, DBObject::getName(), DBObject::getObjectKey(), DBObject::getPrivileges(), DBObject::getType(), TablePrivileges::INSERT_INTO_TABLE, ViewPrivileges::INSERT_INTO_VIEW, DBObjectKey::permissionType, TablePrivileges::SELECT_FROM_TABLE, ViewPrivileges::SELECT_FROM_VIEW, TableDBObjectType, TablePrivileges::TRUNCATE_TABLE, run_benchmark_import::type, TablePrivileges::UPDATE_IN_TABLE, ViewPrivileges::UPDATE_IN_VIEW, DashboardPrivileges::VIEW_DASHBOARD, DatabasePrivileges::VIEW_SQL_EDITOR, and ViewDBObjectType.

Referenced by DBHandler::get_db_object_privs(), and DBHandler::get_db_objects_for_grantee().

1500  {
1501  TDBObject outObject;
1502  outObject.objectName = inObject.getName();
1503  outObject.grantee = roleName;
1504  const auto ap = inObject.getPrivileges();
1505  switch (inObject.getObjectKey().permissionType) {
1506  case DatabaseDBObjectType:
1507  outObject.privilegeObjectType = TDBObjectType::DatabaseDBObjectType;
1508  outObject.privs.push_back(ap.hasPermission(DatabasePrivileges::CREATE_DATABASE));
1509  outObject.privs.push_back(ap.hasPermission(DatabasePrivileges::DROP_DATABASE));
1510  outObject.privs.push_back(ap.hasPermission(DatabasePrivileges::VIEW_SQL_EDITOR));
1511  outObject.privs.push_back(ap.hasPermission(DatabasePrivileges::ACCESS));
1512 
1513  break;
1514  case TableDBObjectType:
1515  outObject.privilegeObjectType = TDBObjectType::TableDBObjectType;
1516  outObject.privs.push_back(ap.hasPermission(TablePrivileges::CREATE_TABLE));
1517  outObject.privs.push_back(ap.hasPermission(TablePrivileges::DROP_TABLE));
1518  outObject.privs.push_back(ap.hasPermission(TablePrivileges::SELECT_FROM_TABLE));
1519  outObject.privs.push_back(ap.hasPermission(TablePrivileges::INSERT_INTO_TABLE));
1520  outObject.privs.push_back(ap.hasPermission(TablePrivileges::UPDATE_IN_TABLE));
1521  outObject.privs.push_back(ap.hasPermission(TablePrivileges::DELETE_FROM_TABLE));
1522  outObject.privs.push_back(ap.hasPermission(TablePrivileges::TRUNCATE_TABLE));
1523  outObject.privs.push_back(ap.hasPermission(TablePrivileges::ALTER_TABLE));
1524 
1525  break;
1526  case DashboardDBObjectType:
1527  outObject.privilegeObjectType = TDBObjectType::DashboardDBObjectType;
1528  outObject.privs.push_back(ap.hasPermission(DashboardPrivileges::CREATE_DASHBOARD));
1529  outObject.privs.push_back(ap.hasPermission(DashboardPrivileges::DELETE_DASHBOARD));
1530  outObject.privs.push_back(ap.hasPermission(DashboardPrivileges::VIEW_DASHBOARD));
1531  outObject.privs.push_back(ap.hasPermission(DashboardPrivileges::EDIT_DASHBOARD));
1532 
1533  break;
1534  case ViewDBObjectType:
1535  outObject.privilegeObjectType = TDBObjectType::ViewDBObjectType;
1536  outObject.privs.push_back(ap.hasPermission(ViewPrivileges::CREATE_VIEW));
1537  outObject.privs.push_back(ap.hasPermission(ViewPrivileges::DROP_VIEW));
1538  outObject.privs.push_back(ap.hasPermission(ViewPrivileges::SELECT_FROM_VIEW));
1539  outObject.privs.push_back(ap.hasPermission(ViewPrivileges::INSERT_INTO_VIEW));
1540  outObject.privs.push_back(ap.hasPermission(ViewPrivileges::UPDATE_IN_VIEW));
1541  outObject.privs.push_back(ap.hasPermission(ViewPrivileges::DELETE_FROM_VIEW));
1542 
1543  break;
1544  default:
1545  CHECK(false);
1546  }
1547  const int type_val = static_cast<int>(inObject.getType());
1548  CHECK(type_val >= 0 && type_val < 5);
1549  outObject.objectType = static_cast<TDBObjectType::type>(type_val);
1550  return outObject;
1551 }
static const int32_t DROP_VIEW
Definition: DBObject.h:115
static const int32_t SELECT_FROM_VIEW
Definition: DBObject.h:116
static const int32_t UPDATE_IN_VIEW
Definition: DBObject.h:118
static const int32_t CREATE_VIEW
Definition: DBObject.h:114
static const int32_t ALTER_TABLE
Definition: DBObject.h:95
DBObjectType getType() const
Definition: DBObject.h:210
DBObjectKey getObjectKey() const
Definition: DBObject.h:211
std::string getName() const
Definition: DBObject.h:209
static const int32_t DROP_DATABASE
Definition: DBObject.h:81
static const int32_t DELETE_FROM_TABLE
Definition: DBObject.h:93
static const int32_t TRUNCATE_TABLE
Definition: DBObject.h:94
static const int32_t EDIT_DASHBOARD
Definition: DBObject.h:106
static const int32_t DELETE_DASHBOARD
Definition: DBObject.h:104
static const int32_t INSERT_INTO_TABLE
Definition: DBObject.h:91
const AccessPrivileges & getPrivileges() const
Definition: DBObject.h:216
static const int32_t ACCESS
Definition: DBObject.h:83
static const int32_t CREATE_DATABASE
Definition: DBObject.h:80
static const int32_t VIEW_DASHBOARD
Definition: DBObject.h:105
static const int32_t VIEW_SQL_EDITOR
Definition: DBObject.h:82
static const int32_t DROP_TABLE
Definition: DBObject.h:89
static const int32_t INSERT_INTO_VIEW
Definition: DBObject.h:117
#define CHECK(condition)
Definition: Logger.h:197
static const int32_t DELETE_FROM_VIEW
Definition: DBObject.h:119
static const int32_t CREATE_TABLE
Definition: DBObject.h:88
static const int32_t CREATE_DASHBOARD
Definition: DBObject.h:103
int32_t permissionType
Definition: DBObject.h:55
static const int32_t SELECT_FROM_TABLE
Definition: DBObject.h:90
static const int32_t UPDATE_IN_TABLE
Definition: DBObject.h:92
+ Here is the call graph for this function:
+ Here is the caller graph for this function: