Bug 1470741

Summary: mariadb library upgrade to 10.2 causes FTBFS
Product: [Fedora] Fedora Reporter: Honza Horak <hhorak>
Component: opensipsAssignee: John Khvatov <ivaxer>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: acaringi, awilliam, hhorak, ivaxer, lemenkov, ppisar
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://apps.fedoraproject.org/koschei/build/3065038
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-20 19:21:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1467297    
Attachments:
Description Flags
Proposed patch
none
Patch to allow compilation of opensips with MariaDB 10.2 none

Description Honza Horak 2017-07-13 14:35:20 UTC
Created attachment 1297702 [details]
Proposed patch

Description of problem:
With new version of MariaDB 10.2 we see basically this build issue:

my_con.c: In function 'db_mysql_connect':
my_con.c:68:10: error: 'MYSQL {aka struct st_mysql}' has no member named 'reconnect'
  ptr->con->reconnect = 0;
          ^~
make[1]: *** [../../Makefile.rules:25: my_con.o] Error 1

Comment 1 Adam Williamson 2017-07-14 02:01:09 UTC
Can you submit the patch upstream? https://github.com/OpenSIPS/opensips/pulls

I'm trying to help out with the rebuilds, and I have provenpackager privileges so I can commit fixes, but I usually prefer patches that have been submitted upstream (so we can provide a nice reference to an upstream pull request in the spec, and it's easy to see when the patch can be removed).

Comment 2 Adam Williamson 2017-07-14 02:02:31 UTC
Also, um, doesn't your patch do exactly the wrong thing? Per https://dev.mysql.com/doc/refman/5.7/en/auto-reconnect.html , you set MYSQL_OPT_RECONNECT to *0* in order to disable auto-reconnect (which is what the code wants to do, per the comment), not *1* (which is what your patch does).

Comment 3 Adam Williamson 2017-07-14 02:03:47 UTC
Also https://mariadb.com/kb/en/mariadb/mysql_optionsv/ says "my_bool reconnect= 1; /* enable reconnect */"

Comment 4 Petr Pisar 2017-07-20 05:47:08 UTC
opensips-2.2.3-3.fc27 is affected.

Comment 5 Augusto Caringi 2017-07-20 13:27:45 UTC
Created attachment 1301736 [details]
Patch to allow compilation of opensips with MariaDB 10.2

Comment 6 Augusto Caringi 2017-07-20 13:29:00 UTC
Patch updated and submitted upstream: 

https://github.com/OpenSIPS/opensips/pull/1164

Comment 7 Adam Williamson 2017-07-20 18:42:44 UTC
I've applied the patch and started a build: https://koji.fedoraproject.org/koji/taskinfo?taskID=20631719

Comment 8 Adam Williamson 2017-07-20 19:21:30 UTC
Build done: https://koji.fedoraproject.org/koji/buildinfo?buildID=920762