Bug #79054 FTBFS with libmysqlclient-dev 5.6
Submitted: 1 Nov 2015 3:48 Modified: 23 Jun 2016 9:49
Reporter: Dmitry Smirnov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S2 (Serious)
Version:6.3.7 OS:Debian
Assigned to: CPU Architecture:Any

[1 Nov 2015 3:48] Dmitry Smirnov
Description:
MySQL Workbench 6.3.5 FTBFS with libmysqlclient-dev 5.6:

~~~~
/build/mysql-workbench-6.3.5+dfsg/plugins/migration/copytable/copytable.cpp: In function 'const char* mysql_field_type_to_name(enum_field_types)': 
/build/mysql-workbench-6.3.5+dfsg/plugins/migration/copytable/copytable.cpp:82:10: error: 'MYSQL_TYPE_JSON' was not declared in this scope 
     case MYSQL_TYPE_JSON: return "MYSQL_TYPE_JSON"; 
          ^ 
/build/mysql-workbench-6.3.5+dfsg/plugins/migration/copytable/copytable.cpp: In constructor 'RowBuffer::RowBuffer(boost::shared_ptr<std::vector<ColumnInfo> >, boost::function<void(int, const char*, long unsigned int)>, size_t)':                                                                                                                                          
/build/mysql-workbench-6.3.5+dfsg/plugins/migration/copytable/copytable.cpp:244:12: error: 'MYSQL_TYPE_JSON' was not declared in this scope 
       case MYSQL_TYPE_JSON: 
            ^ 
/build/mysql-workbench-6.3.5+dfsg/plugins/migration/copytable/copytable.cpp: In member function 'virtual bool MySQLCopyDataSource::fetch_row(RowBuffer&)': 
/build/mysql-workbench-6.3.5+dfsg/plugins/migration/copytable/copytable.cpp:1555:45: error: 'MYSQL_TYPE_JSON' was not declared in this scope 
             rowbuffer[index].buffer_type] == MYSQL_TYPE_JSON) 
                                             ^ 
/build/mysql-workbench-6.3.5+dfsg/plugins/migration/copytable/copytable.cpp: In member function 'bool MySQLCopyDataTarget::append_bulk_column(size_t)': 
/build/mysql-workbench-6.3.5+dfsg/plugins/migration/copytable/copytable.cpp:2360:10: error: 'MYSQL_TYPE_JSON' was not declared in this scope 
     case MYSQL_TYPE_JSON: 
          ^ 
plugins/migration/CMakeFiles/wbcopytables-bin.dir/build.make:65: recipe for target 'plugins/migration/CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o' failed 
make[4] *** [plugins/migration/CMakeFiles/wbcopytables-bin.dir/copytable/copytable.cpp.o] Error 1 
make[4] Leaving directory '/build/mysql-workbench-6.3.5+dfsg/obj-x86_64-linux-gnu' 
CMakeFiles/Makefile2:2697: recipe for target 'plugins/migration/CMakeFiles/wbcopytables-bin.dir/all' failed 
make[3] *** [plugins/migration/CMakeFiles/wbcopytables-bin.dir/all] Error 2 
~~~~

How to repeat:
Build M-W with libmysqlclient-dev < 5.7
[3 Nov 2015 8:32] MySQL Verification Team
Thank you for the report.
On Debian8, libmysqlclient-dev 5.6 it is failing with: 

// On Debian8, am seeing failure sql::DataType::JSON
// OS and build details

root@ushastry:/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src# cat /etc/*release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="https://bugs.debian.org/"

ushastry@ushastry:~$ dpkg -l|grep mysql
ii  libmysqlclient-dev                    5.6.27-1debian8                     amd64        MySQL development headers
ii  libmysqlclient18:amd64                5.6.27-1debian8                     amd64        MySQL shared client libraries
ii  libmysqlcppconn-dev                   1.1.3-6                             amd64        MySQL Connector for C++ (development files)
ii  libmysqlcppconn7                      1.1.3-6                             amd64        MySQL Connector for C++ (library)
ii  mysql-apt-config                      0.5.3-1                             all          Auto configuration for MySQL APT Repo.
ii  mysql-client                          5.6.27-1debian8                     amd64        MySQL Client meta package depending on latest version
ii  mysql-common                          5.6.27-1debian8                     amd64        MySQL Common
ii  mysql-community-client                5.6.27-1debian8                     amd64        MySQL Client
ii  mysql-community-server                5.6.27-1debian8                     amd64        MySQL Server
ii  mysql-connector-python                2.0.4-1debian8.0                    all          MySQL database driver written in Python
ii  mysql-server                          5.6.27-1debian8                     amd64        MySQL Server meta package depending on latest version

- Remove iodbc, if necessary

  $> sudo apt-get remove iodbc

