Poco 1.12.2 - Building DataMySQL still fails (issue #3689)
Poco 1.12.2 Ubuntu 20.04.4 LTS CMake 3.16.3
Building DataMySQL still fails, issue #3689 @hmartinez82
Scanning dependencies of target DataMySQL
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Binder.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Connector.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Extractor.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/MySQLException.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/MySQLStatementImpl.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/ResultMetadata.cpp.o
/home/poco/poco-1.12.2-all/Data/MySQL/src/ResultMetadata.cpp: In function ‘Poco::Data::MetaColumn::ColumnDataType {anonymous}::fieldType(const MYSQL_FIELD&)’:
/home/poco/poco-1.12.2-all/Data/MySQL/src/ResultMetadata.cpp:136:8: error: ‘MYSQL_TYPE_JSON’ was not declared in this scope; did you mean ‘MYSQL_TYPE_BLOB’?
136 | case MYSQL_TYPE_JSON:
| ^~~~~~~~~~~~~~~
| MYSQL_TYPE_BLOB
make[2]: *** [Data/MySQL/CMakeFiles/DataMySQL.dir/build.make:128: Data/MySQL/CMakeFiles/DataMySQL.dir/src/ResultMetadata.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5259: Data/MySQL/CMakeFiles/DataMySQL.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
# cmake --version
cmake version 3.16.3
# g++ --version
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
What's the version of the mysql sdk that you are using?
What's the version of the mysql sdk that you are using?
5.7.x as written here already 26 days ago: https://github.com/pocoproject/poco/issues/3689#issuecomment-1189556224
:-)
The X matters. That's the issue. What's the exact version?
5.6.51 and 5.7.9
We can't upgrade the system with 5.6.51 due to special reasons.
But here https://github.com/pocoproject/poco/issues/3689#issuecomment-1193939455 another developer uses 5.6
Ok. I'll investigate. The fix should've have taken care of 5.6 already, and JSON support was added in 5.7.8 so you should have not have this problem.
Ugh. How did I miss this. I missed one line to also surround with #ifdefs! Fixing soon!
@FreelancerCGN Just to clarify. Is it only failing to compile with 5.6.51?
@hmartinez82 As of yesterday Poco 1.12.2 can't be compiled with MySQL 5.6.51 and 5.6.50.
@FreelancerCGN but it is working with 5.7.9, correct?
@hmartinez82 I can't test it with 5.7.9 at the moment, sorry.
@FreelancerCGN Per MySQL docs, 5.7.8 is when JSON support was added. I'll create a PR that will fix for 5.7.7 and below. You can also apply locally to your copy of Poco to get it compiling, its just two lines.
@FreelancerCGN Sorry I'm unable to test it locally. I don't have access to such older versions of the SDK. I only have access to MySQL 8 and took me hours just to get 5.7.38 to confirm a header support. Can you try with these two lines added to Data/MySQL/src/ResultMetadata.cpp ? See https://github.com/pocoproject/poco/pull/3753/files
@hmartinez82
ResultMetadata.cpp compiles now without errors
But now MySQLTest.cpp fails:
Scanning dependencies of target DataMySQL
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Binder.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Connector.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Extractor.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/MySQLException.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/MySQLStatementImpl.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/ResultMetadata.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/SessionHandle.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/SessionImpl.cpp.o
[ 94%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/StatementExecutor.cpp.o
[ 95%] Building CXX object Data/MySQL/CMakeFiles/DataMySQL.dir/src/Utility.cpp.o
[ 95%] Linking CXX static library ../../lib/libPocoDataMySQLd.a
[ 95%] Built target DataMySQL
Scanning dependencies of target DataMySQL-testrunner
[ 95%] Building CXX object Data/MySQL/testsuite/CMakeFiles/DataMySQL-testrunner.dir/src/Driver.cpp.o
[ 95%] Building CXX object Data/MySQL/testsuite/CMakeFiles/DataMySQL-testrunner.dir/src/MySQLTest.cpp.o
In file included from /home/poco/poco-1.12.2-all/Data/MySQL/testsuite/src/MySQLTest.cpp:12:
/home/poco/poco-1.12.2-all/Data/MySQL/testsuite/src/MySQLTest.cpp: In static member function ‘static CppUnit::Test* MySQLTest::suite()’:
/home/poco/poco-1.12.2-all/Data/MySQL/testsuite/src/MySQLTest.cpp:979:37: error: ‘testJSON’ is not a member of ‘MySQLTest’
979 | CppUnit_addTest(pSuite, MySQLTest, testJSON);
| ^~~~~~~~
/home/poco/poco-1.12.2-all/CppUnit/include/CppUnit/TestCaller.h:92:58: note: in definition of macro ‘CppUnit_addTest’
92 | suite->addTest(new CppUnit::TestCaller<cls>(#mth, &cls::mth))
| ^~~
make[2]: *** [Data/MySQL/testsuite/CMakeFiles/DataMySQL-testrunner.dir/build.make:76: Data/MySQL/testsuite/CMakeFiles/DataMySQL-testrunner.dir/src/MySQLTest.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:5289: Data/MySQL/testsuite/CMakeFiles/DataMySQL-testrunner.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
@FreelancerCGN Thanks for helping me out: Two more lines https://github.com/pocoproject/poco/pull/3753/commits/3cb29644838cb095e3a15c9cc4c0d3bab5043e2e
@hmartinez82
Thank you for both patches, it works now.
Hi everybody. I am close to fix the <mysql.h> issue for all build systems (CMake, GNUMake, MSBuild on Linux and Windows) and I am missing the location of this include on MacOS Darwin which is the last to fix from the CI.
Could someone tell me where are the locations to find out this include on MacOS Darwin?
I am close to fix the <mysql.h> issue for all build systems
This would be great, @zosrothko
@zosrothko I've never used a Mac in my life, sry :(
@zosrothko The fix was already added in https://github.com/pocoproject/poco/pull/3753
@zosrothko The fix was already added in #3753
@hmartinez82
He talks about a different issue regarding the "mysql.h" include with wrong paths.
This is still a problem, but I decided to change the generated files "MySQL.h" and "MySQLException.h" with the right path to "mysql.h" instead.
poco1.12.2 still failed /Users/andy/project/CLion/poco-1.12.2/Data/MySQL/src/ResultMetadata.cpp:136:8: error: use of undeclared identifier 'MYSQL_TYPE_JSON' case MYSQL_TYPE_JSON: ^ 1 error generated. make[2]: *** [Data/MySQL/CMakeFiles/DataMySQL.dir/src/ResultMetadata.cpp.o] Error 1 make[1]: *** [Data/MySQL/CMakeFiles/DataMySQL.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....
@andyhewenhui you need 1.12.3 or apply the two changes above from https://github.com/pocoproject/poco/pull/3753/files
Could all of you check that the Data/MySQL compiles without any errors from the branch devel from this repo Kampbell/poco and let me know the result?
Thanks
@zosrothko I can't do it because I don't have access to such old versions of MySQL
@hmartinez82 Understand your point for the old version of MySQL but, the fix should or better must work with also the version you have
@zosrothko oh, it has always worked with the versions I have access to (it's also working on POCO's continuous integration)
@zosrothko but the issue you are seeing now is unrelated to JSON support for MYSQL, right?
Yes rigth...That not the proper issue to put a comment. Sorry. I remove it.
@andyhewenhui you need 1.12.3 or apply the two changes above from https://github.com/pocoproject/poco/pull/3753/files
👌