Modify

Opened 4 months ago

Closed 7 weeks ago

Last modified 3 weeks ago

#13093 closed Bug Report - General (Fixed)

'MYSQL {aka struct st_mysql}' has no member named 'reconnect'

Reported by: Richard Shaw <hobbes1069@…> Owned by: dhampton
Priority: minor Milestone: 29.1
Component: Plugin - MythZoneminder Version: 0.28.1
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I am currently unable to build MythTV on Fedora Rawhide (future F27 release). Apparently there was an API regression with mariadb 10.2.X...

g++ -c -pipe -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mcpu=power8 -mtune=power8 -fomit-frame-pointer -fno-devirtualize -fomit-frame-pointer -fPIC -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -maltivec -mabi=altivec -pthread -g -Wall -Wpointer-arith -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -fvisibility-inlines-hidden -Wmissing-declarations -Wno-switch -Woverloaded-virtual -funit-at-a-time -fomit-frame-pointer -std=gnu++11 -Wall -W -fPIC -D_GNU_SOURCE -DPREFIX="/usr" -Dusing_libcec -D_FILE_OFFSET_BITS=64 -Dlinux -I. -isystem /usr/include/libxml2 -isystem /usr/include/X11 -I/builddir/build/BUILD/mythtv-0.28.1/fakeroot/usr/include -I/usr/lib64/qt5/mkspecs/linux-g++ -o zmserver.o zmserver.cpp
zmserver.cpp: In function 'void connectToDatabase()':
zmserver.cpp:186:14: error: 'MYSQL {aka struct st_mysql}' has no member named 'reconnect'
     g_dbConn.reconnect = 1;
              ^~~~~~~~~
make[2]: *** [Makefile:380: zmserver.o] Error 1

See the following for more details: https://jira.mariadb.org/browse/MDEV-12950

Attachments (0)

Change History (13)

comment:1 Changed 4 months ago by Gary Buhrmaster <gary.buhrmaster@…>

If it helps the mythzoneminder wrangler, here is a completely untested prototype patch (neither compile tested, nor functionally tested):

--- a/mythplugins/mythzoneminder/mythzmserver/zmserver.cpp
+++ b/mythplugins/mythzoneminder/mythzmserver/zmserver.cpp
@@ -183,7 +183,8 @@ void connectToDatabase(void)
         exit(mysql_errno(&g_dbConn));
     }
 
-    g_dbConn.reconnect = 1;
+    my_bool reconnect = 1;
+    mysql_options(&g_dbConn, MYSQL_OPT_RECONNECT, &reconnect);
 
     if (!mysql_real_connect(&g_dbConn, g_server.c_str(), g_user.c_str(),
          g_password.c_str(), 0, 0, 0, 0))

comment:2 follow-up: Changed 4 months ago by Richard Shaw <hobbes1069@…>

Compilation succeeded but no good way to test functionality on a development branch... I guess we'll worry about it when it becomes a real release.

comment:3 in reply to: ↑ 2 Changed 4 months ago by Gary Buhrmaster <gary.buhrmaster@…>

Replying to Richard Shaw <hobbes1069@…>:

Compilation succeeded but no good way to test functionality on a development branch... I guess we'll worry about it when it becomes a real release.

Thanks for the feedback.

I am sort of hoping that the usual suspects for mythzoneminder (Paul H?) can test in his environment when sufficient free time heads his way. The patch *should* be backwards compatible for any reasonably current version of mysql and/or mariadb, but I do not have anywhere near a sufficiently robust builder environment to even test builds on all the platforms the project supports (and I really do not want to create builders for all of them).

comment:4 Changed 4 months ago by Richard Shaw <hobbes1069@…>

I currently have the spec file set to only apply the patch on Fedora 27/Rawhide but I could perform a local build with it applied, however, I don't use the zoneminder functionality so I'm not sure it would tell me anything.

comment:5 Changed 4 months ago by Richard Shaw <hobbes1069@…>

The problem is with the current version of python-mysql...

https://bugzilla.redhat.com/show_bug.cgi?id=1472985

comment:6 Changed 4 months ago by Gary Buhrmaster <gary.buhrmaster@…>

I believe that BZ is a completely different issue. But I'll let the experts make that determination.

(the use of an internal structure member reconnect may have been required at some point in the past, but is not a good idea after the ability to set options was made available; mythtv should be fixed to use the mysql_options api.)

comment:7 Changed 2 months ago by stuarta

  • Milestone changed from needs_triage to 29.1
  • Owner set to paulh
  • Status changed from new to assigned

comment:8 Changed 8 weeks ago by dhampton

Apparently this isn't an API regression. Back in 2004 MySql? added the option flag for specifying reconnection. MariaDb? has finally removed the obsolete method of directly tweaking the reconnect bit.

comment:9 Changed 7 weeks ago by dhampton

  • Owner changed from paulh to dhampton
  • Status changed from assigned to accepted

comment:10 Changed 7 weeks ago by David Hampton <mythtv@…>

In 9d50b38ad69a19a8a6cc2d739171c3a1e4fcf8fb/mythtv:

Use mysql_options() to specify reconnection.

MySQL added the option flag for specifying reconnection back in 2004,
to be used instead of directly tweaking the bit inside a structure.
Apparently MariaDB has finally removed the obsolete method of directly
tweaking the reconnect bit. This has been compile tested but not
functionality tested.

Trac: Refs #13093

comment:11 Changed 7 weeks ago by dhampton

  • Resolution set to Fixed
  • Status changed from accepted to closed

comment:12 Changed 3 weeks ago by Gary Buhrmaster <gary.buhrmaster@…>

fwiw, I think one may want to consider cherrypicking my patch to fixes/29 (and maybe fixes/0.28)? F27 (at least) ships with the new(er) mariadb libraries, and F27 should be released next week (or RSN in any case), so more people may start seeing this going forward as v29 is likely to be the new normal for some time and other distros will likely catch up with their mariadb libraries. [I would suspect Richard Shaw may be carrying a local rpmfusion patch for F27/rawhide, but it would likely be better if fixed upstream]

FD: Why, yes, I did (after weeks) finally look at the buildbot waterfall to determine if any of my builders were broken and noticed one of my builders is (still) red.

comment:13 Changed 3 weeks ago by dhampton

I thought I had already done that. Its now committed to fixes/29 and fixes/0.28.

Add Comment

Modify Ticket

Action
as closed The owner will remain dhampton.
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.