[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] Remove unsafe filename prefix primary key from tiki_secdb
"ushindi bienvenu \(@usbbush\) via TikiWiki-cvs" <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <6a117090d90af_38192878341c3@gitlab-sidekiq-low-urgency-cpu-bound-v2-d7f87744c-ks9zd.mail> |
ushindi bienvenu pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki
Commits:
b1ce4919 by ushindi bienvenu at 2026-05-23T11:15:46+02:00
[FIX] Remove unsafe filename prefix primary key from tiki_secdb
- - - - -
1 changed file:
- doc/devtools/release.php
Changes:
=====================================
doc/devtools/release.php
=====================================
@@ -301,10 +301,23 @@ function updateSecdb($version)
sort($queries);
fwrite($fp, "start transaction;\n");
fwrite($fp, "DELETE FROM `tiki_secdb`;\n");
- // This index was originally created with a size limit that would raise an error on some versions,
- // notably on 18.0. Since this file is executed before any patch in installer/schema, the fix had to
- // be done here. It's a quick operation because table is empty, so no harm in leaving this here forever.
- fwrite($fp, "ALTER TABLE `tiki_secdb` DROP PRIMARY KEY, ADD PRIMARY KEY (`filename`(171),`tiki_version`(20));\n\n");
+ // Do not recreate a PRIMARY KEY on (filename, tiki_version).
+ //
+ // Historically this table used:
+ //
+ // PRIMARY KEY (`filename`(171), `tiki_version`(20))
+ //
+ // The key only indexed a prefix of `filename`, not the full path. This caused
+ // false duplicate-key errors when different long paths shared the same first
+ // 171 characters, especially in bundled vendor/test fixtures.
+ //
+ // Increasing the prefix length is not a reliable fix because older MySQL/MyISAM
+ // versions can hit index-size limits.
+ //
+ // Since tiki_secdb is fully generated from release files (not user data),
+ // enforcing uniqueness through a truncated filename prefix is more harmful
+ // than useful. A normal filename index remains sufficient for lookups.
+ fwrite($fp, "ALTER TABLE `tiki_secdb` DROP PRIMARY KEY;\n\n");
$insertString = 'INSERT INTO `tiki_secdb` (`filename`, `md5_value`, `tiki_version`) VALUES ';
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b1ce4919b9cd89edae808ef031acdd4c0ec0916c
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/b1ce4919b9cd89edae808ef031acdd4c0ec0916c
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs