Permalink
Browse files

Don't insert a default value of 'none' into the icon column of the ch…

…annel table. Fixes #10610
  • Loading branch information...
stuartm committed Oct 8, 2012
1 parent 39984eb commit 563fc37cb01ce702806396ecf70657906e5d7125
@@ -115,7 +115,7 @@ package MythTV;
# schema version supported in the main code. We need to check that the schema
# version in the database is as expected by the bindings, which are expected
# to be kept in sync with the main code.
our $SCHEMA_VERSION = "1307";
our $SCHEMA_VERSION = "1308";
# NUMPROGRAMLINES is defined in mythtv/libs/libmythtv/programinfo.h and is
# the number of items in a ProgramInfo QStringList group used by
@@ -5,7 +5,7 @@
"""
OWN_VERSION = (0,26,-1,1)
SCHEMA_VERSION = 1307
SCHEMA_VERSION = 1308
NVSCHEMA_VERSION = 1007
MUSICSCHEMA_VERSION = 1018
PROTO_VERSION = '75'
@@ -57,7 +57,7 @@
* mythtv/bindings/php/MythBackend.php
#endif
#define MYTH_DATABASE_VERSION "1307"
#define MYTH_DATABASE_VERSION "1308"
MBASE_PUBLIC const char *GetMythSourceVersion();
@@ -36,7 +36,7 @@ DBChannel::DBChannel(
uint _sourceid, uint _cardid, uint _grpid) :
channum(_channum),
callsign(_callsign),
name(_name), icon((_icon == "none") ? QString() : _icon),
name(_name), icon(_icon),
chanid(_chanid),
major_chan(_major_chan), minor_chan(_minor_chan),
mplexid((_mplexid == 32767) ? 0 : _mplexid),
@@ -2277,6 +2277,17 @@ NULL
return false;
}
if (dbver == "1307")
{
const char *updates[] = {
"ALTER TABLE channel MODIFY COLUMN icon varchar(255) NOT NULL DEFAULT '';",
NULL
};
if (!performActualUpdate(&updates[0], "1308", dbver))
return false;
}
return true;
}
@@ -2381,7 +2392,7 @@ bool InitializeMythSchema(void)
" sourceid int(10) unsigned DEFAULT NULL,"
" callsign varchar(20) NOT NULL DEFAULT '',"
" `name` varchar(64) NOT NULL DEFAULT '',"
" icon varchar(255) NOT NULL DEFAULT 'none',"
" icon varchar(255) NOT NULL DEFAULT '',"
" finetune int(11) DEFAULT NULL,"
" videofilters varchar(255) NOT NULL DEFAULT '',"
" xmltvid varchar(255) NOT NULL DEFAULT '',"
@@ -171,10 +171,9 @@ void IconData::UpdateSourceIcons(uint sourceid)
"FROM (channel ch, callsignnetworkmap csm) "
"RIGHT JOIN networkiconmap nim ON csm.network = nim.network "
"WHERE ch.callsign = csm.callsign AND "
" (icon = :NOICON OR icon = '') AND "
" icon = '' AND "
" ch.sourceid = :SOURCEID");
query.bindValue(":SOURCEID", sourceid);
query.bindValue(":NOICON", "none");
if (!query.exec())
{
@@ -556,6 +555,6 @@ void IconData::ResetIconMap(bool reset_icons)
if (reset_icons)
{
RunSimpleQuery("UPDATE channel SET icon = 'none'");
RunSimpleQuery("UPDATE channel SET icon = ''");
}
}

0 comments on commit 563fc37

Please sign in to comment.