Summary: | Out of range changedate prevents importing music folder | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | thilo |
Component: | general | Assignee: | Amarok Bugs <amarok-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | heiko.becker, kde, momo.cao |
Priority: | NOR | ||
Version First Reported In: | 2.9.0 | ||
Target Milestone: | kf5 | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/multimedia/amarok/-/commit/0e3770aa01f004a7ae12a11ad3bda5f0ff8b5fa2 | Version Fixed In: | |
Sentry Crash Report: |
Description
thilo
2020-09-21 10:42:08 UTC
Additional info: $ stat * -tf AM 2c6731a50772e064 255 ef53 4096 4096 29277940 7414595 6095503 7454720 6240792 Tranquility Base Hotel & Casino 2c6731a50772e064 255 ef53 4096 4096 29277940 7414595 6095503 7454720 6240792 A 'touch *' fixes the issue stat without "-t" would have been nicer, but assuming you have the same implementation as I do, the change date of the file is the unix epoch minus 3600 seconds, which overflows somewhere to 4294963696 secs since the epoch, which is a bit in the future: "Sun 7 Feb 06:28:16 CET 2106" 1) Obviously this should be handled more robustly and 2) it also looks like Amarok has a year 2038 problem because the maximum value of mysql's INTEGER is 2147483647. SUMMARY I set amarok to use my mariadb server at localhost. I get a sql error in the /var/lib/mysql/sql_error.log when amarok update the collection: 2024-02-15 22:14:22 amarok[amarok] @ localhost [] ERROR 1264: Out of range value for column 'changedate' at row 1 : INSERT INTO directories(deviceid,changedate,dir) VALUES (1,4294963696,'home/<user>/Musique/<path>') STEPS TO REPRODUCE 1. Create directory with such timestamps 2. Update collection 3. See error in sql error log FIX SUGGESTION Change changedate from int(11) to datetime ? OBSERVED RESULT ERROR 1264: Out of range value for column 'changedate' at row 1 : INSERT INTO directories(deviceid,changedate,dir) VALUES (1,4294963696,'home/<user>/Musique/<path>') EXPECTED RESULT No error SOFTWARE/OS VERSIONS Windows: macOS: Linux/KDE Plasma: (available in About System) KDE Plasma Version: KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION LC_ALL=C l -ldh '/home/<user>/Musique/<path>': drwxr-xr-x 1 <user> <user> 3.8K Dec 31 1969 LC_ALL=C stat '/home/<user>/Musique/<path>' File: /home/<user>/Musique/<path> Size: 3872 Blocks: 0 IO Block: 4096 directory Device: 0,39 Inode: 270513 Links: 1 Access: (0755/drwxr-xr-x) Uid: ( <uid>/ <user>) Gid: ( <uid>/ <user>) Access: 2024-02-15 21:54:41.937300905 +0000 Modify: 1969-12-31 23:00:00.000000000 +0000 Change: 2024-01-12 18:40:54.232067829 +0000 Birth: 2024-01-12 16:40:52.050847188 +0000 Same bug as https://bugs.kde.org/show_bug.cgi?id=405241 too, which was invalidly closed as invalid. Amarok should support out of timestamp range creation/modification dates. *** Bug 491321 has been marked as a duplicate of this bug. *** A possibly relevant merge request was started @ https://invent.kde.org/multimedia/amarok/-/merge_requests/134 Git commit 0e7509d0a8fc6e70ee3b60f1ec5db9080c3c524c by Tuomas Nurmi. Committed on 15/03/2025 at 11:38. Pushed by nurmi into branch 'master'. Add some database bug related tests that fail for now Database should be utf8mb4 for complete UTF8 support. Directory changedates shouldn't hit year 2038 problem. Related: bug 462268 M +14 -0 tests/core-impl/collections/db/sql/TestSqlCollectionLocation.cpp M +2 -0 tests/core-impl/collections/db/sql/TestSqlCollectionLocation.h M +12 -0 tests/core-impl/collections/db/sql/TestSqlTrack.cpp M +2 -0 tests/core-impl/collections/db/sql/TestSqlTrack.h https://invent.kde.org/multimedia/amarok/-/commit/0e7509d0a8fc6e70ee3b60f1ec5db9080c3c524c Git commit 0e3770aa01f004a7ae12a11ad3bda5f0ff8b5fa2 by Tuomas Nurmi. Committed on 15/03/2025 at 11:38. Pushed by nurmi into branch 'master'. Convert directories' changedate to use BIGINT in db and quint64 in code Scanner side of things was already using quint64-based functions, so this is probably the most coherent path for fixing M +1 -0 ChangeLog M +2 -2 shared/collectionscanner/Directory.cpp M +2 -2 shared/collectionscanner/Directory.h M +4 -2 src/core-impl/collections/db/sql/DatabaseUpdater.cpp M +1 -1 src/core-impl/collections/db/sql/SqlCollection.cpp M +2 -2 src/core-impl/collections/db/sql/SqlRegistry.cpp M +1 -1 src/core-impl/collections/db/sql/SqlRegistry.h https://invent.kde.org/multimedia/amarok/-/commit/0e3770aa01f004a7ae12a11ad3bda5f0ff8b5fa2 |