PacketFence - BTS - PacketFence
View Issue Details
0001162PacketFencecorepublic2011-01-21 17:062011-01-26 15:44
fgaudreault 
obilodeau 
normalminoralways
closedfixed 
2.0.0 
2.0.12.0.1 
367fb3f1a9e7fcd0c86bcd814f1901cfff376ead
0001162: Node view database query reporting wrong values
In some cases, the node view all database query will report wrong values in the node page. This is caused by an ordering problem in the locationlog table.
No tags attached.
Issue History
2011-01-21 17:06fgaudreaultNew Issue
2011-01-21 17:06fgaudreaultTarget Version => 2.0.1
2011-01-21 17:19obilodeaumtn revision => 03a12d56a57618221c4217e0a4b4b4c7accf0396
2011-01-21 17:19obilodeauNote Added: 0001831
2011-01-21 17:19obilodeauStatusnew => resolved
2011-01-21 17:19obilodeauFixed in Version => 2.0.1
2011-01-21 17:19obilodeauResolutionopen => fixed
2011-01-21 17:19obilodeauAssigned To => obilodeau
2011-01-21 17:28obilodeauNote Added: 0001832
2011-01-21 17:28obilodeauStatusresolved => feedback
2011-01-21 17:28obilodeauResolutionfixed => reopened
2011-01-24 17:32obilodeaumtn revision03a12d56a57618221c4217e0a4b4b4c7accf0396 => 367fb3f1a9e7fcd0c86bcd814f1901cfff376ead
2011-01-24 17:32obilodeauNote Added: 0001833
2011-01-24 17:32obilodeauStatusfeedback => resolved
2011-01-24 17:32obilodeauResolutionreopened => fixed
2011-01-26 15:44obilodeauStatusresolved => closed

Notes
(0001831)
obilodeau   
2011-01-21 17:19   
Instead of the LEFT JOIN were we hoped we would get proper results we are now using a sorted subselect that does the right thing everywhere.
(0001832)
obilodeau   
2011-01-21 17:28   
Turns out the fix is no good. The subselect only fetches the absolute last start_time no matter the MAC so it only fits for one MAC and the rest of the rows are empty.
(0001833)
obilodeau   
2011-01-24 17:32   
The subselect with a LIMIT 1 only worked for a single record and not the entire node view so it had to be reverted. Any other attempts I made in that direction were either too slow or incorrect.

I settled on a solution that involves not always having the last_... information by joining when end_time is null. This makes sure that the locationlog is always accurate at the cost of losing the information on closed entries.