"order by sharedprefix(source0,source0ref) desc, mtime desc");
pp->reset();
pp->bind(1, buildid);
+ // NB: we don't store the non-canonicalized path names any more, but old databases
+ // might have them (and no canon ones), so we keep searching for both.
pp->bind(2, suffix);
pp->bind(3, canon_pathname(suffix));
}
.bind(1, srps)
.step_ok_done();
- // register the dwarfsrc name in the interning table too
+ // PR25548: store canonicalized dwarfsrc path
+ string dwarfsrc_canon = canon_pathname (dwarfsrc);
+ if (dwarfsrc_canon != dwarfsrc)
+ {
+ if (verbose > 3)
+ obatched(clog) << "canonicalized src=" << dwarfsrc << " alias=" << dwarfsrc_canon << endl;
+ }
+
ps_upsert_files
.reset()
- .bind(1, dwarfsrc)
+ .bind(1, dwarfsrc_canon)
.step_ok_done();
ps_upsert_s
.reset()
.bind(1, buildid)
- .bind(2, dwarfsrc)
+ .bind(2, dwarfsrc_canon)
.bind(3, srps)
.bind(4, sfs.st_mtime)
.step_ok_done();
- // PR25548: also store canonicalized source path
- string dwarfsrc_canon = canon_pathname (dwarfsrc);
- if (dwarfsrc_canon != dwarfsrc)
- {
- if (verbose > 3)
- obatched(clog) << "canonicalized src=" << dwarfsrc << " alias=" << dwarfsrc_canon << endl;
-
- ps_upsert_files
- .reset()
- .bind(1, dwarfsrc_canon)
- .step_ok_done();
-
- ps_upsert_s
- .reset()
- .bind(1, buildid)
- .bind(2, dwarfsrc_canon)
- .bind(3, srps)
- .bind(4, sfs.st_mtime)
- .step_ok_done();
- }
-
inc_metric("found_sourcerefs_total","source","files");
}
}
continue;
}
+ // PR25548: store canonicalized source path
+ const string& dwarfsrc = s;
+ string dwarfsrc_canon = canon_pathname (dwarfsrc);
+ if (dwarfsrc_canon != dwarfsrc)
+ {
+ if (verbose > 3)
+ obatched(clog) << "canonicalized src=" << dwarfsrc << " alias=" << dwarfsrc_canon << endl;
+ }
+
ps_upsert_files
.reset()
- .bind(1, s)
+ .bind(1, dwarfsrc_canon)
.step_ok_done();
ps_upsert_sref
.reset()
.bind(1, buildid)
- .bind(2, s)
+ .bind(2, dwarfsrc_canon)
.step_ok_done();
- // PR25548: also store canonicalized source path
- const string& dwarfsrc = s;
- string dwarfsrc_canon = canon_pathname (dwarfsrc);
- if (dwarfsrc_canon != dwarfsrc)
- {
- if (verbose > 3)
- obatched(clog) << "canonicalized src=" << dwarfsrc << " alias=" << dwarfsrc_canon << endl;
-
- ps_upsert_files
- .reset()
- .bind(1, dwarfsrc_canon)
- .step_ok_done();
-
- ps_upsert_sref
- .reset()
- .bind(1, buildid)
- .bind(2, dwarfsrc_canon)
- .step_ok_done();
- }
-
fts_sref ++;
}
}