Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure style of ErrorCodes by style check. #9370

Merged
merged 12 commits into from
Feb 26, 2020
  •  
  •  
  •  
1 change: 1 addition & 0 deletions dbms/programs/benchmark/Benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ using Ports = std::vector<UInt16>;

namespace ErrorCodes
{
extern const int CANNOT_BLOCK_SIGNAL;
extern const int BAD_ARGUMENTS;
extern const int EMPTY_DATA_PASSED;
}
Expand Down
4 changes: 0 additions & 4 deletions dbms/programs/client/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,9 @@ namespace ErrorCodes
extern const int NETWORK_ERROR;
extern const int NO_DATA_TO_INSERT;
extern const int BAD_ARGUMENTS;
extern const int CANNOT_READ_HISTORY;
extern const int CANNOT_APPEND_HISTORY;
extern const int UNKNOWN_PACKET_FROM_SERVER;
extern const int UNEXPECTED_PACKET_FROM_SERVER;
extern const int CLIENT_OUTPUT_FORMAT_SPECIFIED;
extern const int CANNOT_SET_SIGNAL_HANDLER;
extern const int SYSTEM_ERROR;
extern const int INVALID_USAGE_OF_INPUT;
}

Expand Down
5 changes: 5 additions & 0 deletions dbms/programs/client/Suggest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
extern const int UNKNOWN_PACKET_FROM_SERVER;
}

void Suggest::load(const ConnectionParameters & connection_parameters, size_t suggestion_limit)
{
Expand Down
1 change: 0 additions & 1 deletion dbms/programs/client/Suggest.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace DB

namespace ErrorCodes
{
extern const int UNKNOWN_PACKET_FROM_SERVER;
}

class Suggest : public LineReader::Suggest, boost::noncopyable
Expand Down
8 changes: 8 additions & 0 deletions dbms/programs/copier/ClusterCopier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@
#include <Common/ZooKeeper/KeeperException.h>

namespace DB
{

namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
extern const int LOGICAL_ERROR;
extern const int UNFINISHED;
extern const int BAD_ARGUMENTS;
}


void ClusterCopier::init()
{
Expand Down
4 changes: 4 additions & 0 deletions dbms/programs/copier/Internals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int BAD_ARGUMENTS;
}

ConfigurationPtr getConfigurationFromXMLString(const std::string & xml_data)
{
Expand Down
6 changes: 1 addition & 5 deletions dbms/programs/copier/Internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ namespace DB

namespace ErrorCodes
{
extern const int NO_ZOOKEEPER;
extern const int BAD_ARGUMENTS;
extern const int UNKNOWN_TABLE;
extern const int UNFINISHED;
extern const int UNKNOWN_ELEMENT_IN_CONFIG;
extern const int LOGICAL_ERROR;
}


Expand Down
4 changes: 4 additions & 0 deletions dbms/programs/copier/TaskCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int BAD_ARGUMENTS;
}

struct TaskCluster
{
Expand Down
5 changes: 5 additions & 0 deletions dbms/programs/copier/TaskTableAndShard.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

namespace DB
{
namespace ErrorCodes
{
extern const int UNKNOWN_ELEMENT_IN_CONFIG;
extern const int LOGICAL_ERROR;
}

struct TaskShard;

Expand Down
3 changes: 1 addition & 2 deletions dbms/programs/server/HTTPHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ namespace DB

namespace ErrorCodes
{
extern const int READONLY;
extern const int UNKNOWN_COMPRESSION_METHOD;

extern const int LOGICAL_ERROR;
extern const int CANNOT_PARSE_TEXT;
extern const int CANNOT_PARSE_ESCAPE_SEQUENCE;
extern const int CANNOT_PARSE_QUOTED_STRING;
Expand Down
3 changes: 2 additions & 1 deletion dbms/programs/server/MySQLHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ using Poco::Net::SSLManager;

namespace ErrorCodes
{
extern const int CANNOT_READ_ALL_DATA;
extern const int NOT_IMPLEMENTED;
extern const int MYSQL_CLIENT_INSUFFICIENT_CAPABILITIES;
extern const int OPENSSL_ERROR;
extern const int SUPPORT_IS_DISABLED;
}

Expand Down
1 change: 0 additions & 1 deletion dbms/programs/server/MySQLHandlerFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace ErrorCodes
extern const int CANNOT_OPEN_FILE;
extern const int NO_ELEMENTS_IN_CONFIG;
extern const int OPENSSL_ERROR;
extern const int SYSTEM_ERROR;
}

MySQLHandlerFactory::MySQLHandlerFactory(IServer & server_)
Expand Down
1 change: 0 additions & 1 deletion dbms/programs/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ namespace ErrorCodes
extern const int FAILED_TO_GETPWUID;
extern const int MISMATCHING_USERS_FOR_PROCESS_AND_DATA;
extern const int NETWORK_ERROR;
extern const int PATH_ACCESS_DENIED;
}


Expand Down
3 changes: 2 additions & 1 deletion dbms/programs/server/TCPHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ namespace DB

namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
extern const int ATTEMPT_TO_READ_AFTER_EOF;
extern const int CLIENT_HAS_CONNECTED_TO_WRONG_PORT;
extern const int UNKNOWN_DATABASE;
extern const int UNKNOWN_EXCEPTION;
extern const int UNKNOWN_PACKET_FROM_CLIENT;
extern const int POCO_EXCEPTION;
extern const int STD_EXCEPTION;
extern const int SOCKET_TIMEOUT;
extern const int UNEXPECTED_PACKET_FROM_CLIENT;
}
Expand Down
1 change: 0 additions & 1 deletion dbms/src/Access/AccessRights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace DB
namespace ErrorCodes
{
extern const int INVALID_GRANT;
extern const int LOGICAL_ERROR;
}


Expand Down
2 changes: 2 additions & 0 deletions dbms/src/Access/Authentication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
extern const int BAD_ARGUMENTS;
extern const int REQUIRED_PASSWORD;
extern const int WRONG_PASSWORD;
}
Expand Down
4 changes: 4 additions & 0 deletions dbms/src/Access/GenericRoleSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
}
GenericRoleSet::GenericRoleSet() = default;
GenericRoleSet::GenericRoleSet(const GenericRoleSet & src) = default;
GenericRoleSet & GenericRoleSet::operator =(const GenericRoleSet & src) = default;
Expand Down
1 change: 0 additions & 1 deletion dbms/src/Access/IAccessStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace ErrorCodes
extern const int BAD_CAST;
extern const int ACCESS_ENTITY_NOT_FOUND;
extern const int ACCESS_ENTITY_ALREADY_EXISTS;
extern const int ACCESS_ENTITY_FOUND_DUPLICATES;
extern const int ACCESS_ENTITY_STORAGE_READONLY;
extern const int UNKNOWN_USER;
extern const int UNKNOWN_ROLE;
Expand Down
1 change: 0 additions & 1 deletion dbms/src/Access/MultipleAccessStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace DB
{
namespace ErrorCodes
{
extern const int ACCESS_ENTITY_NOT_FOUND;
extern const int ACCESS_ENTITY_FOUND_DUPLICATES;
}

Expand Down
1 change: 1 addition & 0 deletions dbms/src/Access/SettingsConstraints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace DB
{
namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
extern const int READONLY;
extern const int QUERY_IS_PROHIBITED;
extern const int NO_ELEMENTS_IN_CONFIG;
Expand Down
4 changes: 4 additions & 0 deletions dbms/src/AggregateFunctions/AggregateFunctionAvg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
}

namespace
{
Expand Down
1 change: 0 additions & 1 deletion dbms/src/AggregateFunctions/AggregateFunctionAvg.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
}

template <typename T, typename Denominator>
Expand Down
4 changes: 4 additions & 0 deletions dbms/src/AggregateFunctions/AggregateFunctionAvgWeighted.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
}

