summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-04-30 09:42:16 +0200
committerErich Eckner <git@eckner.net>2021-04-30 09:42:16 +0200
commit8537258ac44cefebfa7b5a4f945a4effccfd1cb7 (patch)
tree610e2b7ee29d6cb5d7ea631a7dfd6ac4b45bff05 /bin
parent0a48f43bfc019906d284d61625cd41e3841d86f7 (diff)
downloadbuilder-8537258ac44cefebfa7b5a4f945a4effccfd1cb7.tar.xz
bin/db-update: clean up mysql logic: don't insert more than necessary, if the filter properties are available in the isnerting query anyways
Diffstat (limited to 'bin')
-rwxr-xr-xbin/db-update15
1 files changed, 5 insertions, 10 deletions
diff --git a/bin/db-update b/bin/db-update
index 196527e..e54e2bf 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -332,6 +332,10 @@ mysql_query_update_replaced_bpir() {
printf ' FROM `binary_packages_in_repositories`'
mysql_join_binary_packages_in_repositories_repositories
printf ' AND `repositories`.`is_on_master_mirror`'
+ printf ' AND `repositories`.`stability`=%s' \
+ "${source_stability_id}"
+ printf ' AND `repositories`.`architecture`=%s;\n' \
+ "${arch_id}"
mysql_join_repositories_architectures
mysql_join_binary_packages_in_repositories_binary_packages
printf ' JOIN `binary_packages` AS `f_bp`'
@@ -367,16 +371,7 @@ mysql_query_update_replaced_bpir() {
else # ${force_every_pkg}
printf ';\n'
fi
- printf 'DELETE `moveable_bpir`'
- printf ' FROM `moveable_bpir`'
- printf ' JOIN `binary_packages_in_repositories`'
- printf ' ON `binary_packages_in_repositories`.`id`=`moveable_bpir`.`id`'
- mysql_join_binary_packages_in_repositories_binary_packages
- mysql_join_binary_packages_in_repositories_repositories
- printf ' WHERE `repositories`.`stability`!=%s' \
- "${source_stability_id}"
- printf ' OR `repositories`.`architecture`!=%s;\n' \
- "${arch_id}"
+
printf 'UPDATE `moveable_bpir`'
printf ' JOIN `binary_packages_in_repositories`'
printf ' ON `binary_packages_in_repositories`.`id`=`moveable_bpir`.`id`'