Giter VIP home page Giter VIP logo

Comments (6)

Akint avatar Akint commented on August 18, 2024 1

Works like a charm, thank you!

from clickhouse-odbc.

artpaul avatar artpaul commented on August 18, 2024
  1. Please try with this commit 13cabc5
  2. You should change PORT to 8123

from clickhouse-odbc.

Akint avatar Akint commented on August 18, 2024

@artpaul, thank you for your quick response.

After changes made in 13cabc5:
When iusql is used, nothing is changed since iusql calls SQLDriverConnect, which hasn't been changed.
When isql is used, I can see the following error in /tmp/clickhouse-odbc-stderr:

isql: symbol lookup error: /usr/local/lib/clickhouse_odbc.so: undefined symbol: SQLGetPrivateProfileString

Adding -lodbcinst to compiler options didn't help:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libodbcinst.a(ODBCINSTConstructProperties.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libodbcinst.a(ODBCINSTConstructProperties.o): error adding symbols: Bad value
collect2: error: ld returned 1 exit status

It seems that libodbcinst was compiled without -fPIC in Ubuntu.

$ ar -x /usr/lib/x86_64-linux-gnu/libodbcinst.a; readelf --relocs ODBCINSTConstructProperties.o | egrep '(GOT|PLT|JU?MP_SLOT)'
$

BTW, there are compilation warnings didn't allow to compile the driver with build.sh (with -Werror, properly speaking):

In file included from attr.cpp:5:0:
utils.h: In instantiation of ‘RETCODE fillOutputString(const string&, PTR, LENGTH, LENGTH*) [with PTR = void*; LENGTH = int; RETCODE = short int; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
attr.cpp:138:104:   required from here
utils.h:137:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (out_value_max_length >= (size_without_zero + 1) * sizeof(TCHAR))
                                  ^
utils.h:33:21: warning: ‘const char* nextKeyValuePair(const char*, const char*, StringRef&, StringRef&)’ defined but not used [-Wunused-function]
 static const char * nextKeyValuePair(const char * data, const char * end, StringRef & out_key, StringRef & out_value)
                     ^
In file included from handles.cpp:5:0:
utils.h:33:21: warning: ‘const char* nextKeyValuePair(const char*, const char*, StringRef&, StringRef&)’ defined but not used [-Wunused-function]
 static const char * nextKeyValuePair(const char * data, const char * end, StringRef & out_key, StringRef & out_value)
                     ^
In file included from info.cpp:3:0:
utils.h: In instantiation of ‘RETCODE fillOutputString(const string&, PTR, LENGTH, LENGTH*) [with PTR = void*; LENGTH = short int; RETCODE = short int; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
info.cpp:50:13:   required from here
utils.h:137:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (out_value_max_length >= (size_without_zero + 1) * sizeof(TCHAR))
                                  ^
utils.h:33:21: warning: ‘const char* nextKeyValuePair(const char*, const char*, StringRef&, StringRef&)’ defined but not used [-Wunused-function]
 static const char * nextKeyValuePair(const char * data, const char * end, StringRef & out_key, StringRef & out_value)
                     ^
In file included from odbc.cpp:8:0:
utils.h: In instantiation of ‘RETCODE fillOutputString(const string&, PTR, LENGTH, LENGTH*) [with PTR = void*; LENGTH = short int; RETCODE = short int; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
odbc.cpp:244:110:   required from here
utils.h:137:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (out_value_max_length >= (size_without_zero + 1) * sizeof(TCHAR))
                                  ^
utils.h: In instantiation of ‘RETCODE fillOutputString(const string&, PTR, LENGTH, LENGTH*) [with PTR = unsigned char*; LENGTH = short int; RETCODE = short int; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
odbc.cpp:276:114:   required from here
utils.h:137:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
utils.h: In instantiation of ‘RETCODE fillOutputString(const string&, PTR, LENGTH, LENGTH*) [with PTR = void*; LENGTH = long int; RETCODE = short int; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
odbc.cpp:304:111:   required from here
utils.h:137:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
utils.h: In instantiation of ‘RETCODE fillOutputString(const string&, PTR, LENGTH, LENGTH*) [with PTR = unsigned char*; LENGTH = int; RETCODE = short int; std::__cxx11::string = std::__cxx11::basic_string<char>]’:
odbc.cpp:793:93:   required from here
utils.h:137:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
utils.h:33:21: warning: ‘const char* nextKeyValuePair(const char*, const char*, StringRef&, StringRef&)’ defined but not used [-Wunused-function]
 static const char * nextKeyValuePair(const char * data, const char * end, StringRef & out_key, StringRef & out_value)

Not sure if it could be related and if I should submit separate issue for that.

from clickhouse-odbc.

artpaul avatar artpaul commented on August 18, 2024

When isql is used, I can see the following error in /tmp/clickhouse-odbc-stderr

Have you tried to purge whole cmake's cache? I had same issue but after this change to CMakeLists.txt - 13cabc5#diff-b21b3f1540f8dc19a7c21f1ed6c38dd1R23 everything became fine.

from clickhouse-odbc.

Akint avatar Akint commented on August 18, 2024

Building via cmake works, thank you. Shouldn't building instructions in README.md mention need of using cmake?
As of the issue subject, values of Port and Database keys are used now. But neither Host's or ServerName's value is used, isql still connects to localhost. Maybe because of Connection::init not using ci.server?

from clickhouse-odbc.

artpaul avatar artpaul commented on August 18, 2024

Try this commit - 158d3d3
Please also note that HOST renamed to SERVER and odbc.so renamed to clickhouse-odbc.so

from clickhouse-odbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.