diff options
author | Erich Eckner <git@eckner.net> | 2018-06-05 14:29:55 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-06-05 14:29:55 +0200 |
commit | c167926813104d298ca9cab5f106e8eeed07afbe (patch) | |
tree | 231a9839dadd39cc90b307a2950bf468c0adfcf1 /lib | |
parent | 5abb605487bad908e3688e0137d14480e99cae8b (diff) | |
download | builder-c167926813104d298ca9cab5f106e8eeed07afbe.tar.xz |
lib/mysql-functions: use ids instead of select queries
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/mysql-functions | 8 |
1 files changed, 4 insertions, 4 deletions
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 |