- Install dependencies
  
  $> sudo apt-get install build-essential cmake cmake-data autoconf automake pkg-config libtool libzip-dev libxml2-dev \
                          libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev libglu1-mesa-dev libgl1-mesa-glx \
                          mesa-common-dev libmysqlclient-dev libmysqlcppconn-dev uuid-dev libpixman-1-dev libpcre3-dev \
                          libgnome2-dev libgnome-keyring-dev libgtk2.0-dev libpango1.0-dev libcairo2-dev python-dev \
                          libboost-dev libctemplate-dev mysql-client python-pysqlite2 libsqlite3-dev libtinyxml-dev \
                          swig libvsqlitepp-dev libgdal-dev libproj0

root@ushastry:/home/ushastry/Downloads# md5sum mysql-workbench-community-6.3.5-src.tar.gz 
efe4caf5ccd45e2d6d69778f294aa2c0  mysql-workbench-community-6.3.5-src.tar.gz
root@ushastry:/home/ushastry/Downloads# tar -zxvf mysql-workbench-community-6.3.5-src.tar.gz
root@ushastry:/home/ushastry/Downloads# cd mysql-workbench-community-6.3.5-src
root@ushastry:/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src# mkdir wb-build
root@ushastry:/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src# cd wb-build/
root@ushastry:/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src/wb-build# 
root@ushastry:/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src/wb-build# cmake ..
.
.
-- Looking for strtoumax - found
Using bundled Antlr C runtime
Generating mysql.parser files...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ushastry/Downloads/mysql-workbench-community-6.3.5-src/wb-build
root@ushastry:/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src/wb-build# 
root@ushastry:/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src/wb-build# make
.
.
[ 54%] Building CXX object backend/wbpublic/CMakeFiles/wbpublic.dir/objimpl/db.query/db_query_Resultset.cpp.o
/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp: In constructor ‘CPPResultsetResultset::CPPResultsetResultset(db_query_ResultsetRef, boost::shared_ptr<sql::ResultSet>)’:
/home/ushastry/Downloads/mysql-workbench-community-6.3.5-src/backend/wbpublic/objimpl/db.query/db_query_Resultset.cpp:303:14: error: ‘JSON’ is not a member of ‘sql::DataType’
         case sql::DataType::JSON:
              ^
backend/wbpublic/CMakeFiles/wbpublic.dir/build.make:2676: recipe for target 'backend/wbpublic/CMakeFiles/wbpublic.dir/objimpl/db.query/db_query_Resultset.cpp.o' failed
make[2]: *** [backend/wbpublic/CMakeFiles/wbpublic.dir/objimpl/db.query/db_query_Resultset.cpp.o] Error 1
CMakeFiles/Makefile2:316: recipe for target 'backend/wbpublic/CMakeFiles/wbpublic.dir/all' failed
make[1]: *** [backend/wbpublic/CMakeFiles/wbpublic.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
[3 Nov 2015 9:17] Mike Lischke
This is not a failure by MySQL Workbench per se. You simply don't have the latest c++ connector needed to compile the application. The next connector release will be published soon.
[2 Dec 2015 6:52] Dmitry Smirnov
Mike, could you please be more specific regarding which version of C++ connector is required to build MySQL Workbench?

I tried building M-W with connector version 1.1.6 but build failed with the same error.

I'm sure many users would appreciate if it could be possible to build M-W with older libs.
[10 Dec 2015 2:22] Philip Olson
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 6.3.6 release, and here's the changelog entry:

Compiling Workbench now requires Connector/C++ 1.1.7 or higher, as this is
the first Connector/C++ release that supports JSON.

Thank you for the bug report.
[15 Dec 2015 16:23] Martin Aleksov
But how to compile WB since the latest Connector/C++ is 1.1.6

http://dev.mysql.com/downloads/connector/cpp/

Thank you
[23 Jun 2016 9:49] Dmitry Smirnov
It is really wrong that this bug was just closed without any action.

This problem affects M-W 6.3.6 and 6.3.7: it is simply not possible to build M-W without MySQL-5.7. 

Connector/C++ 1.1.7 itself FTBFS without MySQL-5.7:

~~~~
/build/mysql-connector-c++-1.1.7/builddir/driver/mysql_resultbind.cpp: In function 'sql::mysql::st_buffer_size_type sql::mysql::allocate_buffer_for_field(const MYSQL_FIELD*)': 
/build/mysql-connector-c++-1.1.7/builddir/driver/mysql_resultbind.cpp:89:10: error: 'MYSQL_TYPE_JSON' was not declared in this scope 
     case MYSQL_TYPE_JSON: 
          ^ 
~~~~

Is it really that difficult to maintain backward compatibility with one previous release?

You know, not everyone is running latest MySQL 5.7...

Please re-open.