OmniSciDB  8a228a1076
StringTransform.cpp File Reference
#include "StringTransform.h"
#include "Logger/Logger.h"
#include <numeric>
#include <random>
#include <regex>
#include <boost/filesystem.hpp>
#include <iomanip>
+ Include dependency graph for StringTransform.cpp:

Go to the source code of this file.

Functions

void apply_shim (std::string &result, const boost::regex &reg_expr, const std::function< void(std::string &, const boost::smatch &)> &shim_fn)
 
std::vector< std::pair< size_t, size_t > > find_string_literals (const std::string &query)
 
std::string hide_sensitive_data_from_query (std::string const &query_str)
 
template<>
std::string to_string (char const *&&v)
 
template<>
std::string to_string (std::string &&v)
 
std::string generate_random_string (const size_t len)
 
std::vector< std::string > split (std::string_view str, std::string_view delim, std::optional< size_t > maxsplit)
 split apart a string into a vector of substrings More...
 
std::string strip (std::string_view str)
 trim any whitespace from the left and right ends of a string More...
 
std::optional< size_t > inside_string_literal (const size_t start, const size_t length, const std::vector< std::pair< size_t, size_t >> &literal_positions)
 
bool remove_unquoted_newlines_linefeeds_and_tabs_from_sql_string (std::string &str) noexcept
 sanitize an SQL string More...
 
std::string get_quoted_string (const std::string &filename, char quote, char escape)
 Quote a string while escaping any existing quotes in the string. More...
 

Function Documentation

◆ apply_shim()

void apply_shim ( std::string &  result,
const boost::regex &  reg_expr,
const std::function< void(std::string &, const boost::smatch &)> &  shim_fn 
)

Definition at line 29 of file StringTransform.cpp.

References find_string_literals(), and inside_string_literal().

Referenced by QueryRunner::apply_copy_to_shim(), DBHandler::apply_copy_to_shim(), and anonymous_namespace{CalciteAdapter.cpp}::pg_shim_impl().

31  {
32  boost::smatch what;
33  std::vector<std::pair<size_t, size_t>> lit_pos = find_string_literals(result);
34  auto start_it = result.cbegin();
35  auto end_it = result.cend();
36  while (true) {
37  if (!boost::regex_search(start_it, end_it, what, reg_expr)) {
38  break;
39  }
40  const auto next_start =
41  inside_string_literal(what.position(), what.length(), lit_pos);
42  if (next_start) {
43  start_it = result.cbegin() + *next_start;
44  } else {
45  shim_fn(result, what);
46  lit_pos = find_string_literals(result);
47  start_it = result.cbegin();
48  end_it = result.cend();
49  }
50  }
51 }
std::vector< std::pair< size_t, size_t > > find_string_literals(const std::string &query)
std::optional< size_t > inside_string_literal(const size_t start, const size_t length, const std::vector< std::pair< size_t, size_t >> &literal_positions)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_string_literals()

std::vector<std::pair<size_t, size_t> > find_string_literals ( const std::string &  query)

Definition at line 53 of file StringTransform.cpp.

References CHECK_GT.

Referenced by apply_shim(), and cat().

53  {
54  boost::regex literal_string_regex{R"(([^']+)('(?:[^']+|'')+'))", boost::regex::perl};
55  boost::smatch what;
56  auto it = query.begin();
57  auto prev_it = it;
58  std::vector<std::pair<size_t, size_t>> positions;
59  while (true) {
60  if (!boost::regex_search(it, query.end(), what, literal_string_regex)) {
61  break;
62  }
63  CHECK_GT(what[1].length(), 0);
64  prev_it = it;
65  it += what.length();
66  positions.emplace_back(prev_it + what[1].length() - query.begin(),
67  it - query.begin());
68  }
69  return positions;
70 }
#define CHECK_GT(x, y)
Definition: Logger.h:209
+ Here is the caller graph for this function:

◆ generate_random_string()

std::string generate_random_string ( const size_t  len)

Definition at line 95 of file StringTransform.cpp.

Referenced by DBHandler::create_new_session(), DBHandler::createInMemoryCalciteSession(), Catalog_Namespace::SysCatalog::syncUserWithRemoteProvider(), to_lower(), and Catalog_Namespace::SysCatalog::updateBlankPasswordsToRandom().

