[mythtv] channel.channum too narrow
Tony Brummett
brummett at gmail.com
Wed Jan 18 16:56:14 UTC 2006
I recently got my hd-3000 card tuning QAM channels from my cable
provider, and some of the channum strings that the channel scanner
tried to insert into the database were longer than 5 characters. For
example, '102#10' was silently truncated to '102#1' , resulting in 2
rows with channum '102#1'. Making that column 6 characters wide
seemed to fix the problem for me.
I believe this patch should fix it, if I understand the way schema
updates are done...
Index: libs/libmythtv/dbcheck.cpp
===================================================================
--- libs/libmythtv/dbcheck.cpp (revision 8641)
+++ libs/libmythtv/dbcheck.cpp (working copy)
@@ -10,7 +10,7 @@
#include "mythdbcon.h"
/// This is the DB schema version expected by the running MythTV instance.
-const QString currentDatabaseVersion = "1121";
+const QString currentDatabaseVersion = "1122";
static bool UpdateDBVersionNumber(const QString &newnumber);
static bool performActualUpdate(const QString updates[], QString version,
@@ -1980,6 +1980,16 @@
return false;
}
+ if (dbver == "1121")
+ {
+ const QString updates[] = {
+"ALTER TABLE channel CHANGE channum channum VARCHAR(5) NOT NULL DEFAULT '';",
+""
+};
+ if (!performActualUpdate(updates, "1122", dbver))
+ return false;
+ }
+
// Drop xvmc_buffer_settings table in 0.20
// Drop dvb_dmx_buf_size and dvb_pkt_buf_size columns of channel in 0.20
-- Tony brummett at gmail.com
More information about the mythtv-dev
mailing list