Opened 14 years ago

Closed 14 years ago

#8733 closed defect (fixed)

(insert|update)_dtv_multiplex debug output does not include values being updated

Reported by: Nick Morrott <knowledgejunkie (at) gmail (dot) com> Owned by: robertm
Priority: minor Milestone: 0.24
Component: MythTV - Channel Scanner Version: Master Head
Severity: medium Keywords: channel scanner debug log output
Cc: Ticket locked: no

Description

The VB_CHANSCAN output emitted to the logfile when insert_dtv_multiplex() in called (line 193 of mythtv/libs/libmythtv/channelutil.cpp) does not contain the actual values of the settings being inserted/updated. Instead, the string contains the names of the variables being bound in the SQL query but not their values.

This results in the log being "spammed" with the following duplicated line for each channel added (and for DVB-S, this can be several hundred channels).

INSERT INTO dtv_multiplex   (sourceid,        sistandard,        frequency,  modulation, transportid, networkid, symbolrate, bandwidth, polarity, inversion, transmission_mode, fec, constellation, hierarchy, hp_code_rate, lp_code_rate, guard_interval, mod_sys, rolloff) VALUES   (:SOURCEID,      :SISTANDARD,       :FREQUENCY1, :MODULATION, :TRANSPORTID, :NETWORKID, :SYMBOLRATE, :BANDWIDTH, :POLARITY, :INVERSION, :TRANS_MODE, :INNER_FEC, :CONSTELLATION, :HIERARCHY, :HP_CODE_RATE, :LP_CODE_RATE, :GUARD_INTERVAL, :MOD_SYS, :ROLLOFF);

The log of a full UK DVB-T scan which includes this is attached to #8731

Attachments (1)

channelutil.logging.diff (1019 bytes) - added by robertm 14 years ago.
Output last executed query in logging of channel scanner.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 years ago by robertm

Owner: changed from danielk to Stuart Auchterlonie
Status: newassigned

comment:2 Changed 14 years ago by robertm

Status: assignedinfoneeded

Nick, can you please test this patch?

Changed 14 years ago by robertm

Attachment: channelutil.logging.diff added

Output last executed query in logging of channel scanner.

comment:3 Changed 14 years ago by robertm

Resolution: fixed
Status: infoneededclosed

(In [26188]) Change the logging of insert and update in VB_CHANSCAN to display bound values-- haven't actually tested this, but it ought to fix #8733.

comment:4 Changed 14 years ago by Nick Morrott <knowledgejunkie <at> gmail <dot> com>

In testing with a debug build of r26195, the update did not fix the issue but replaced each bound variable's name with a question mark. First few inserts follow:

2010-09-10 08:44:59.348 New DB DataDirect connection
2010-09-10 08:44:59.349 Connected to database 'mythconverg' at host: localhost
2010-09-10 08:44:59.351 insert_dtv_multiplex(1, 'dvb', 746000000, auto, 24576, 9018...) mplexid:0
2010-09-10 08:44:59.352 insert_dtv_multiplex -- insert 0
INSERT INTO dtv_multiplex   (sourceid,        sistandard,        frequency,  modulation, transportid, networkid, symbolrate, bandwidth, polarity, inversion, transmission_mode, fec, constellation, hierarchy, hp_code_rate, lp_code_rate, guard_interval, mod_sys, rolloff) VALUES   (?,      ?,       ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);

2010-09-10 08:44:59.352 insert_dtv_multiplex -- inserted 1
Insert(dvb): 18
2010-09-10 08:44:59.355 insert_dtv_multiplex(1, 'dvb', 746000000, auto, 24576, 9018...) mplexid:1
2010-09-10 08:44:59.356 insert_dtv_multiplex -- update 1
UPDATE dtv_multiplex SET frequency    = ?, modulation       = ?, symbolrate       = ?, bandwidth        = ?, polarity         = ?, inversion        = ?, transmission_mode= ?, fec              = ?, constellation    = ?, hierarchy        = ?, hp_code_rate     = ?, lp_code_rate     = ?, guard_interval   = ?, mod_sys          = ?, rolloff          = ? WHERE sourceid    = ?      AND       sistandard  = ?    AND  transportid = ? AND networkid = ? 

Insert(dvb): 21
2010-09-10 08:44:59.359 insert_dtv_multiplex(1, 'dvb', 746000000, auto, 24576, 9018...) mplexid:1
2010-09-10 08:44:59.360 insert_dtv_multiplex -- update 1
UPDATE dtv_multiplex SET frequency    = ?, modulation       = ?, symbolrate       = ?, bandwidth        = ?, polarity         = ?, inversion        = ?, transmission_mode= ?, fec              = ?, constellation    = ?, hierarchy        = ?, hp_code_rate     = ?, lp_code_rate     = ?, guard_interval   = ?, mod_sys          = ?, rolloff          = ? WHERE sourceid    = ?      AND       sistandard  = ?    AND  transportid = ? AND networkid = ? 

Insert(dvb): 12
2010-09-10 08:44:59.363 insert_dtv_multiplex(1, 'dvb', 746000000, auto, 24576, 9018...) mplexid:1
2010-09-10 08:44:59.364 insert_dtv_multiplex -- update 1
UPDATE dtv_multiplex SET frequency    = ?, modulation       = ?, symbolrate       = ?, bandwidth        = ?, polarity         = ?, inversion        = ?, transmission_mode= ?, fec              = ?, constellation    = ?, hierarchy        = ?, hp_code_rate     = ?, lp_code_rate     = ?, guard_interval   = ?, mod_sys          = ?, rolloff          = ? WHERE sourceid    = ?      AND       sistandard  = ?    AND  transportid = ? AND networkid = ? 

On a more general note, why does the log output not include the channel data being inserted (which is always different) and instead duplicate the same multiplex information a dozen or more times? Would it not be more useful to first log the list of muxes being inserted/updated, and then log the list of channels being inserted from the scan?

comment:5 Changed 14 years ago by Stuart Auchterlonie

Milestone: unknown0.24
Resolution: fixed
Status: closednew

I'll look at this over the weekend

comment:6 Changed 14 years ago by robertm

Status: newassigned

comment:7 Changed 14 years ago by robertm

Owner: changed from Stuart Auchterlonie to robertm

comment:8 Changed 14 years ago by robertm

Resolution: fixed
Status: assignedclosed

(In [26357]) Remove a bit of logging regard channel insert and updates entirely. It occurs to me that if you really want to see what the DB is doing, you should be using the VB_DATABASE verbosity anyway, in which case the bound values will be visible. Fixes #8733.

Note: See TracTickets for help on using tickets.