namespace
{
Expand Down
4 changes: 4 additions & 0 deletions dbms/src/AggregateFunctions/AggregateFunctionBitwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
}

namespace
{
Expand Down
1 change: 0 additions & 1 deletion dbms/src/AggregateFunctions/AggregateFunctionCount.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct AggregateFunctionCountData
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
}


Expand Down
2 changes: 1 addition & 1 deletion dbms/src/AggregateFunctions/AggregateFunctionForEach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace DB

namespace ErrorCodes
{
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
}

class AggregateFunctionCombinatorForEach final : public IAggregateFunctionCombinator
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/AggregateFunctions/AggregateFunctionForEach.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace DB

namespace ErrorCodes
{
extern const int PARAMETER_OUT_OF_BOUND;
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
extern const int SIZES_OF_ARRAYS_DOESNT_MATCH;
}
Expand Down
1 change: 0 additions & 1 deletion dbms/src/AggregateFunctions/AggregateFunctionGroupArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace DB
namespace ErrorCodes
{
extern const int TOO_LARGE_ARRAY_SIZE;
extern const int LOGICAL_ERROR;
}

enum class Sampler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
}

namespace
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace DB

namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
extern const int BAD_ARGUMENTS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace DB
namespace ErrorCodes
{
extern const int TOO_LARGE_ARRAY_SIZE;
extern const int LOGICAL_ERROR;
}


Expand Down
4 changes: 4 additions & 0 deletions dbms/src/AggregateFunctions/AggregateFunctionGroupBitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
}

namespace
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace DB

namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
extern const int BAD_ARGUMENTS;
}
Expand Down
1 change: 1 addition & 0 deletions dbms/src/AggregateFunctions/AggregateFunctionIf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace DB

namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
}

Expand Down
7 changes: 7 additions & 0 deletions dbms/src/AggregateFunctions/AggregateFunctionMLMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@

namespace DB
{
namespace ErrorCodes
{
extern const int BAD_ARGUMENTS;
extern const int LOGICAL_ERROR;
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
}
namespace
{
using FuncLinearRegression = AggregateFunctionMLMethod<LinearModelData, NameLinearRegression>;
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/AggregateFunctions/AggregateFunctionMLMethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
extern const int BAD_ARGUMENTS;
extern const int BAD_CAST;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
}

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/AggregateFunctions/AggregateFunctionMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace DB

namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
extern const int NUMBER_OF_ARGUMENTS_DOESNT_MATCH;
extern const int BAD_ARGUMENTS;
}

class AggregateFunctionCombinatorMerge final : public IAggregateFunctionCombinator
Expand Down
4 changes: 4 additions & 0 deletions dbms/src/AggregateFunctions/AggregateFunctionMerge.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

namespace DB
{
namespace ErrorCodes
{
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
}


/** Not an aggregate function, but an adapter of aggregate functions,
Expand Down