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

Matěj Laitl matej at laitl.cz
Wed May 16 13:51:48 UTC 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104966/
-----------------------------------------------------------

(Updated May 16, 2012, 1:51 p.m.)


Review request for Amarok and Ralf Engels.


Changes
-------

Strip formatting patch, update commit msg to be more cautious.


Description (updated)
-------

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 url.id 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
again.

Note to reporters of bug 242350: there's an unrelated bug 299150 which
now applies to lyrics, too.

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

BUG: 242350
FIXED-IN: 2.6
REVIEW: 104966


This addresses bug 242350.
    https://bugs.kde.org/show_bug.cgi?id=242350


Diffs (updated)
-----

  ChangeLog 67bc020 
  src/core-impl/collections/db/sql/DatabaseUpdater.h 37ccb54 
  src/core-impl/collections/db/sql/DatabaseUpdater.cpp 163b089 
  src/core-impl/collections/db/sql/SqlMeta.cpp f8f9bdb 

Diff: http://git.reviewboard.kde.org/r/104966/diff/


Testing
-------


Thanks,

Matěj Laitl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/amarok-devel/attachments/20120516/4d302d8f/attachment.html>


More information about the Amarok-devel mailing list