Fossil SCM
Fix the 'describe' command to use only direct ancestors, and add a safety limit on the recursive CTE.
Commit
1cc2da2ee0eca4a0d6ebbcf9185e1b11e6274f9085a17ccd62b13e5e0dd4da9a
Parent
93266c5151d769c…
1 file changed
+2
+2
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -3795,13 +3795,15 @@ | ||
| 3795 | 3795 | " UNION ALL" |
| 3796 | 3796 | " SELECT plink.pid, event.mtime, singletonTag.tagname, n+1" |
| 3797 | 3797 | " FROM ancestor, plink, event" |
| 3798 | 3798 | " LEFT JOIN singletonTag ON singletonTag.rid=plink.pid" |
| 3799 | 3799 | " WHERE plink.cid=ancestor.rid" |
| 3800 | + " AND plink.isprim=1" | |
| 3800 | 3801 | " AND event.objid=plink.pid" |
| 3801 | 3802 | " AND ancestor.tagname IS NULL" |
| 3802 | 3803 | " ORDER BY mtime DESC" |
| 3804 | + " LIMIT 100000" | |
| 3803 | 3805 | " )" |
| 3804 | 3806 | "SELECT tagname, n" |
| 3805 | 3807 | " FROM ancestor" |
| 3806 | 3808 | " WHERE tagname IS NOT NULL" |
| 3807 | 3809 | " ORDER BY n LIMIT 1;", |
| 3808 | 3810 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -3795,13 +3795,15 @@ | |
| 3795 | " UNION ALL" |
| 3796 | " SELECT plink.pid, event.mtime, singletonTag.tagname, n+1" |
| 3797 | " FROM ancestor, plink, event" |
| 3798 | " LEFT JOIN singletonTag ON singletonTag.rid=plink.pid" |
| 3799 | " WHERE plink.cid=ancestor.rid" |
| 3800 | " AND event.objid=plink.pid" |
| 3801 | " AND ancestor.tagname IS NULL" |
| 3802 | " ORDER BY mtime DESC" |
| 3803 | " )" |
| 3804 | "SELECT tagname, n" |
| 3805 | " FROM ancestor" |
| 3806 | " WHERE tagname IS NOT NULL" |
| 3807 | " ORDER BY n LIMIT 1;", |
| 3808 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -3795,13 +3795,15 @@ | |
| 3795 | " UNION ALL" |
| 3796 | " SELECT plink.pid, event.mtime, singletonTag.tagname, n+1" |
| 3797 | " FROM ancestor, plink, event" |
| 3798 | " LEFT JOIN singletonTag ON singletonTag.rid=plink.pid" |
| 3799 | " WHERE plink.cid=ancestor.rid" |
| 3800 | " AND plink.isprim=1" |
| 3801 | " AND event.objid=plink.pid" |
| 3802 | " AND ancestor.tagname IS NULL" |
| 3803 | " ORDER BY mtime DESC" |
| 3804 | " LIMIT 100000" |
| 3805 | " )" |
| 3806 | "SELECT tagname, n" |
| 3807 | " FROM ancestor" |
| 3808 | " WHERE tagname IS NOT NULL" |
| 3809 | " ORDER BY n LIMIT 1;", |
| 3810 |