[Collab-qa-commits] r1264 - udd/udd
kroeckx at alioth.debian.org
kroeckx at alioth.debian.org
Wed Sep 10 22:18:11 UTC 2008
Author: kroeckx
Date: 2008-09-10 22:18:10 +0000 (Wed, 10 Sep 2008)
New Revision: 1264
Modified:
udd/udd/bugs_gatherer.pl
udd/udd/orphaned_packages_gatherer.py
udd/udd/packages_gatherer.py
udd/udd/popcon_gatherer.py
udd/udd/testing_migrations_gatherer.py
udd/udd/upload_history_gatherer.py
Log:
Make all inserts reference the fields they want to insert into.
Modified: udd/udd/bugs_gatherer.pl
===================================================================
--- udd/udd/bugs_gatherer.pl 2008-09-09 14:14:11 UTC (rev 1263)
+++ udd/udd/bugs_gatherer.pl 2008-09-10 22:18:10 UTC (rev 1264)
@@ -115,7 +115,7 @@
$user = $dbh->quote($user);
foreach my $tag (keys %tags) {
my $qtag = $dbh->quote($tag);
- map { $dbh->do("INSERT INTO $table VALUES ($user, $qtag, $_)") or die $! } @{$tags{$tag}};
+ map { $dbh->do("INSERT INTO $table (email, tag, id) VALUES ($user, $qtag, $_)") or die $! } @{$tags{$tag}};
}
}
}
@@ -176,11 +176,11 @@
my $location = $src_config{archived} ? 'archive' : 'db_h';
$table = $src_config{archived} ? $archived_table : $table;
# Read all bugs
- my $insert_bugs_handle = $dbh->prepare("INSERT INTO $table VALUES (\$1, \$2, \$3, \$4::abstime, \$5, \$6, \$7, \$8, \$9, \$10::abstime, \$11, \$12, \$13)");
- my $insert_bugs_found_handle = $dbh->prepare("INSERT INTO ${table}_found_in VALUES (\$1, \$2)");
- my $insert_bugs_fixed_handle = $dbh->prepare("INSERT INTO ${table}_fixed_in VALUES (\$1, \$2)");
- my $insert_bugs_merged_handle = $dbh->prepare("INSERT INTO ${table}_merged_with VALUES (\$1, \$2)");
- my $insert_bugs_tags_handle = $dbh->prepare("INSERT INTO ${table}_tags VALUES (\$1, \$2)");
+ my $insert_bugs_handle = $dbh->prepare("INSERT INTO $table (id, package, source, arrival, status, severity, submitter, owner, title, last_modified, affects_stable, affects_testing, affects_unstable) VALUES (\$1, \$2, \$3, \$4::abstime, \$5, \$6, \$7, \$8, \$9, \$10::abstime, \$11, \$12, \$13)");
+ my $insert_bugs_found_handle = $dbh->prepare("INSERT INTO ${table}_found_in (id, version) VALUES (\$1, \$2)");
+ my $insert_bugs_fixed_handle = $dbh->prepare("INSERT INTO ${table}_fixed_in (id, version) VALUES (\$1, \$2)");
+ my $insert_bugs_merged_handle = $dbh->prepare("INSERT INTO ${table}_merged_with (id, merged_with) VALUES (\$1, \$2)");
+ my $insert_bugs_tags_handle = $dbh->prepare("INSERT INTO ${table}_tags (id, tag) VALUES (\$1, \$2)");
$insert_bugs_handle->bind_param(4, undef, SQL_INTEGER);
$insert_bugs_handle->bind_param(10, undef, SQL_INTEGER);
Modified: udd/udd/orphaned_packages_gatherer.py
===================================================================
--- udd/udd/orphaned_packages_gatherer.py 2008-09-09 14:14:11 UTC (rev 1263)
+++ udd/udd/orphaned_packages_gatherer.py 2008-09-10 22:18:10 UTC (rev 1264)
@@ -48,7 +48,7 @@
rows = cur.fetchall()
cur2.execute("DELETE FROM %s" % self.my_config['table'])
- cur2.execute("PREPARE opkgs_insert AS INSERT INTO %s VALUES ($1, $2, $3, $4, $5)" % self.my_config['table'])
+ cur2.execute("PREPARE opkgs_insert AS INSERT INTO %s (source, type, bug, description, orphaned_time) VALUES ($1, $2, $3, $4, $5)" % self.my_config['table'])
for row in rows:
m = self.title_re.match(row[1])
Modified: udd/udd/packages_gatherer.py
===================================================================
--- udd/udd/packages_gatherer.py 2008-09-09 14:14:11 UTC (rev 1263)
+++ udd/udd/packages_gatherer.py 2008-09-10 22:18:10 UTC (rev 1264)
@@ -188,7 +188,8 @@
cur.execute("DEALLOCATE package_insert")
# Fill the summary tables
cur.execute("DELETE FROM %s" % (table + '_summary'));
- cur.execute("""INSERT INTO %s SELECT DISTINCT ON (package, version,
+ cur.execute("""INSERT INTO %s (package, version, distribution, release,
+ component) SELECT DISTINCT ON (package, version,
distribution, release, component) package, version, source,
source_version, maintainer, distribution, release, component FROM %s""" %
(table + '_summary', table));
Modified: udd/udd/popcon_gatherer.py
===================================================================
--- udd/udd/popcon_gatherer.py 2008-09-09 14:14:11 UTC (rev 1263)
+++ udd/udd/popcon_gatherer.py 2008-09-10 22:18:10 UTC (rev 1264)
@@ -74,15 +74,18 @@
#calculate _src and _src_avg
cur.execute("""
- INSERT INTO %(table)s_src SELECT DISTINCT pkgs.source, max(insts) AS insts, max(vote) AS vote, max(olde) AS old,
- max(recent) AS recent, max(nofiles) as nofiles
+ INSERT INTO %(table)s_src (source, insts, vote, olde, recent, nofiles)
+ SELECT DISTINCT pkgs.source, max(insts) AS insts, max(vote) AS vote,
+ max(olde) AS old, max(recent) AS recent, max(nofiles) as nofiles
FROM %(table)s, %(packages-table)s_summary AS pkgs
WHERE %(table)s.package = pkgs.package
GROUP BY pkgs.source;
""" % my_config)
cur.execute("""
- INSERT INTO %(table)s_src_average SELECT pkgs.source, avg(insts) AS insts, avg(vote) AS vote, avg(olde) AS old,
- avg(recent) AS recent, avg(nofiles) as nofiles
+ INSERT INTO %(table)s_src_average (source, insts, vote, olde, recent,
+ nofiles)
+ SELECT pkgs.source, avg(insts) AS insts, avg(vote) AS vote,
+ avg(olde) AS old, avg(recent) AS recent, avg(nofiles) as nofiles
FROM %(table)s, %(packages-table)s_summary AS pkgs
WHERE %(table)s.package = pkgs.package
GROUP BY pkgs.source;
Modified: udd/udd/testing_migrations_gatherer.py
===================================================================
--- udd/udd/testing_migrations_gatherer.py 2008-09-09 14:14:11 UTC (rev 1263)
+++ udd/udd/testing_migrations_gatherer.py 2008-09-10 22:18:10 UTC (rev 1264)
@@ -27,7 +27,7 @@
c.execute("DELETE FROM migrations")
- c.execute("PREPARE mig_insert AS INSERT INTO migrations VALUES ($1, $2, $3, $4, $5, $6, $7, $8)")
+ c.execute("PREPARE mig_insert AS INSERT INTO migrations (source, in_testing, testing_version, in_unstable, unstable_version, sync, sync_version, first_seen) VALUES ($1, $2, $3, $4, $5, $6, $7, $8)")
f = open(src_cfg['path'])
for line in f:
Modified: udd/udd/upload_history_gatherer.py
===================================================================
--- udd/udd/upload_history_gatherer.py 2008-09-09 14:14:11 UTC (rev 1263)
+++ udd/udd/upload_history_gatherer.py 2008-09-10 22:18:10 UTC (rev 1264)
@@ -33,12 +33,14 @@
cursor.execute("DELETE FROM " + self.my_config['table'] + '_closes')
cursor.execute("DELETE FROM " + self.my_config['table'])
- cursor.execute("PREPARE uh_insert AS INSERT INTO %s VALUES \
+ cursor.execute("PREPARE uh_insert AS INSERT INTO %s (id, package, \
+ version, date, changed_by, maintainer, nmu, signed_by, key_id) VALUES \
($1, $2, $3, $4, $5, $6, $7, $8, $9)" % self.my_config['table'])
- cursor.execute("PREPARE uh_arch_insert AS INSERT INTO %s VALUES \
+ cursor.execute("PREPARE uh_arch_insert AS INSERT INTO %s (id, \
+ architecture) VALUES \
($1, $2)" % (self.my_config['table'] + '_architecture'))
- cursor.execute("PREPARE uh_close_insert AS INSERT INTO %s VALUES \
- ($1, $2)" % (self.my_config['table'] + '_closes'))
+ cursor.execute("PREPARE uh_close_insert AS INSERT INTO %s (id, bug) \
+ VALUES ($1, $2)" % (self.my_config['table'] + '_closes'))
id = 0
for name in glob(path + '/debian-devel-*'):
More information about the Collab-qa-commits
mailing list