View Issue Details

IDProjectCategoryView StatusLast Update
0008715MMW v4DB/FileMonitorpublic2012-01-15 22:11
ReporterLudek Assigned To 
PriorityurgentSeverityminorReproducibilityunable to reproduce
Status closedResolutionwon't fix 
Product Version4.0 
Target Version4.0.1 
Summary0008715: With some databases the "Last Played Z...A" is incorrect
DescriptionOne user sent me his database and when creating an autoplaylist with sort
order Last Played Z...A, the order is incorrect. The strange thing is
the same autoplaylist criteria works fine in my database.

See attached screenshot.
Additional Informationhttp://www.mediamonkey.com/forum/viewtopic.php?f=7&t=61876&p=318818
TagsNo tags attached.
Attached Files
lastplayedsortbug.png (148,949 bytes)   
lastplayedsortbug.png (148,949 bytes)   
Fixed in build

Activities

Ludek

2011-11-17 13:09

developer   ~0028943

Last edited: 2011-11-17 13:16

I analyzed the DB and when putting following SQL into SQLViewer script:
SELECT LastTimePlayed FROM Songs ORDER BY LastTimePlayed DESC

then the first 142 values decrease from 40861,831381863 to 40836,8914583333 and the 143rd value is 40863.382355926 and then it again decreases.

i.e. the problem is clearly on the DB layer that it doesn't consider 40,1 and 40.1 as equal values when sorting.

Another question is how could the values with the comma get to his DB, with my DB all values have the dot as decimal separator. Maybe a script?

jiri

2011-11-18 08:15

administrator   ~0028947

It seems that this could happen on some combination of use locale configuration (just my guess). In order to avoid it I think that we should make sure that all floating point numbers are sent to DB using SQL parameters, not directly in SQL. I.e. something like: 'UPDATE Songs SET TrackModified=? WHERE ID=?'.

As for a fix for the existing DBs, we should make sure that the Full DB Maintenance copies floating point values in a consistent manner.

Ludek

2011-11-18 15:22

developer   ~0028970

Reminder sent to: stephen_platt

Just tested full DB maintenance - Optimize database (complete), but it doesn't fix the decimal separator for affected tracks, i.e. the comma is not converted to the dot.

Based on the code revision I haven't found how MM could write the comma decimal separator, it seems to always use dot.

@Stephen: Could you ask the user which scripts he uses and attach the forum link here?

stephen_platt

2011-11-18 15:29

developer   ~0028971

I sent him a PM, and forum link is attached above.

stephen_platt

2011-11-18 16:38

developer   ~0028974

This is the iTunes plugin that seems to cause the comma values:
http://www.mediamonkey.com/forum/viewtopic.php?f=2&t=45713&st=0&sk=t&sd=a&start=9999

jiri

2011-11-18 17:14

administrator   ~0028977

I notified the author via e-mail. Setting this as resolved, since we can't fix ourselves.

stephen_platt

2011-11-18 17:19

developer   ~0028978

Is there some SQL statement that the user could use to fix the current values in last played, to change from comma to period for the decimal marker?

peke

2012-01-15 22:11

developer   ~0029884

Confirmed 1465