poco icon indicating copy to clipboard operation
poco copied to clipboard

Poco 1.12.2 - Building DataMySQL still fails (issue #3689)

Open FreelancerCGN opened this issue 3 years ago • 29 comments

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

FreelancerCGN avatar Aug 14 '22 11:08 FreelancerCGN

What's the version of the mysql sdk that you are using?

hmartinez82 avatar Aug 14 '22 12:08 hmartinez82

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

:-)

FreelancerCGN avatar Aug 14 '22 17:08 FreelancerCGN

The X matters. That's the issue. What's the exact version?

hmartinez82 avatar Aug 14 '22 17:08 hmartinez82

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

FreelancerCGN avatar Aug 14 '22 17:08 FreelancerCGN

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.

hmartinez82 avatar Aug 14 '22 18:08 hmartinez82

Ugh. How did I miss this. I missed one line to also surround with #ifdefs! Fixing soon!

hmartinez82 avatar Aug 15 '22 07:08 hmartinez82

@FreelancerCGN Just to clarify. Is it only failing to compile with 5.6.51?

hmartinez82 avatar Aug 15 '22 08:08 hmartinez82

@hmartinez82 As of yesterday Poco 1.12.2 can't be compiled with MySQL 5.6.51 and 5.6.50.

FreelancerCGN avatar Aug 15 '22 11:08 FreelancerCGN

@FreelancerCGN but it is working with 5.7.9, correct?

hmartinez82 avatar Aug 15 '22 15:08 hmartinez82

@hmartinez82 I can't test it with 5.7.9 at the moment, sorry.

FreelancerCGN avatar Aug 15 '22 20:08 FreelancerCGN

@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.

hmartinez82 avatar Aug 15 '22 21:08 hmartinez82

@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 avatar Aug 15 '22 21:08 hmartinez82

@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 avatar Aug 16 '22 00:08 FreelancerCGN

@FreelancerCGN Thanks for helping me out: Two more lines https://github.com/pocoproject/poco/pull/3753/commits/3cb29644838cb095e3a15c9cc4c0d3bab5043e2e

hmartinez82 avatar Aug 16 '22 00:08 hmartinez82

@hmartinez82

Thank you for both patches, it works now.

FreelancerCGN avatar Aug 16 '22 00:08 FreelancerCGN

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?

zosrothko avatar Aug 17 '22 07:08 zosrothko

I am close to fix the <mysql.h> issue for all build systems

This would be great, @zosrothko

FreelancerCGN avatar Aug 17 '22 09:08 FreelancerCGN

@zosrothko I've never used a Mac in my life, sry :(

hmartinez82 avatar Aug 17 '22 21:08 hmartinez82

@zosrothko The fix was already added in https://github.com/pocoproject/poco/pull/3753

hmartinez82 avatar Aug 18 '22 04:08 hmartinez82

@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.

FreelancerCGN avatar Aug 18 '22 09:08 FreelancerCGN

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....

Daniel-He-KX avatar Aug 19 '22 01:08 Daniel-He-KX

@andyhewenhui you need 1.12.3 or apply the two changes above from https://github.com/pocoproject/poco/pull/3753/files

hmartinez82 avatar Aug 19 '22 02:08 hmartinez82

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 avatar Aug 19 '22 06:08 zosrothko

@zosrothko I can't do it because I don't have access to such old versions of MySQL

hmartinez82 avatar Aug 19 '22 06:08 hmartinez82

@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 avatar Aug 19 '22 06:08 zosrothko

@zosrothko oh, it has always worked with the versions I have access to (it's also working on POCO's continuous integration)

hmartinez82 avatar Aug 19 '22 06:08 hmartinez82

@zosrothko but the issue you are seeing now is unrelated to JSON support for MYSQL, right?

hmartinez82 avatar Aug 21 '22 07:08 hmartinez82

Yes rigth...That not the proper issue to put a comment. Sorry. I remove it.

zosrothko avatar Aug 21 '22 09:08 zosrothko

@andyhewenhui you need 1.12.3 or apply the two changes above from https://github.com/pocoproject/poco/pull/3753/files

👌

Daniel-He-KX avatar Aug 22 '22 06:08 Daniel-He-KX