diff --git a/dbms/src/ODBC/ReadHelpers.h b/dbms/src/ODBC/ReadHelpers.h index 8c9268dd3f1..406f67e0028 100644 --- a/dbms/src/ODBC/ReadHelpers.h +++ b/dbms/src/ODBC/ReadHelpers.h @@ -2,10 +2,11 @@ #include #include +#include /// В формате VarUInt. -inline void readSize(UInt64 & res, std::istream & istr) +inline void readSize(Poco::UInt64 & res, std::istream & istr) { static constexpr auto MAX_LENGTH_OF_SIZE = 4; /// Ограничивает размер 256 мегабайтами (2 ^ (7 * 4)). @@ -17,7 +18,7 @@ inline void readSize(UInt64 & res, std::istream & istr) if (byte == EOF) throw std::runtime_error("Incomplete result received."); - res |= (static_cast(byte) & 0x7F) << (7 * i); + res |= (static_cast(byte) & 0x7F) << (7 * i); if (!(byte & 0x80)) return; @@ -29,7 +30,7 @@ inline void readSize(UInt64 & res, std::istream & istr) inline void readString(std::string & res, std::istream & istr) { - UInt64 size = 0; + Poco::UInt64 size = 0; readSize(size, istr); res.resize(size); diff --git a/dbms/src/ODBC/ResultSet.cpp b/dbms/src/ODBC/ResultSet.cpp index b416cda7cad..36dfdc40307 100644 --- a/dbms/src/ODBC/ResultSet.cpp +++ b/dbms/src/ODBC/ResultSet.cpp @@ -2,6 +2,8 @@ #include "Statement.h" #include "Log.h" +#include + void ResultSet::init(Statement & statement_) { @@ -11,7 +13,7 @@ void ResultSet::init(Statement & statement_) return; /// Заголовок: количество столбцов, их имена и типы. - UInt64 num_columns = 0; + Poco::UInt64 num_columns = 0; readSize(num_columns, in()); if (!num_columns) diff --git a/dbms/src/ODBC/ResultSet.h b/dbms/src/ODBC/ResultSet.h index 5b952973c92..e6d0cbf21fb 100644 --- a/dbms/src/ODBC/ResultSet.h +++ b/dbms/src/ODBC/ResultSet.h @@ -2,6 +2,7 @@ #include #include +#include #include #include "ReadHelpers.h" @@ -14,8 +15,8 @@ class Field public: std::string data; - UInt64 getUInt() const { return Poco::NumberParser::parseUnsigned64(data); } - Int64 getInt() const { return Poco::NumberParser::parse64(data); } + Poco::UInt64 getUInt() const{ return Poco::NumberParser::parseUnsigned64(data); } + Poco::Int64 getInt() const { return Poco::NumberParser::parse64(data); } float getFloat() const { return Poco::NumberParser::parseFloat(data); } double getDouble() const { return Poco::NumberParser::parseFloat(data); } diff --git a/dbms/src/ODBC/build.sh b/dbms/src/ODBC/build.sh index 91ce5e1aa57..3cc9c2aae68 100755 --- a/dbms/src/ODBC/build.sh +++ b/dbms/src/ODBC/build.sh @@ -2,8 +2,8 @@ # First, compile and install Poco library with static libraries and -fPIC option enabled. -g++ \ - -std=c++11 \ +g++-5 \ + -std=c++14 \ -Wall -Werror \ -O2 \ -g \ diff --git a/dbms/src/ODBC/odbc.cpp b/dbms/src/ODBC/odbc.cpp index 783f6396eab..48f9ce23264 100644 --- a/dbms/src/ODBC/odbc.cpp +++ b/dbms/src/ODBC/odbc.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include "StringRef.h" #include "Log.h" #include "DiagnosticRecord.h" @@ -340,10 +342,10 @@ impl_SQLGetData(HSTMT statement_handle, return fillOutputNumber(field.getUInt(), out_value, out_value_max_size, out_value_size_or_indicator); case SQL_C_SBIGINT: - return fillOutputNumber(field.getInt(), out_value, out_value_max_size, out_value_size_or_indicator); + return fillOutputNumber(field.getInt(), out_value, out_value_max_size, out_value_size_or_indicator); case SQL_C_UBIGINT: - return fillOutputNumber(field.getUInt(), out_value, out_value_max_size, out_value_size_or_indicator); + return fillOutputNumber(field.getUInt(), out_value, out_value_max_size, out_value_size_or_indicator); case SQL_C_FLOAT: return fillOutputNumber(field.getFloat(), out_value, out_value_max_size, out_value_size_or_indicator);