77 conn = sqlite3.connect(main_db)
81 c.execute(
'''SELECT * FROM Directory limit 1;''')
82 directory_row = c.fetchall()
85 rel_cmp_offset, file_cmp_offset, directory_offset, hist_cmp_offset = 0, 0, 0, 0
87 c.execute(
'''SELECT count(*) FROM ReleaseComparison;''')
88 rel_cmp_offset = c.fetchone()[0]
89 c.execute(
'''SELECT count(*) FROM RootFileComparison;''')
90 file_cmp_offset = c.fetchone()[0]
91 c.execute(
'''SELECT max(id) FROM Directory;''')
92 directory_offset = c.fetchone()[0]
93 c.execute(
'''SELECT max(id) FROM HistogramComparison;''')
94 hist_cmp_offset = c.fetchone()[0]
98 ATTACH '{0}' AS partial;
101 INSERT INTO ReleaseComparison (title, release1, release2, statistical_test)
102 SELECT title, release1, release2, statistical_test FROM partial.ReleaseComparison;
104 INSERT INTO RootFileComparison (filename1, filename2, release_comparison_id, directory_id)
105 SELECT filename1, filename2, release_comparison_id+{1}, directory_id+{3} FROM partial.RootFileComparison;
107 INSERT INTO Directory (id, name, parent_id, from_histogram_id, till_histogram_id)
108 SELECT id+{3}, name, parent_id+{3}, from_histogram_id+{4}, till_histogram_id+{4} FROM partial.Directory;
110 INSERT INTO HistogramComparison (name, p_value, directory_id)
111 SELECT name, p_value, directory_id+{3} FROM partial.HistogramComparison;
113 COMMIT;""".
format(partial_db, rel_cmp_offset, file_cmp_offset, directory_offset, hist_cmp_offset))
116 c.execute(
'''SELECT max(id) FROM RootFileComparison;''')
117 max_file_cmp_id = c.fetchone()[0]
119 return max_file_cmp_id