[mythtv] mythtv 0.16: Problem accessing recordings with mysql < 4.1?

Martin Bene martin.bene at icomedias.com
Tue Nov 16 10:14:33 UTC 2004


I'm running into a problem when trying to access recordings in mythtv
0.16, both using mythfrontend and mythweb.

mythtv version 0.16, mysql database version is mysql 4.0.22.

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.

Am I doing something wrong or did I just miss a version requirement for
mysql somewhere in the docs?

Thanks, Martin


More information about the mythtv-dev mailing list