Added a test

This commit is contained in:
Alexey Milovidov 2019-02-22 20:16:11 +03:00
parent ea774a449e
commit 0d9c438864
5 changed files with 18 additions and 2 deletions

View File

@ -37,7 +37,8 @@ ODBCHandler::PoolPtr ODBCHandler::getPool(const std::string & connection_str)
std::lock_guard lock(mutex);
if (!pool_map->count(connection_str))
{
pool_map->emplace(connection_str, createAndCheckResizePocoSessionPool([connection_str] {
pool_map->emplace(connection_str, createAndCheckResizePocoSessionPool([connection_str]
{
return std::make_shared<Poco::Data::SessionPool>("ODBC", validateODBCConnectionString(connection_str));
}));
}

View File

@ -51,7 +51,7 @@ add_executable (hashing_read_buffer hashing_read_buffer.cpp)
target_link_libraries (hashing_read_buffer PRIVATE clickhouse_common_io)
add_check (hashing_read_buffer)
add_executable (io_operators operators.cpp)
add_executable (io_operators io_operators.cpp)
target_link_libraries (io_operators PRIVATE clickhouse_common_io)
if (OS_LINUX)

View File

@ -31,5 +31,11 @@ int main(int, char **)
std::cerr << hello << '\n';
}
{
DB::WriteBufferFromFileDescriptor buf(STDOUT_FILENO);
size_t x = 11;
buf << "Column " << x << ", \n";
}
return 0;
}

View File

@ -0,0 +1 @@
Column 11, name: c11, type: UInt8, ERROR: text "a" is not like UInt8

View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
# set -x
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CUR_DIR/../shell_config.sh
echo -ne '0\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10\ta' | $CLICKHOUSE_LOCAL --structure 'c0 UInt8, c1 UInt8, c2 UInt8, c3 UInt8, c4 UInt8, c5 UInt8, c6 UInt8, c7 UInt8, c8 UInt8, c9 UInt8, c10 UInt8, c11 UInt8' --input-format TSV --query 'SELECT * FROM table' 2>&1 | grep -F 'Column 11'