[mythtv-commits] Ticket #12320: Services API GetSetting is Case Sensitive
MythTV
noreply at mythtv.org
Thu Nov 13 23:08:33 UTC 2014
#12320: Services API GetSetting is Case Sensitive
-------------------------------------------------+-------------------------
Reporter: drew@… | Owner:
Type: Bug Report - General | Status: new
Priority: minor | Milestone: unknown
Component: MythTV - Services API - Backend | Version: 0.27.4
Severity: medium | Keywords: services
Ticket locked: 0 | api
-------------------------------------------------+-------------------------
https://github.com/MythTV/mythtv/blob/ef8694a20a3db8f1da91e78074314cdc635f6cf9/mythtv/programs/mythbackend/services/myth.cpp#L645
GetSetting performs a SQL select against the given hostname, but also
against any hostname not defined for a key. Then it loops through to find
the corresponding value to use, comparing the provided hostname with the
DB hostname. In the case of MySQL and other default case-insensitive
databases, this causes problems.
In this case where the function is provided the hostname 'HTPC' and key of
'BackendServerIP'. The DB has hostname 'htpc' instead. The select
statement returns the correct row, however the if statement does not
select this. Instead it returns no value at all because it didn't 'find'
it in the loop.
A simple patch:
(sHostName.toLower() == query.value(1).toString().toLower())
--
Ticket URL: <https://code.mythtv.org/trac/ticket/12320>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list