mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
correct code style
This commit is contained in:
parent
66178b1db1
commit
278099e663
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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"; }
|
||||
|
||||
|
34
tests/queries/0_stateless/01945_system_warnings.expect
Executable file
34
tests/queries/0_stateless/01945_system_warnings.expect
Executable 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
|
Loading…
Reference in New Issue
Block a user