Timothy Leavitt · Jul 11, 2017

Utility to find differences between databases?

Does anyone know of a utility to compare two databases (i.e., CACHE.DAT files) and find globals/subscripts that are different between them?

If not, I'll write one and share it. smiley

0 680
Discussion (6)2
Log in or sign up to continue

That does look useful, but I'm looking to compare all the globals in two databases (the output of different but theoretically equivalent build processes) to see if some globals are present from one / missing in another or if the contents of any are different, and (if so) what the differences are.

Did it work ?

Compares two globals in the same or different namespace.

Thanks, Ray! This sounds really promising.

(To confirm: it ended up working.)

Export relevant globals to xml file(1 file per namespace) and compare hash sums. Also there's a lot of tools to display XML diffs if hash sums would differ.

Otherwise it's per global iteration and compare. I'd write some method to calculate global hash maybe (complete iteration and hash of keys and value). So:

  • Get lists of globals in both ns
  • Iterate over lists, and calculate hashes for each global separately
  • Compare lists (iterate over one list and delete each same value from both lists, all that's left is diff)
  • Report if global is in one list and not in the other
  • Report if global hashes differ across lists
  • (Optional) Display detailed compare for globals with different hashes