[mythtv] Re: [mythtv-commits] Re: Ticket #76: mythgame makes two Calls to the Database when only one will do the job.

Robert Johnston anaerin at gmail.com
Sat Jul 9 17:14:06 EDT 2005


On 08/07/05, Korey Fort <k.m.fort at gmail.com> wrote:
> As you said, "there was a very real possibility that more than one row could
> exist either through bugs in work in progress or manually added in a test
> DB. "  Is that still not now a possibility? What if the DELETE fails for
> some reason and the INSERT works? It's like you said, "Better safe than
> stupid."
> 
> "There is no reason for any bogus old values to exist, no matter what the
> cause, when this is reset on an update."  There would be no bogus old
> values.
> It would update every row where the value is equal to GameDBSchemaVer.
> 
> You know it actually does say, "wontfix" on the ticket (right side about a
> third of the way through, next to Resolution.)
> I have no problem with the decision to not accept it. I was not looking for
> any ego bolstering; I was only looking for some way to help. Now could
> everyone quit being some damn sensitive!  :-)
> 
> "Let ye without segmentation fault cast the first int!"

I'm not certain here (My Experience is more in MSSQL than MySQL), but
would this not cause problems?

If there are two differing entries (From a former problem and/or
test), the existing code would delete both and replace them with a
single, correct, entry.

Your code, however, would result in two lines with the identical
version number (As both would be UPDATEd), which would mean data
duplication and potential wasting of DB space (Well, not that
significantly, but about as much space wasted as doing two operations
would waste in time).

And if you're THAT worried about it failing, how about wrapping the
whole thing in a transaction (Talk about overkill!)?

On another note, and as a complete aside, what is the deal with all
the SELECT NULL's going on in MythTV? It seems whenever Myth wants to
do ANY action on the DB it tries a "SELECT NULL" first. Is it checking
the DB is still alive or something?
-- 
Robert "Anaerin" Johnston


More information about the mythtv-dev mailing list