95  {
96  static char charset[] =
97  "0123456789"
98  "abcdefghijklmnopqrstuvwxyz"
99  "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
100 
101  static std::mt19937 prng{std::random_device{}()};
102  static std::uniform_int_distribution<size_t> dist(0, strlen(charset) - 1);
103 
104  std::string str;
105  str.reserve(len);
106  for (size_t i = 0; i < len; i++) {
107  str += charset[dist(prng)];
108  }
109  return str;
110 }
+ Here is the caller graph for this function:

◆ get_quoted_string()

std::string get_quoted_string ( const std::string &  filename,
char  quote,
char  escape 
)

Quote a string while escaping any existing quotes in the string.

Definition at line 229 of file StringTransform.cpp.

Referenced by TableArchiver::dumpTable(), TableArchiver::restoreTable(), anonymous_namespace{TableArchiver.cpp}::simple_file_cat(), and to_lower().

229  {
230  std::stringstream ss;
231  ss << std::quoted(filename, quote, escape); // TODO: prevents string_view Jun 2020
232  return ss.str();
233 }
std::string filename(char const *path)
Definition: Logger.cpp:62
+ Here is the caller graph for this function:

◆ hide_sensitive_data_from_query()

std::string hide_sensitive_data_from_query ( std::string const &  query_str)

Definition at line 72 of file StringTransform.cpp.

Referenced by cat(), and query_state::StdLog::log().

72  {
73  constexpr std::regex::flag_type flags =
74  std::regex::ECMAScript | std::regex::icase | std::regex::optimize;
75  static const std::initializer_list<std::pair<std::regex, std::string>> rules{
76  {std::regex(R"(\b((?:password|s3_access_key|s3_secret_key)\s*=\s*)'.+?')", flags),
77  "$1'XXXXXXXX'"},
78  {std::regex(R"((\\set_license\s+)\S+)", flags), "$1XXXXXXXX"}};
79  return std::accumulate(
80  rules.begin(), rules.end(), query_str, [](auto& str, auto& rule) {
81  return std::regex_replace(str, rule.first, rule.second);
82  });
83 }
+ Here is the caller graph for this function:

◆ inside_string_literal()

std::optional<size_t> inside_string_literal ( const size_t  start,
const size_t  length,
const std::vector< std::pair< size_t, size_t >> &  literal_positions 
)

Definition at line 174 of file StringTransform.cpp.

Referenced by apply_shim(), and cat().

177  {
178  const auto end = start + length;
179  for (const auto& literal_position : literal_positions) {
180  if (literal_position.first <= start && end <= literal_position.second) {
181  return literal_position.second;
182  }
183  }
184  return std::nullopt;
185 }
+ Here is the caller graph for this function:

◆ remove_unquoted_newlines_linefeeds_and_tabs_from_sql_string()

bool remove_unquoted_newlines_linefeeds_and_tabs_from_sql_string ( std::string &  str)
noexcept

sanitize an SQL string

Definition at line 189 of file StringTransform.cpp.

Referenced by to_lower().

190  {
191  char inside_quote = 0;
192  bool previous_c_was_backslash = false;
193  for (auto& c : str) {
194  // if this character is a quote of either type
195  if (c == '\'' || c == '\"') {
196  // ignore if previous character was a backslash
197  if (!previous_c_was_backslash) {
198  // start or end of a quoted region
199  if (inside_quote == c) {
200  // end region
201  inside_quote = 0;
202  } else if (inside_quote == 0) {
203  // start region
204  inside_quote = c;
205  }
206  }
207  } else if (inside_quote == 0) {
208  // outside quoted region
209  if (c == '\n' || c == '\t' || c == '\r') {
210  // replace these with space
211  c = ' ';
212  }
213  // otherwise leave alone, including quotes of a different type
214  }
215  // handle backslashes, except for double backslashes
216  if (c == '\\') {
217  previous_c_was_backslash = !previous_c_was_backslash;
218  } else {
219  previous_c_was_backslash = false;
220  }
221  }
222  // if we didn't end a region, there were unclosed or mixed-nested quotes
223  // accounting for backslashes should mean that this should only be the
224  // case with truly malformed strings which Calcite will barf on anyway
225  return (inside_quote == 0);
226 }
+ Here is the caller graph for this function:

