Bug 227813 - databases/qt4-mysql-plugin, databases/qt5-sqldrivers-mysql -- fix build against MySQL >= 8..0.1
Summary: databases/qt4-mysql-plugin, databases/qt5-sqldrivers-mysql -- fix build again...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-kde (group)
URL:
Keywords:
: 228392 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-04-27 17:09 UTC by mikhail.rokhin
Modified: 2018-06-04 04:03 UTC (History)
5 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
qt4-mysql-plugin screenshot (94.25 KB, image/jpeg)
2018-04-28 17:23 UTC, mikhail.rokhin
no flags Details
Fix build with mysql >= 8.1 (7.14 KB, patch)
2018-04-29 07:32 UTC, Tobias C. Berner
no flags Details | Diff
raw patch file (2.40 KB, text/plain)
2018-04-29 17:22 UTC, Tobias C. Berner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mikhail.rokhin 2018-04-27 17:09:39 UTC
qt-everywhere-opensource-src-4.8.7/src/drivers/mysql/qsql_mysql.cpp:
397:25:
error assigning to 'bool *' from incomp type 'my_bool *' (aka 'char *')
955:33:
error: assigning to 'bool *' from incomp type 'char *'

ports tree , kernel & world latest.

Thank you for development.
Comment 1 Tobias C. Berner freebsd_committer freebsd_triage 2018-04-27 20:13:36 UTC
Hi there

Can you give me some more information? I assume this is on ARM and not i386/amd64?

