[mythtv] mySQL 4.1.x causes grave instability

Martin Bene martin.bene at icomedias.com
Mon Dec 13 07:30:28 UTC 2004


> Is anyone successfully running myth against mysql-4.1.x? I upgraded to
> mysql 4.1.x last night, recompiled qt, php, samba, libwww, and
> everything else that linked to mysql libs. I even recompiled myth for
> good measure.

I'm running mythtv 0.16 against mysql 4.0, and had just one problem:
Anything trying to get a list of recoreded programs would fail:

mythbackend doesn't send the list of recoreded programs after receiving
a QUERY_RECORDINGS request ; it does output an error message:

	NULL in string in list in WriteStringList

I traced that back to a problem with lastmodified in
MainServer::HandleQueryRecordings.

The problem seems to be the output format for fields of datatype
timestamp:

mysql> select starttime, lastmodified from recorded;
+---------------------+----------------+
| starttime           | lastmodified   |
+---------------------+----------------+
| 2004-11-14 17:00:00 | 20041115212118 |
| 2004-11-15 16:34:00 | 20041115171500 |
| 2004-11-15 17:45:00 | 20041115184500 |
| 2004-11-15 18:55:00 | 20041115192500 |
| 2004-11-15 20:15:00 | 20041115212118 |
| 2004-11-15 23:15:00 | 20041116001000 |
+---------------------+----------------+

The output format for the timestamp column fails to parse in 

proginfo->lastmodified =
                      QDateTime::fromString(query.value(24).toString(),
                                            Qt::ISODate);

And this results in the null string.


This difference in output is specified in the mysql manual
(http://dev.mysql.com/doc/mysql/en/DATETIME.html) as occuring for
versions prior to 4.1. Workaround for me: I modified the query to use
	"date_format(recorded.lastmodified,'%Y-%m-%d %H:%i:s') as
lastmodified "
instead of unformated lastmodified field.

Bye, Martin


More information about the mythtv-dev mailing list