◆ split()

std::vector<std::string> split ( std::string_view  str,
std::string_view  delim,
std::optional< size_t >  maxsplit 
)

split apart a string into a vector of substrings

Definition at line 116 of file StringTransform.cpp.

References run_benchmark_import::result.

Referenced by anonymous_namespace{TableArchiver.cpp}::adjust_altered_table_files(), create_table.SyntheticTable::createDataAndImportTable(), anonymous_namespace{DBHandler.cpp}::extract_projection_tokens_for_completion(), get_qualified_column_hints(), AutomaticIRMetadataGuard::makeBaseFilename(), AutomaticIRMetadataGuard::makeQueryEngineFilename(), Data_Namespace::ProcBuddyinfoParser::ProcBuddyinfoParser(), TrackingProcessor::process(), Data_Namespace::ProcMeminfoParser::ProcMeminfoParser(), run_benchmark::read_query_files(), TableArchiver::restoreTable(), QueryRunner::QueryRunner::runMultipleStatements(), anonymous_namespace{NativeCodegen.cpp}::serialize_llvm_metadata_footnotes(), Parser::splitObjectHierName(), and to_lower().

118  {
119  std::vector<std::string> result;
120 
121  // Use an explicit delimiter.
122  if (!delim.empty()) {
123  std::string::size_type i = 0, j = 0;
124  while ((i = str.find(delim, i)) != std::string::npos &&
125  (!maxsplit || result.size() < maxsplit.value())) {
126  result.emplace_back(str, j, i - j);
127  i += delim.size();
128  j = i;
129  }
130  result.emplace_back(str, j, std::string::npos);
131  return result;
132 
133  // Treat any number of consecutive whitespace characters as a delimiter.
134  } else {
135  bool prev_ws = true;
136  std::string::size_type i = 0, j = 0;
137  for (; i < str.size(); ++i) {
138  if (prev_ws) {
139  if (!isspace(str[i])) {
140  // start of word
141  prev_ws = false;
142  j = i;
143  }
144  } else {
145  if (isspace(str[i])) {
146  // start of space
147  result.emplace_back(str, j, i - j);
148  prev_ws = true;
149  j = i;
150  if ((maxsplit && result.size() == maxsplit.value())) {
151  // stop early if maxsplit was reached
152  result.emplace_back(str, j, std::string::npos);
153  return result;
154  }
155  }
156  }
157  }
158  if (!prev_ws) {
159  result.emplace_back(str, j, std::string::npos);
160  }
161  return result;
162  }
163 }
+ Here is the caller graph for this function:

◆ strip()

std::string strip ( std::string_view  str)

trim any whitespace from the left and right ends of a string

Definition at line 165 of file StringTransform.cpp.

Referenced by Data_Namespace::ProcMeminfoParser::ProcMeminfoParser(), QueryRunner::QueryRunner::runMultipleStatements(), DBHandler::sql_execute_impl(), and to_lower().

165  {
166  std::string::size_type i, j;
167  for (i = 0; i < str.size() && std::isspace(str[i]); ++i) {
168  }
169  for (j = str.size(); j > i && std::isspace(str[j - 1]); --j) {
170  }
171  return std::string(str.substr(i, j - i));
172 }
+ Here is the caller graph for this function:

◆ to_string() [1/2]

template<>
std::string to_string ( char const *&&  v)

Definition at line 86 of file StringTransform.cpp.

