Opened 4 months ago

Closed 4 months ago

#13521 closed Patch - Bug Fix (fixed)

videosource table userid cannot be set to NULL

Reported by: Gary Buhrmaster Owned by: gigem
Priority: minor Milestone: 31.0
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

While looking at something else, I noticed that in videosource.cpp there is a sql statement that is not correct. Userid, in the videosource table, is created as NOT NULL.

The failure can probably produce noise in the mythtv-setup logs when one configures videosources, but it is (highly) likely that almost no one looks at the logs from running mythtv-setup unless something really bad happened.

Completely untested.

Proposed patch:

diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp
index d599fd1761..55afc1d512 100644
--- a/mythtv/libs/libmythtv/videosource.cpp
+++ b/mythtv/libs/libmythtv/videosource.cpp
@@ -296,7 +296,7 @@ class XMLTVGrabber : public MythUIComboBoxSetting
         MSqlQuery query(MSqlQuery::InitCon());
         query.prepare(
             "UPDATE videosource "
-            "SET userid=NULL, password=NULL "
+            "SET userid='', password=NULL "
             "WHERE xmltvgrabber NOT IN ( 'technovera' )");
         if (!query.exec())
             MythDB::DBError("XMLTVGrabber::Save", query);

Change History (2)

comment:1 Changed 4 months ago by gigem

Milestone: needs_triage31.0
Owner: set to gigem
Status: newassigned

comment:2 Changed 4 months ago by David Engel <dengel@…>

Resolution: fixed
Status: assignedclosed

In 40c031a971/mythtv:

Fix some minor issues with videosource entries.

Allow userid to be NULL. Change empty userids to NULL. Change
obsolete, datadirect credentials to NULL.

Based on patches from Gary Buhrmaster <gary.buhrmaster@…>.

Fixes #13521
Fixes #13522

Note: See TracTickets for help on using tickets.