correct code style

This commit is contained in:
Artur 2021-07-12 12:21:18 +00:00
parent 66178b1db1
commit 278099e663
5 changed files with 42 additions and 9 deletions

View File

@ -1,10 +1,8 @@
#include <memory>
#include <Storages/System/StorageSystemWarnings.h>
#include <Interpreters/Context.h>
#include <Storages/System/StorageSystemWarnings.h>
namespace DB
{
NamesAndTypesList StorageSystemWarnings::getNamesAndTypes()
{
return {
@ -14,9 +12,8 @@ NamesAndTypesList StorageSystemWarnings::getNamesAndTypes()
void StorageSystemWarnings::fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo &) const
{
for (auto& warning : context->getWarnings()) {
for (const auto & warning : context->getWarnings())
res_columns[0]->insert(warning);
}
}
}

View File

@ -2,11 +2,13 @@
#include <Storages/System/IStorageSystemOneBlock.h>
namespace DB {
namespace DB
{
class Context;
class StorageSystemWarnings final : public shared_ptr_helper<StorageSystemWarnings>, public IStorageSystemOneBlock<StorageSystemWarnings> {
class StorageSystemWarnings final : public shared_ptr_helper<StorageSystemWarnings>,
public IStorageSystemOneBlock<StorageSystemWarnings> {
public:
std::string getName() const override { return "SystemWarnings"; }

View File

@ -0,0 +1,34 @@
#!/usr/bin/expect -f
# This is a test for system.warnings. Testing in interactive mode is necessary,
# as we want to see certain warnings from client
log_user 0
set timeout 60
match_max 100000
# A default timeout action is to do nothing, change it to fail
expect_after {
timeout {
exit 1
}
}
set basedir [file dirname $argv0]
spawn bash -c "source $basedir/../shell_config.sh ; \$CLICKHOUSE_CLIENT_BINARY \$CLICKHOUSE_CLIENT_OPT --disable_suggestion"
expect ":) "
send -- "SELECT value FROM system.build_options WHERE name='BUILD_TYPE'"
expect {
"Debug" {
send -- "SELECT message FROM system.warnings WHERE message='Server was built in debug mode. It will work slowly.'"
expect "Server was built in debug mode. It will work slowly."
expect ":) "
}
"RelWithDebInfo"
}
# Finish test
send -- "\4"
expect eof