Revision 5bf3f7b...

Go back to digest for 20th May 2012

Bug Fixes in Multimedia

Matěj Laitl committed changes in [amarok] /:

DB: change lyrics table: text url -> integer url pointing to the urls table

I believe that the old lyrics table structure was more or less a mistake:
TABLE lyrics (
id INTEGER PRIMARY KEY, -- actually never used in code
url VARBINARY(324), -- actually a rpath from urls table
lyrics TEXT

Apart from data duplication and non-conformity to the "update anomaly"
requirement of the database design, there was additional problem that rpath
itself is not unique. The (deviceId, rpath) is.

This change makes the lyrics table look more sane:
TABLE lyrics (
url INTEGER PRIMARY KEY, -- points to column
lyrics TEXT

with an effort to transition existing entries. The transition of 5000
lyrics entries takes 16s on my 2.5 GHz Core i5 (one core used), so it
should be acceptable.

This is the first time I'm changing db structure, I'd be glad to
receive thorough review, namely of the update13to14() method and
especially the duplicate-removing query. This is critical because
database-corrupting fault would leave many Amarok users in a state
where they would need to drop their database to make Amarok working

ChangeLog of the unrelated iPod fix is updated because DB_VERSION bump
triggers full collection rescan as far as it is documented.

REVIEW: 104966

File Changes

Modified 5 files
  •   ChangeLog
  •   HACKING/mysql_database_schema.txt
  •   src/core-impl/collections/db/sql/DatabaseUpdater.cpp
  •   src/core-impl/collections/db/sql/DatabaseUpdater.h
  •   src/core-impl/collections/db/sql/SqlMeta.cpp
5 files changed in total