mfg Tobias
Comment 2 mikhail.rokhin 2018-04-28 15:34:13 UTC
(In reply to Tobias C. Berner from comment #1)
No, it's amd64
Comment 3 Tobias C. Berner freebsd_committer freebsd_triage 2018-04-28 16:06:30 UTC
Hi there

unfortunately I cannot reproduce it here. Could you upload the complete build log?

mfg Tobias
Comment 4 mikhail.rokhin 2018-04-28 17:23:39 UTC
Created attachment 192879 [details]
qt4-mysql-plugin screenshot
Comment 5 mikhail.rokhin 2018-04-28 17:25:18 UTC
(In reply to Tobias C. Berner from comment #3)
Point me please, where is the log-file - couldn't find it. Screenshot in attachment.
Comment 6 Tobias C. Berner freebsd_committer freebsd_triage 2018-04-29 06:34:13 UTC
Hi there

You can just redirect the output to some file and uplaod that :)

Btw, which revision is your CURRENT? Maybe mine is too old.


mfg Tobias
Comment 7 Tobias C. Berner freebsd_committer freebsd_triage 2018-04-29 06:38:59 UTC
Or the better question: which mysql version do you have installed`
Comment 8 Tobias C. Berner freebsd_committer freebsd_triage 2018-04-29 06:52:20 UTC
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html 



Incompatible Change: The my_bool type is no longer used in MySQL source code. Any third-party code that used this type to represent C boolean variables should use the bool or int C type instead.
Note

The change from my_bool to bool means that the mysql.h header file now requires a C++ or C99 compiler to compile.

(Bug #25597667)
Comment 9 Tobias C. Berner freebsd_committer freebsd_triage 2018-04-29 07:32:39 UTC
Created attachment 192893 [details]
Fix build with mysql >= 8.1

Hi there

Can you apply this patch to your portstree and try again?


mfg Tobias
Comment 10 mikhail.rokhin 2018-04-29 17:17:05 UTC
(In reply to Tobias C. Berner from comment #7)
12-CURRENT r333084
mysql80-8.0.2_3

Could you include the patch in ports-tree snapshot, so I could download it with `portsnap fetch update` ?
Comment 11 Tobias C. Berner freebsd_committer freebsd_triage 2018-04-29 17:22:20 UTC
Created attachment 192913 [details]
raw patch file

(In reply to mikhail.rokhin from comment #10)
I don't think I can do that :)
Just copy the newly attached patch-file into databases/qt4-mysql-plugin/files/.

mfg Tobias
Comment 12 mikhail.rokhin 2018-04-29 19:56:27 UTC
(In reply to Tobias C. Berner from comment #11)
Thank you - it helped. 
Do you think the patch should be integrated in ports tree?
Comment 13 Tobias C. Berner freebsd_committer freebsd_triage 2018-05-02 16:51:39 UTC
(In reply to mikhail.rokhin from comment #12)
Yeah, something like this needs to be added to the tree :) otherwise buildling against any new mysql version will fail.


mfg Tobias
Comment 14 mikhail.rokhin 2018-05-05 17:44:32 UTC
(In reply to Tobias C. Berner from comment #13)
Could you be so kind and point me - how to automatically extract patches quickly from that big file?)
Is it possible to put that big file under special name into /files and `make` will automatically extract & apply needed patch?
Comment 15 commit-hook freebsd_committer freebsd_triage 2018-05-05 20:05:31 UTC
A commit references this bug:

Author: tcberner
Date: Sat May  5 20:05:09 UTC 2018
New revision: 469165
URL: https://svnweb.freebsd.org/changeset/ports/469165

Log:
  databases/qt4-mysql-plugin & databases/qt5-sqldrivers-mysql: fix build against mysql >= 8.0.1.

  From the mysql release notes [1]:

    Incompatible Change: The my_bool type is no longer used in MySQL source code.
    Any third-party code that used this type to represent C boolean variables should
    use the bool or int C type instead.

    Note
      The change from my_bool to bool means that the mysql.h header file now requires
      a C++ or C99 compiler to compile.

    (Bug #25597667)

  --

  [1] https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-1.html

  PR:		227813
  Reported by:	mikhail.rokhin@gmail.com

Changes:
  head/databases/qt4-mysql-plugin/Makefile
  head/databases/qt4-mysql-plugin/files/
  head/databases/qt4-mysql-plugin/files/patch-src_sql_drivers_mysql_qsql__mysql.cpp
  head/databases/qt5-sqldrivers-mysql/Makefile
  head/databases/qt5-sqldrivers-mysql/files/
  head/databases/qt5-sqldrivers-mysql/files/patch-src_plugins_sqldrivers_mysql_qsql__mysql.cpp
Comment 16 Tobias C. Berner freebsd_committer freebsd_triage 2018-05-05 20:16:27 UTC
Committed :) -- so you should just get directly now.
Comment 17 Valerii 2018-05-08 07:10:38 UTC
The same issue:
qsql_mysql.cpp:437:25: error: assigning to 'my_bool *' (aka 'char *') from incompatible type 'mysql_bool *' (aka 'bool *')
        bind->is_null = &f.nullIndicator;
                        ^~~~~~~~~~~~~~~~
qsql_mysql.cpp:1016:33: error: assigning to 'my_bool *' (aka 'char *') from incompatible type 'bool *'
            currBind->is_null = &nullVector[i];
                                ^~~~~~~~~~~~~~
2 errors generated.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/qt5-sqldrivers-mysql/work/qtbase-opensource-src-5.9.4/src/plugins/sqldrivers/mysql
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/qt5-sqldrivers-mysql

But currently is not fixed in the ports tree.
11.1-RELEASE-p9 FreeBSD 11.1-RELEASE-p9 #0: Tue Apr  3 16:59:16 UTC 2018     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
Comment 18 Yunchih Chen 2018-05-22 08:08:04 UTC
*** Bug 228392 has been marked as a duplicate of this bug. ***
Comment 19 Jashank Jeremy 2018-05-29 09:57:29 UTC
It looks like this patch breaks this port for MariaDB >= 10 users, as noted in bug 228392. Backing out the patch in r469165 fixes that build.
Comment 20 Henrik Hudson 2018-06-01 05:55:45 UTC
Can confirm. This is broken for MariaDB users now.
Comment 21 commit-hook freebsd_committer freebsd_triage 2018-06-01 22:17:16 UTC
A commit references this bug:

Author: adridg
Date: Fri Jun  1 22:16:41 UTC 2018
New revision: 471301
URL: https://svnweb.freebsd.org/changeset/ports/471301

Log:
  Fix build of the Qt SQL plugins for MySQL against MariaDB 10.

  Recent MySQL code has deprecated the my_bool type, so r469165
  added a check for that recent version. MariaDB pretends to be
  MySQL, and has an even newer version, which nonetheless hasn't
  taken over the drop-my_bool-type change. So my_bool still exists
  there. Assume, for now, that MariaDB has my_bool regardless,
  to fix incompatibilities reported after PR227813 was closed.

  PR:		227813
  Reported by:	Jashank Jeremy

Changes:
  head/databases/qt4-mysql-plugin/files/patch-src_sql_drivers_mysql_qsql__mysql.cpp
  head/databases/qt5-sqldrivers-mysql/files/patch-src_plugins_sqldrivers_mysql_qsql__mysql.cpp
Comment 22 Adriaan de Groot freebsd_committer freebsd_triage 2018-06-02 20:01:46 UTC
I'd appreciate it if Jashank or Henrik or another MariaDB user can confirm that this is fixed now also for those two ports against MariaDB (I tested in poudriere jails, and it seemed ok, but there may be more MariaDB varieties around than I know of).
Comment 23 Henrik Hudson 2018-06-04 04:03:59 UTC
Yeah, my poudriere setup builds it successfully now. thanks.