[mythtv-users] Recordings not working

Gary Buhrmaster gary.buhrmaster at gmail.com
Sun May 23 17:53:12 UTC 2021


On Sun, May 23, 2021 at 4:16 PM Gary Buhrmaster
<gary.buhrmaster at gmail.com> wrote:
>
> On Sun, May 23, 2021 at 1:32 PM Peter Bennett <pb.mythtv at gmail.com> wrote:
>
> > Does everybody get the series of "Error preparing query" messages seen
> > by the original poster? I am on 20.04, mysql-server
> > 8.0.23-0ubuntu0.20.04.1.  I checked my logs and have no messages like that.
>
> Without any proof, I am suspicious of
> the recent ubuntu libmysqlclient21 upgrade
> in ubuntu (to the ...8.0.25 version) which
> would have been made available to
> users around ten days ago.

Looking at the git log between the previous
...8.0.23 and the current ...8.0.25 version,
there appears to be at least one place where
the previous 2006 error code (gone) has
been replaced with a 2013 error code (lost),
although I can't easily determine if it is
propagated elsewhere.  While, in theory,
2013 should occur only when a long
request times out, there could be cases
where one gets it with other timeouts,
and perhaps mythtv should handle both
cases with an attempted reconnect.

Perhaps someone wants to try to add
both cases to mythdbcon.cpp.  100%
untested (not compile tested, not installed,
and not run(*)) proposal would be something
like:

-----

diff --git a/mythtv/libs/libmythbase/mythdbcon.cpp
b/mythtv/libs/libmythbase/mythdbcon.cpp
index 5e933322e7..610dc8b996 100644
--- a/mythtv/libs/libmythbase/mythdbcon.cpp
+++ b/mythtv/libs/libmythbase/mythdbcon.cpp
@@ -642,7 +642,8 @@ bool MSqlQuery::exec()
     // Close and reopen the database connection and retry the query if it
     // connects again
     if (!result
-        && QSqlQuery::lastError().nativeErrorCode() == "2006"
+        && ((QSqlQuery::lastError().nativeErrorCode() == "2006") ||
+            (QSqlQuery::lastError().nativeErrorCode() == "2013" ))
         && Reconnect())
         result = QSqlQuery::exec();

@@ -760,7 +761,8 @@ bool MSqlQuery::exec(const QString &query)
     // Close and reopen the database connection and retry the query if it
     // connects again
     if (!result
-        && QSqlQuery::lastError().nativeErrorCode() == "2006"
+        && ((QSqlQuery::lastError().nativeErrorCode() == "2006") ||
+            (QSqlQuery::lastError().nativeErrorCode() == "2013" ))
         && Reconnect())
         result = QSqlQuery::exec(query);

@@ -863,7 +865,8 @@ bool MSqlQuery::prepare(const QString& query)
     // Close and reopen the database connection and retry the query if it
     // connects again
     if (!ok
-        && QSqlQuery::lastError().nativeErrorCode() == "2006"
+        && ((QSqlQuery::lastError().nativeErrorCode() == "2006") ||
+            (QSqlQuery::lastError().nativeErrorCode() == "2013" ))
         && Reconnect())
         ok = true;

-----


(*) I believe of most distros, primarily canonical, through
their "partnership" with oracle (i.e. almost certainly a
payment) defaults to using the mysql rather than mariadb.
So I do not have any mysql derived libraries installed.


More information about the mythtv-users mailing list