https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #70 from [hidden email] --- (In reply to Richard Mortimer from comment #69) > (In reply to swatilodha27 from comment #68) > > Hello Richard. > > > > I guess then the only possible way is to reproduce every error reported by > > the end user and try to generate it. > Some errors may be obvious by just looking at the code. But reproducing > things is definitely a good way to start. It also means that you can test > the fix! > > > > > Queries in relation to the points you mentioned for completing MySQL support: > > 1)In the "Experiment with TagsTree tables" patch, only testing needs to be > > done? To ensure that it generates expected results? > Yes. I think it replicates existing behaviour. > > > > > 2) To add a script for migration of databases with referential integrity > > patches, would it require to create a new table in the database? I'm not > > actually clear on this point. > No. It just requires adding "alter table" commands to convert the previous > schema to the new format. It should be pretty straightforward. But in many > ways it is easier to do that when the referential integrity setup has been > tested for new databases. > > During migration there is a chance that there will be some rows that have > broken referential integrity. That said MySQL support has always been > experimental so it is probably reasonable to expect that users may need to > perform some cleanups to get an existing database to migrate to a > non-experimental version. > > > > 3) To accurately make image/album/tag function, referential integrity is the > > best possible solution in MySQL. To check if it is broken, multiple tables > > in DB need to be checked and figure out in which one a record is missing, > > which is present in other tables. I guess this could be a solution? > Yes that is correct. > > But note that historically Digikam has not used a strict referential > integrity solution. In a number of cases it uses zero instead of what should > be null along with other "magic" values. In order to eliminate these from > the database the actual C++ code will likely need changing to stop it > relying on the magic zero values. Much of this code is shared with SQLite so > care has to be taken to ensure that the new code works with both databases. > Finding these locations will require some analysis of the code to audit all > uses of a particular field with correction where required. > To solve this maybe code could be reviewed in order to cross check that "0" isn't mentioned in ELSE condition, or in place of NULL. But I'm pretty confused on how to find locations where code needs to be changed, so as to make it compatible with both the databases? > The other issue (I'm guessing here based on what I've seen so far) is that > digikam seems to perform two stage database operations in some cases. In the > deletion example it seems to update the database to mark that an object is > about to the deleted. Then it tries the deletion and if successful goes > ahead and deletes the item from the database. In the case I looked at it > seemed that referential integrity was broken between the two database > operations and that is why the operation failed in MySQL. If my assessment > is correct then some thought needs giving to how the operation can be > performed in a database that enforces referential integrity. > Referential integrity can be enforced by strictly not violating any of one of the following: 1)No record should be allowed to add in the foreign key table, unless there exists a corresponding record in the superior table. 2) CASCADING UPDATE to automatically update corresponding record if the primary key record is updated. 3) CASCADING DELETE to automatically delete corresponding record if the primary key record is deleted. Regards Swati -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #71 from Richard Mortimer <[hidden email]> --- Created attachment 99903 --> https://bugs.kde.org/attachment.cgi?id=99903&action=edit Additional schema modifications from MySQL v7 to v8 Changes that need to be made for MySQL v7 to v8 transition in addition to those already listed. Note that I have not tested the transition from within digikam (I do not have a current working build tree) -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #72 from Richard Mortimer <[hidden email]> --- Created attachment 99904 --> https://bugs.kde.org/attachment.cgi?id=99904&action=edit Sample digikam v7 schema Here is my v7 based (digikam 4.x) MySQL schema. This may be useful for testing the upgrade from v7 to v8. I have tested the v7 upgrade commands against this (and also against a clone of my fully populated v7 database). -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #73 from Richard Mortimer <[hidden email]> --- Created attachment 99905 --> https://bugs.kde.org/attachment.cgi?id=99905&action=edit helper SQL command to detect invalid data in v7 MySQL databases running these commands against a v7 database will list any data that fails the referential integrity checks. It detects images attached to missing albums and similar for missing tags too. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #74 from Richard Mortimer <[hidden email]> --- Created attachment 99906 --> https://bugs.kde.org/attachment.cgi?id=99906&action=edit Helper to remove bad data prior to upgrade fromMySQL v7 to v8 Take care using this and always make a backup of your database before applying this commands. The commands just remove any data that fails integrity checks on the grounds that is was meaningless without being properly linked into the image/album/tags structures. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #75 from Richard Mortimer <[hidden email]> --- Created attachment 99907 --> https://bugs.kde.org/attachment.cgi?id=99907&action=edit Raw commands to perform a full MySQL v7 to v8 update These can be used to test upgrades from v7 to v8 standalone from digikam. Note that the commands do not update the internal database version numbers in the Settings table. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #76 from Richard Mortimer <[hidden email]> --- Created attachment 99908 --> https://bugs.kde.org/attachment.cgi?id=99908&action=edit Add referential integrity constraints to a 5.0.0 v8 database The 5.0.0 initial release database upgrade does not add referential integrity to the database fields. The commands in this attachment perform those upgrades and complete the proper move from v7 to v8. Note that MySQL support in digikam has always been classed as experimental. You are advised to use the migration facilities to cleanup any MySQL import from an older version of the database. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #77 from [hidden email] --- Richard, I tested your patch for adding referential integrity constraints in 5.0.0 v8 DB and it seems to work fine for me. Thanks. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #78 from Richard Mortimer <[hidden email]> --- (In reply to swatilodha27 from comment #77) > Richard, > > I tested your patch for adding referential integrity constraints in 5.0.0 v8 > DB and it seems to work fine for me. > > Thanks. Thanks for testing. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #79 from [hidden email] --- Hi Richard Could you please suggest more needs to be done here, after your referential integrity patch has been implemented? Thanks -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #80 from Richard Mortimer <[hidden email]> --- The only thing that I am aware of that potentially needs addressing in MySQL is the TagsTree support. I did note that there were some other issues addressing that so it may already have been resolved. -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
In reply to this post by bugzilla_noreply
https://bugs.kde.org/show_bug.cgi?id=355831
--- Comment #81 from [hidden email] --- Hi Richard, Following issues have been fixed recently to ensure Tags works fine with MySQL support: 1) Removing _DigiKam_root_tag_ from Tags tree (https://github.com/KDE/digikam/commit/eb6318a45efe1e08f35da450633f3bcb1027fd6a) 2)Updating set fields (lft and rgt values) while moving tags in hierarchy (https://github.com/KDE/digikam/commit/b8df6225e3cafdd720120f4bad4150fd78525e02) And, if I'm not wrong, the lft/rgt IDs are used by search tools, and in other places where hierarchy is concerned ? What improvements were aimed with your Tags Tree patches? Is the current implementation sufficient to fix all the issues that you tried with your earlier patches ? Thank you! -- You are receiving this mail because: You are the assignee for the bug. _______________________________________________ Digikam-devel mailing list [hidden email] https://mail.kde.org/mailman/listinfo/digikam-devel |
Free forum by Nabble | Edit this page |