Referenced by lockmgr::TableSchemaLockContainer< ReadLock >::acquireTableDescriptor(), lockmgr::TableSchemaLockContainer< WriteLock >::acquireTableDescriptor(), import_export::TypedImportBuffer::add_value(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addFrontendViewToMapNoLock(), Catalog_Namespace::Catalog::addLinkToMap(), Catalog_Namespace::Catalog::addReferenceToForeignDict(), CgenState::addStringConstant(), anonymous_namespace{TableArchiver.cpp}::adjust_altered_table_files(), anonymous_namespace{TargetExprBuilder.cpp}::agg_fn_base_names(), Catalog_Namespace::SysCatalog::alterUser(), query_state::StdLog::appendNameValuePairs(), Archive::archive_error(), import_export::DataStreamSink::archivePlumber(), import_export::QueryExporterGDAL::beginExport(), Catalog_Namespace::Catalog::buildMaps(), Catalog_Namespace::SysCatalog::buildObjectDescriptorMap(), ResultSetReductionJIT::cacheKey(), Parser::CaseExpr::CaseExpr(), Executor::castToFP(), Catalog_Namespace::Catalog::changeForeignServerOwner(), foreign_storage::SingleFileReader::checkForMoreRows(), anonymous_namespace{Execute.cpp}::checkWorkUnitWatchdog(), anonymous_namespace{GpuSharedMemoryUtils.cpp}::codegen_smem_dest_slot_ptr(), GroupByAndAggregate::codegenAggColumnPtr(), TargetExprCodegen::codegenAggregate(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), BaselineJoinHashTable::codegenMatchingSet(), GroupByAndAggregate::codegenOutputSlot(), BaselineJoinHashTable::codegenSlot(), CodeGenerator::codgenAdjustFixedEncNull(), CodeGenerator::colByteStream(), Executor::compileBody(), Executor::compileWorkUnit(), BloscCompressor::compress(), geospatial::compress_coords(), OverlapsJoinHashTable::computeBucketSizes(), DBHandler::convert_rows(), DBHandler::convert_target_metainfo(), File_Namespace::create(), DBHandler::create_dashboard(), create_dev_group_by_buffers(), foreign_storage::anonymous_namespace{CsvReaderS3.cpp}::create_request(), DBHandler::create_table(), Catalog_Namespace::Catalog::createDashboard(), Catalog_Namespace::Catalog::createDashboardSystemRoles(), Catalog_Namespace::SysCatalog::createDatabase(), Catalog_Namespace::Catalog::createForeignServerNoLocks(), Catalog_Namespace::Catalog::createLink(), Catalog_Namespace::Catalog::createTable(), RelAlgExecutor::createTableFunctionWorkUnit(), Catalog_Namespace::SysCatalog::createUser(), anonymous_namespace{ArrowImporter.h}::data_conversion_error(), datum_to_string(), DatumToString(), ArrowResultSet::deallocateArrowResultBuffer(), BloscCompressor::decompress(), Catalog_Namespace::Catalog::delDictionary(), Catalog_Namespace::Catalog::deleteMetadataForDashboards(), Catalog_Namespace::SysCatalog::deleteObjectDescriptorMap(), Catalog_Namespace::anonymous_namespace{SysCatalog.cpp}::deleteObjectPrivileges(), DecimalOverflowValidator::do_validate(), Catalog_Namespace::Catalog::dropColumn(), Catalog_Namespace::SysCatalog::dropDatabase(), Catalog_Namespace::Catalog::dropForeignServer(), Catalog_Namespace::Catalog::dropTable(), Catalog_Namespace::SysCatalog::dropUser(), ChunkMetadata::dump(), Catalog_Namespace::Catalog::dumpCreateTable(), Catalog_Namespace::Catalog::dumpSchema(), TableArchiver::dumpTable(), anonymous_namespace{ResultSetReductionJIT.cpp}::emit_write_projection(), FixedLengthEncoder< T, V >::encodeDataAndUpdateStats(), anonymous_namespace{ArrowImporter.h}::error_context(), CudaMgr_Namespace::errorMessage(), Parser::CopyTableStmt::execute(), Catalog_Namespace::Catalog::executeDropTableSqliteQueries(), RelAlgExecutor::executeRelAlgQueryNoRetry(), RelAlgExecutor::executeSimpleInsert(), File_Namespace::FileMgr::FileMgr(), import_export::delimited_parser::find_end(), ProxyTHttpClient::flush(), import_export::anonymous_namespace{GDAL.cpp}::gdal_error_handler(), anonymous_namespace{JoinLoopTest.cpp}::generate_descriptors(), TableFunctionCompilationContext::generateEntryPoint(), Catalog_Namespace::Catalog::generatePhysicalTableName(), Geo_namespace::GeoPoint::GeoPoint(), Parser::SelectEntry::get_alias(), Parser::InExpr::get_arg(), Parser::CardinalityExpr::get_arg(), Parser::FunctionRef::get_arg(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), Parser::CharLengthExpr::get_calc_encoded_length(), Parser::ColumnRef::get_column(), DBHandler::get_dashboard(), DBHandler::get_dashboard_grantees(), DateTimeUtils::get_dateadd_high_precision_adjusted_scale(), DateTimeUtils::get_dateadd_timestamp_precision_scale(), DBHandler::get_db_object_privs(), get_device_parameters(), Parser::LikeExpr::get_escape_string(), Parser::RegexpExpr::get_escape_string(), DateTimeUtils::get_extract_timestamp_precision_scale(), Parser::QuerySpec::get_having_clause(), import_export::Detector::get_headers(), Parser::IsNullExpr::get_is_not(), Parser::LikelihoodExpr::get_likelihood(), DBHandler::get_link_view(), TimeGM::get_overflow_underflow_safe_epoch(), ThriftClientConnection::get_protocol(), Parser::SubqueryExpr::get_query(), Parser::ExistsExpr::get_query(), Parser::TableRef::get_range_var(), Parser::OperExpr::get_right(), HitTestTypes::get_rowid_regex(), Parser::InSubquery::get_subquery(), anonymous_namespace{Execute.cpp}::get_table_name(), DateTimeUtils::get_timestamp_precision_scale(), SQLTypeInfo::get_type_name(), Parser::BetweenExpr::get_upper(), DBHandler::get_valid_groups(), Parser::ArrayLiteral::get_value_list(), Parser::InValues::get_value_list(), getArrowImportType(), Fragmenter_Namespace::InsertOrderFragmenter::getChunkMetadata(), Parser::LocalConnector::getColumnDescriptors(), getCurrentStackTrace(), CudaMgr_Namespace::CudaMgr::getDeviceProperties(), RelAlgExecutor::getErrorMessageFromCode(), Catalog_Namespace::Catalog::getForeignServersForUser(), Catalog_Namespace::SysCatalog::getGranteesOfSharedDashboards(), Catalog_Namespace::Catalog::getMetadataForDashboard(), Catalog_Namespace::SysCatalog::getMetadataForDBById(), Catalog_Namespace::SysCatalog::getMetadataForObject(), Catalog_Namespace::SysCatalog::getMetadataForUserById(), Catalog_Namespace::SysCatalog::getMetadataWithDefaultDB(), Catalog_Namespace::SysCatalog::getRoles(), DBHandler::has_object_privilege(), DBHandler::import_geo_table(), import_export::import_thread_delimited(), import_export::import_thread_shapefile(), File_Namespace::FileMgr::init(), S3Archive::init_for_read(), anonymous_namespace{JoinHashTableInterface.cpp}::innerToString(), Catalog_Namespace::anonymous_namespace{SysCatalog.cpp}::insertOrUpdateObjectPrivileges(), Executor::interrupt(), ResultSet::isGeoColOnGpu(), TableFunctionExecutionContext::launchCpuCode(), QueryExecutionContext::launchCpuCode(), QueryExecutionContext::launchGpuCode(), DBHandler::load_table(), DBObject::loadKey(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), migrations::MigrationMgr::migrateDateInDaysMetadata(), Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges(), numeric_type_name(), import_export::ogr_to_type(), Geo_namespace::GeoTypesError::OGRErrorToStr(), File_Namespace::open(), anonymous_namespace{ArrowImporter.h}::ArrowValue< float >::operator const std::string(), anonymous_namespace{ArrowImporter.h}::ArrowValue< double >::operator const std::string(), anonymous_namespace{ArrowImporter.h}::ArrowValue< int64_t >::operator const std::string(), logger::JsonEncoder::operator()(), operator<<(), OutOfMemory::parse_error_str(), parse_numeric(), import_export::delimited_parser::parse_string_array(), DBHandler::prepare_columnar_loader(), foreign_storage::csv_file_buffer_parser::process_geo_column(), anonymous_namespace{geo_types.cpp}::process_poly_ring(), DictionaryValueConverter< TARGET_TYPE >::processBuffer(), query_template_impl(), ra_exec_unit_desc_for_caching(), foreign_storage::SingleFileReader::readRegion(), Catalog_Namespace::Catalog::recordOwnershipOfObjectsInObjectPermissions(), ResultSetReductionJIT::reduceOneEntryBaseline(), ResultSetReductionJIT::reduceOneEntryTargetsNoCollisions(), QueryMemoryDescriptor::reductionKey(), Executor::registerActiveModule(), BaselineJoinHashTable::reifyForDevice(), AutomaticIRMetadataGuard::rememberOurInstructions(), Catalog_Namespace::Catalog::renameColumn(), Catalog_Namespace::SysCatalog::renameDatabase(), File_Namespace::renameForDelete(), Catalog_Namespace::SysCatalog::renameObjectsInDescriptorMap(), Catalog_Namespace::Catalog::renamePhysicalTable(), Catalog_Namespace::Catalog::replaceDashboard(), TableArchiver::restoreTable(), ArrowResultSet::resultSetArrowLoopback(), Catalog_Namespace::SysCatalog::revokeAllOnDatabase_unsafe(), QueryRewriter::rewriteColumnarUpdate(), anonymous_namespace{TableArchiver.cpp}::run(), ExecutionKernel::runImpl(), import_export::QueryExporter::safeColumnName(), import_export::RenderGroupAnalyzer::seedFromExistingTableContents(), serialize_column_ref(), serialize_table_ref(), anonymous_namespace{NativeCodegen.cpp}::set_row_func_argnames(), Catalog_Namespace::Catalog::setColumnDictionary(), Catalog_Namespace::Catalog::setColumnSharedDictionary(), Catalog_Namespace::Catalog::setForeignServerProperty(), Executor::skipFragment(), start_calcite_server_as_daemon(), query_state::StdLogData::StdLogData(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), DBHandler::thrift_to_copyparams(), logger::JsonEncoder::timer(), Parser::InSubquery::to_string(), Parser::InValues::to_string(), RexAbstractInput::toString(), ColSlotContext::toString(), JoinHashTableInterface::toString(), DBObject::toString(), Analyzer::ColumnVar::toString(), RexOperator::toString(), Analyzer::Var::toString(), RexSubQuery::toString(), QueryMemoryDescriptor::toString(), RexInput::toString(), Analyzer::UOper::toString(), SortField::toString(), RexRef::toString(), RexAgg::toString(), Analyzer::InIntegerSet::toString(), RelScan::toString(), RelProject::toString(), Analyzer::LikelihoodExpr::toString(), RelAggregate::toString(), RelJoin::toString(), Analyzer::ExtractExpr::toString(), RelFilter::toString(), RelLeftDeepInnerJoin::toString(), Analyzer::DateaddExpr::toString(), Analyzer::DatediffExpr::toString(), RelCompound::toString(), Analyzer::DatetruncExpr::toString(), Analyzer::OrderEntry::toString(), RelSort::toString(), RelModify::toString(), RelTableFunction::toString(), RelLogicalValues::toString(), anonymous_namespace{JoinHashTableInterface.cpp}::toStringFlat(), RelAlgTranslator::translateArrayFunction(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateHPTLiteral(), Executor::unregisterActiveModule(), Catalog_Namespace::SysCatalog::updateBlankPasswordsToRandom(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Catalog_Namespace::Catalog::updateDeletedColumnIndicator(), Catalog_Namespace::Catalog::updateDictionaryNames(), Catalog_Namespace::Catalog::updateFixlenArrayColumns(), Catalog_Namespace::Catalog::updateGeoColumns(), Catalog_Namespace::Catalog::updateLogicalToPhysicalTableMap(), Catalog_Namespace::SysCatalog::updateObjectDescriptorMap(), Catalog_Namespace::Catalog::updatePageSize(), Catalog_Namespace::SysCatalog::updateSupportUserDeactivation(), Catalog_Namespace::Catalog::updateTableDescriptorSchema(), DateDaysOverflowValidator::validate(), CommandLineOptions::validate(), foreign_storage::anonymous_namespace{LazyParquetImporter.cpp}::validate_parquet_metadata(), foreign_storage::ParquetDataWrapper::validateAndGetStringWithLength(), foreign_storage::CsvDataWrapper::validateAndGetStringWithLength(), and ScalarExprToSql::visitUOper().

86  {
87  return std::string(v);
88 }

◆ to_string() [2/2]

template<>
std::string to_string ( std::string &&  v)

Definition at line 91 of file StringTransform.cpp.

91  {
92  return std::move(v);
93 }