From c167926813104d298ca9cab5f106e8eeed07afbe Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 5 Jun 2018 14:29:55 +0200 Subject: lib/mysql-functions: use ids instead of select queries --- lib/mysql-functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/mysql-functions') diff --git a/lib/mysql-functions b/lib/mysql-functions index 51632cd..5ebff8f 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -844,8 +844,8 @@ mysql_cleanup() { fi printf 'FROM `binary_packages`' mysql_join_binary_packages_binary_packages_in_repositories - mysql_join_binary_packages_in_repositories_repositories - printf ' WHERE `repositories`.`name`="to-be-decided";\n' + printf ' WHERE `binary_packages_in_repositories`.`repository`=%s;\n' \ + "${repository_ids__any_to_be_decided}" # remove build_assignments w/o binary_package printf '%s FROM `build_assignments` ' \ "${operator}" @@ -878,9 +878,9 @@ mysql_cleanup() { else printf 'SELECT COUNT(DISTINCT `build_slaves`.`id`) FROM `repositories`' fi - mysql_join_repositories_binary_packages_in_repositories mysql_join_binary_packages_in_repositories_binary_packages - printf ' AND `repositories`.`name`="build-list"' + printf ' AND `binary_packages_in_repositories`.`repository`=%s' \ + "${repository_ids__any_build_list}" printf ' RIGHT' mysql_join_binary_packages_build_slaves if [ "${operator}" = 'DELETE' ]; then -- cgit v1.2.3-70-g09d2