Reviewed by Hyatt
authorbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Aug 2006 17:38:19 +0000 (17:38 +0000)
committerbeidson <beidson@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Aug 2006 17:38:19 +0000 (17:38 +0000)
commitf397dd7ad27b548ae53fb7677dd8907d117d300f
tree37d030319e9469b17504df598ab21c3e33145f81
parente6bfdf35a51b26e8d155d658131c5904e65523a8
    Reviewed by Hyatt

        Fixed an error where an Icon's IconID could change without the change being reflected in the PageURL table,
        causing icons to be pruned before their time and pages to lose their icons.  This is because I misunderstood
        how SQLite handles the "ON CONFLICT REPLACE" condition, which is to delete the row and re-insert instead of
        perform an update.  Also added an assertion to make sure this doesn't happen again.

        * loader/icon/IconDataCache.cpp:
        (WebCore::IconDataCache::writeToDatabase): Instead of one INSERT relying on SQLites conflict handling, broke
          this into an UPDATE attempt followed by the initial INSERT
        * loader/icon/IconDatabase.cpp:
        (WebCore::IconDatabase::createDatabaseTables): Slight tweak to the database schema to prevent this from happening
          in the future.  Note this change will not cause incompatibility with the current schema, therefore I didn't update
          the official database version number
        (WebCore::IconDatabase::syncDatabase): Added an ASSERT to look for this condition in the future
        * loader/icon/SQLDatabase.cpp:
        (WebCore::SQLDatabase::lastChanges): Added this SQLite accessor to see if an UPDATE command actually changed a row
        * loader/icon/SQLDatabase.h: Ditto

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/loader/icon/IconDataCache.cpp
WebCore/loader/icon/IconDatabase.cpp
WebCore/loader/icon/SQLDatabase.cpp
WebCore/loader/icon/SQLDatabase.h