yihang hwang
yihang hwang

Reputation: 419

How to solve make mysql-connector-c++-1.1.7 error

After I follow https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-unix.html and when I using make below is what I happen

[  8%] Building CXX object driver/CMakeFiles/mysqlcppconn.dir/mysql_resultbind.cpp.o
/root/git/MetricBench.perclab/build/mysql-connector-cpp/driver/mysql_resultbind.cpp: In function ‘sql::mysql::st_buffer_size_type sql::mysql::allocate_buffer_for_field(const MYSQL_FIELD*)’:
/root/git/MetricBench.perclab/build/mysql-connector-cpp/driver/mysql_resultbind.cpp:89:10: error: ‘MYSQL_TYPE_JSON’ was not declared in this scope
     case MYSQL_TYPE_JSON:
          ^
driver/CMakeFiles/mysqlcppconn.dir/build.make:284: recipe for target 'driver/CMakeFiles/mysqlcppconn.dir/mysql_resultbind.cpp.o' failed
make[2]: *** [driver/CMakeFiles/mysqlcppconn.dir/mysql_resultbind.cpp.o] Error 1
CMakeFiles/Makefile2:92: recipe for target 'driver/CMakeFiles/mysqlcppconn.dir/all' failed
make[1]: *** [driver/CMakeFiles/mysqlcppconn.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
make: *** [all] Error 2

I have ever find out the solution others offer

This can be fixed by checking for the MYSQL_TYPE_JSON at compile time and optionally including those switch/case conditionals only if detected in the underlying C API.

and I really don't know how to solve this problem any suggestion ? thx

Upvotes: 2

Views: 1611

Answers (1)

BJovke
BJovke

Reputation: 1993

Use mysql-connector-c++-1.1.6. 1.1.7 has added JSON type and it seems that it is not supported with Connector C 6.1.6 or some additional changes need to be done.

Maybe it is something else but I didn't bother too much, 1.1.6 works like a charm.

...found it:


Changes in MySQL Connector/C++ 1.1.7 (2016-01-20)

To build Connector/C++ from source, you must use either a General Availability version of MySQL 5.7 (5.7.9 or higher) or Connector/C 6.1.8 or higher.

https://dev.mysql.com/doc/relnotes/connector-cpp/en/news-1-1-7.html


The second mistery is where to download Connector/C 6.1.8 source? Download page (https://dev.mysql.com/downloads/connector/c/) at the time I'm writing this is offering only Connector/C 6.1.6....

well....

after another research, it seems that Connector/C 6.1.7 and 6.1.8 are not going to be released in community versions (https://downloads.mysql.com/docs/connector-c-relnotes-en.a4.pdf). But, in this document there's no mention about adding JSON type support in 6.1.8:


Changes in MySQL Connector/C 6.1.8 (2015-12-15)

Security Notes • This release of Connector/C upgrades the linked OpenSSL library to version 1.0.1p. Issues fixed in the new OpenSSL version are described at http://www.openssl.org/news/vulnerabilities.html.

Changes in MySQL Connector/C 6.1.7 (2015-04-21)

Security Notes • Security Fix: Connector/C 6.1 Commercial has been updated to use OpenSSL version 1.0.1m, which has been publicly reported as not vulnerable to CVE-2015-0286. Since the only change in Connector/C 6.1.7 is the inclusion of OpenSSL libraries publicly reported as unaffected by CVE-2015-0286, and since Oracle-produced MySQL Community builds use YaSSL libraries which have been reported as not affected by CVE-2015-0286, Oracle will not produce builds for Connector/C Community for version 6.1.7. This means the Community edition of Connector/C will skip version 6.1.7. (Bug #20747718, CVE-2015-0286)

Upvotes: 1

Related Questions