mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 01:00:48 +00:00
Merge pull request #3031 from proller/fix8
Better odbc-bridge executable select
This commit is contained in:
commit
b7a136e6d5
@ -8,6 +8,7 @@
|
|||||||
#include <Poco/Path.h>
|
#include <Poco/Path.h>
|
||||||
#include <Poco/Util/AbstractConfiguration.h>
|
#include <Poco/Util/AbstractConfiguration.h>
|
||||||
#include <Common/ShellCommand.h>
|
#include <Common/ShellCommand.h>
|
||||||
|
#include <Common/config.h>
|
||||||
#include <common/logger_useful.h>
|
#include <common/logger_useful.h>
|
||||||
#include <ext/range.h>
|
#include <ext/range.h>
|
||||||
|
|
||||||
@ -36,13 +37,28 @@ ODBCBridgeHelper::ODBCBridgeHelper(
|
|||||||
void ODBCBridgeHelper::startODBCBridge() const
|
void ODBCBridgeHelper::startODBCBridge() const
|
||||||
{
|
{
|
||||||
Poco::Path path{config.getString("application.dir", "")};
|
Poco::Path path{config.getString("application.dir", "")};
|
||||||
path.setFileName("clickhouse");
|
|
||||||
|
path.setFileName(
|
||||||
|
#if CLICKHOUSE_SPLIT_BINARY
|
||||||
|
"clickhouse-odbc-bridge"
|
||||||
|
#else
|
||||||
|
"clickhouse"
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
if (!Poco::File(path).exists())
|
if (!Poco::File(path).exists())
|
||||||
throw Exception("clickhouse binary is not found", ErrorCodes::EXTERNAL_EXECUTABLE_NOT_FOUND);
|
throw Exception("clickhouse binary (" + path.toString() + ") is not found", ErrorCodes::EXTERNAL_EXECUTABLE_NOT_FOUND);
|
||||||
|
|
||||||
std::stringstream command;
|
std::stringstream command;
|
||||||
command << path.toString() << " odbc-bridge ";
|
|
||||||
|
command << path.toString() <<
|
||||||
|
#if CLICKHOUSE_SPLIT_BINARY
|
||||||
|
" "
|
||||||
|
#else
|
||||||
|
" odbc-bridge "
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
command << "--http-port " << config.getUInt("odbc_bridge.port", DEFAULT_PORT) << ' ';
|
command << "--http-port " << config.getUInt("odbc_bridge.port", DEFAULT_PORT) << ' ';
|
||||||
command << "--listen-host " << config.getString("odbc_bridge.listen_host", DEFAULT_HOST) << ' ';
|
command << "--listen-host " << config.getString("odbc_bridge.listen_host", DEFAULT_HOST) << ' ';
|
||||||
command << "--http-timeout " << http_timeout.totalMicroseconds() << ' ';
|
command << "--http-timeout " << http_timeout.totalMicroseconds() << ' ';
|
||||||
|
@ -14,3 +14,4 @@
|
|||||||
#cmakedefine01 USE_POCO_DATAODBC
|
#cmakedefine01 USE_POCO_DATAODBC
|
||||||
#cmakedefine01 USE_POCO_MONGODB
|
#cmakedefine01 USE_POCO_MONGODB
|
||||||
#cmakedefine01 USE_POCO_NETSSL
|
#cmakedefine01 USE_POCO_NETSSL
|
||||||
|
#cmakedefine01 CLICKHOUSE_SPLIT_BINARY
|
||||||
|
Loading…
Reference in New Issue
Block a user