From 684e100df759d509d615a0e711b3750c6d4d2211 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 7 May 2018 08:40:09 +0200 Subject: lib/mysql-functions: mysql_cleanup: remove unnecessary cleanups which are handled by foreign keys (and tend to create deadlocks) --- lib/mysql-functions | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'lib/mysql-functions') diff --git a/lib/mysql-functions b/lib/mysql-functions index 71097cb..a027b2f 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -780,30 +780,6 @@ mysql_cleanup() { printf 'FROM `binary_packages`' mysql_join_binary_packages_repositories printf ' WHERE `repositories`.`name`="to-be-decided";\n' - # remove dependencies w/o binary_package or install_target - printf '%s FROM `dependencies` ' \ - "${operator}" - printf 'WHERE NOT EXISTS ' - printf '(' - printf 'SELECT * FROM `binary_packages` ' - printf 'WHERE `dependencies`.`dependent`=`binary_packages`.`id`' - printf ') OR NOT EXISTS ' - printf '(' - printf 'SELECT * FROM `install_targets` ' - printf 'WHERE `dependencies`.`depending_on`=`install_targets`.`id`' - printf ');\n' - # remove install_target_providers w/o binary_package or install_target - printf '%s FROM `install_target_providers` ' \ - "${operator}" - printf 'WHERE NOT EXISTS ' - printf '(' - printf 'SELECT * FROM `binary_packages` ' - printf 'WHERE `install_target_providers`.`package`=`binary_packages`.`id`' - printf ') OR NOT EXISTS ' - printf '(' - printf 'SELECT * FROM `install_targets` ' - printf 'WHERE `install_target_providers`.`install_target`=`install_targets`.`id`' - printf ');\n' # remove build_assignments w/o binary_package printf '%s FROM `build_assignments` ' \ "${operator}" @@ -822,14 +798,6 @@ mysql_cleanup() { mysql_join_failed_builds_build_assignments printf 'WHERE NOT `build_assignments`.`is_broken`' printf ';\n' - # remove failed_builds w/o build_assignment - printf '%s FROM `failed_builds` ' \ - "${operator}" - printf 'WHERE NOT EXISTS ' - printf '(' - printf 'SELECT * FROM `build_assignments` ' - printf 'WHERE `build_assignments`.`id`=`failed_builds`.`build_assignment`' - printf ');\n' # remove package_sources w/o build_assignment printf '%s FROM `package_sources` ' \ "${operator}" -- cgit v1.2.3-70-g09d2