mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
dbms: improvement [#METR-13153].
This commit is contained in:
parent
0d4390c176
commit
a76db2ba78
@ -211,7 +211,7 @@ inline bool likePatternIsStrstr(const String & pattern, String & res)
|
||||
{
|
||||
res = "";
|
||||
|
||||
if (pattern.size() < 2 || *pattern.begin() != '%' || *pattern.rbegin() != '%')
|
||||
if (pattern.size() < 2 || pattern.front() != '%' || pattern.back() != '%')
|
||||
return false;
|
||||
|
||||
res.reserve(pattern.size() * 2);
|
||||
|
@ -249,7 +249,7 @@ static size_t checkColumn(const String & path, const String & name, DataTypePtr
|
||||
void MergeTreePartChecker::checkDataPart(String path, const Settings & settings, const DataTypeFactory & data_type_factory,
|
||||
MergeTreeData::DataPart::Checksums * out_checksums)
|
||||
{
|
||||
if (!path.empty() && *path.rbegin() != '/')
|
||||
if (!path.empty() && path.back() != '/')
|
||||
path += "/";
|
||||
|
||||
NamesAndTypesList columns;
|
||||
|
@ -66,8 +66,8 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree(
|
||||
log(&Logger::get(database_name_ + "." + table_name + " (StorageReplicatedMergeTree)")),
|
||||
shutdown_event(false)
|
||||
{
|
||||
if (!zookeeper_path.empty() && *zookeeper_path.rbegin() == '/')
|
||||
zookeeper_path.erase(zookeeper_path.end() - 1);
|
||||
if (!zookeeper_path.empty() && zookeeper_path.back() == '/')
|
||||
zookeeper_path.resize(zookeeper_path.size() - 1);
|
||||
replica_path = zookeeper_path + "/replicas/" + replica_name;
|
||||
|
||||
bool skip_sanity_checks = false;
|
||||
@ -2837,8 +2837,8 @@ void StorageReplicatedMergeTree::getStatus(Status & res, bool with_zk_fields)
|
||||
void StorageReplicatedMergeTree::fetchPartition(const Field & partition, bool unreplicated, const String & from_)
|
||||
{
|
||||
String from = from_;
|
||||
if (*from.rbegin() == '/')
|
||||
from.erase(from.end() - 1);
|
||||
if (from.back() == '/')
|
||||
from.resize(from.size() - 1);
|
||||
|
||||
if (unreplicated)
|
||||
throw Exception("Not implemented", ErrorCodes::NOT_IMPLEMENTED); /// TODO
|
||||
|
Loading…
Reference in New Issue
Block a user