Opened 19 months ago

Closed 18 months ago

Last modified 16 months ago

#13220 closed Bug Report - General (Won't Fix)

QSqlDatabase::setConnectOptions() being called with illegal connect option value

Reported by: mythtv-trac@… Owned by: Peter Bennett
Priority: minor Milestone: 29.1
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

In https://code.mythtv.org/trac/changeset/119d733d/mythtv/mythtv/libs/libmythbase/mythdbcon.cpp code was added to call:

m_db.setConnectOptions(QString("MYSQL_OPT_READ_TIMEOUT=300"));

but you can't pass arbitrary strings to QSqlDatabase ::setConnectOptions(). See the man page at https://www.ics.com/files/qtdocs/qsqldatabase.html#setConnectOptions and notice that only a few specific strings are permitted for each database type, and "MYSQL_OPT_READ_TIMEOUT" is not one of them.

Because of this recent code addition, any processes that open a connection to the database result in messages like this:

myth:~# mythfilldatabase --verbose general --loglevel info --quiet --syslog local7
QMYSQLDriver::open: Illegal connect option value 'MYSQL_OPT_READ_TIMEOUT=300'
QMYSQLDriver::open: Illegal connect option value 'MYSQL_OPT_READ_TIMEOUT=300'
QMYSQLDriver::open: Illegal connect option value 'MYSQL_OPT_READ_TIMEOUT=300'
myth:~#

Please remove this code (and the associated comment) from master and backport the change to 0.29+fixes.

Thanks.

Change History (7)

comment:1 Changed 19 months ago by mythtv-trac@…

Ah, I see now that setting "MYSQL_OPT_READ_TIMEOUT" is present in Qt 5, but trusty is still using libqt4-sql-mysql (4.8.5) and this option string is not present prior to Qt 5.

If this new code is definitely required, Is there a way to make calling setConnectOptions() dependent on the Qt version since is has no effect (and generates spurious output) in Qt 4?

comment:2 Changed 19 months ago by Peter Bennett

Owner: set to Peter Bennett
Status: newassigned

I was just about to point that out :)

I was under the impression that we are only supporting qt5 at this point. I don't know if there is any benefit to making that change just to avoid a message. After qt4 is gone a change to test for version would be superfluous code unless somebody remembered to remove it.

comment:3 Changed 18 months ago by mythtv-trac@…

Even though this does affect MythTV 29 (and later) running on Ubuntu 14.04, it's probably fine to close this ticket given that it doesn't actually break anything.

If nothing else, maybe this ticket will show up in some Google search results and can serve as an explanation as to why someone running MythTV 29 or newer on trusty sees the "Illegal connect option" message and will know it can be safely ignored.

comment:4 Changed 18 months ago by Stuart Auchterlonie

What database version do you have?

What qt version is your mythtv installation using?

Please supply output from mythfrontend --version

Regards Stuart

comment:5 Changed 18 months ago by Peter Bennett

Resolution: Won't Fix
Status: assignedclosed

Closing this because it only occurs with qt4 which we will stop supporting, and it only displays a message, does not cause any harm (apart from the possibility of very long database timeouts if the database goes away).

comment:6 Changed 18 months ago by Stuart Auchterlonie

Milestone: needs_triage29.1

comment:7 Changed 16 months ago by Peter Bennett

Owner: changed from Peter Bennett to Peter Bennett
Note: See TracTickets for help on using tickets.