diff options
authorMichael T. Dean <>2012-01-20 20:55:46 (GMT)
committer Michael T. Dean <>2012-01-20 21:01:41 (GMT)
commita99ab35f2094c8d6c3b61751fe0eaec466d87cb0 (patch)
parentb1519960f11f55dadf63d9cc3b242dd15e1e035a (diff)
Fix warnings in 1262 DB upgrade.
Fix warnings that can occur in the 1262 DB upgrade if any of the columns being changed to varchar contain NULL values. These warnings resulted in a DB upgrade failure for a at least one user, but in attempting to reproduce the failure (with Qt4.6.2+MySQL5.1, Qt4.6.2+MySQL5.5, Qt4.7.3+MySQL5.1, Qt4.8.0+MySQL5.1, and Qt4.8.0+MySQL5.5), I was unsuccessful. The only way I was able to cause it to fail was with MySQL strict mode enabled (sql_mode=STRICT_ALL_TABLES). Note that many other parts of MythTV are likely to fail with strict mode enabled, so it is recommended that users do not enable strict mode. Thanks to dchilton for reporting the issue, and to JK for helping to troubleshoot. (cherry picked from commit 96cf1cfcecae7a3ce7f27c2485bb0486f0bdff0b)
1 files changed, 10 insertions, 0 deletions
diff --git a/mythtv/libs/libmythtv/dbcheck.cpp b/mythtv/libs/libmythtv/dbcheck.cpp
index 9912bf8..1ed3aaf 100644
--- a/mythtv/libs/libmythtv/dbcheck.cpp
+++ b/mythtv/libs/libmythtv/dbcheck.cpp
@@ -5452,6 +5452,16 @@ NULL
if (dbver == "1261")
const char *updates[] = {
+"UPDATE program SET description = '' WHERE description IS NULL;",
+"UPDATE record SET description = '' WHERE description IS NULL;",
+"UPDATE recorded SET description = '' WHERE description IS NULL;",
+"UPDATE recordedprogram SET description = '' WHERE description IS NULL;",
+"UPDATE oldrecorded SET description = '' WHERE description IS NULL;",
+"UPDATE mythlog SET details = '' WHERE details IS NULL;",
+"UPDATE settings SET data = '' WHERE data IS NULL;",
+"UPDATE powerpriority SET selectclause = '' WHERE selectclause IS NULL;",
+"UPDATE customexample SET fromclause = '' WHERE fromclause IS NULL;",
+"UPDATE customexample SET whereclause = '' WHERE whereclause IS NULL;",
"ALTER TABLE program MODIFY COLUMN description VARCHAR(16000) "
" NOT NULL default '';",
"ALTER TABLE record MODIFY COLUMN description VARCHAR(16000) "