Opened 13 years ago

Closed 13 years ago

#3743 closed patch (worksforme)

nuvexport --mode=nuv_sql fails due to wrong hash key

Reported by: Tom Metro <tmetro+mythtv-bugs@…> Owned by: xris
Priority: minor Milestone: unknown
Component: perl / nuvexport Version: head
Severity: high Keywords:
Cc: Ticket locked: no

Description

With nuvexport-0.4-0.20070630, running nuvexport --mode=nuv_sql produces a .sql file like:

USE mythconverg;

;

;

;

;


The cause was tracked down to the use of $episode->{'recstartts'} as a query parameter. On my system, when I dumped the contents of $episode, there was no 'recstartts' key. There was, however a 'start_time' key.

It appears this problem was introduced in commit r13085 where the key was changed from 'starttime' to 'recstartts'. (There's also no 'starttime' key in the hash I see.) (It appears the current version in SVN still has this problem.) (See also ticket #2962.)

I've attached a patch that corrects the key name to 'start_time', which I think works correctly. (It also makes the module NUV_SQL.pm "use strict" compliant.)

I'd recommend adding some error checking to the loop so it produces a warning when no data is returned. Probably a check that neither of the query parameters are null would be good too. Let me know if you'd like a patch for those.

It may also be worth upgrading $episode to an object (say a Class::Accessor subclass) so that method calls are used instead of hash key lookups, avoiding these unnoticed naming mismatches.

-Tom

Attachments (1)

NUV_SQL.pm.patch (1.2 KB) - added by Tom Metro <tmetro+mythtv-bugs@…> 13 years ago.
patch of NUV_SQL.pm to correct key name used for recording start time

Download all attachments as: .zip

Change History (2)

Changed 13 years ago by Tom Metro <tmetro+mythtv-bugs@…>

Attachment: NUV_SQL.pm.patch added

patch of NUV_SQL.pm to correct key name used for recording start time

comment:1 Changed 13 years ago by xris

Resolution: worksforme
Status: newclosed

Please make sure you are using the latest version of the perl bindings to go along with the svn version of nuvexport.

Note: See TracTickets for help on using tickets.