From f89a3fd4c3577eba5a9e3f1c1d27c26fb8432f7b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 9 Nov 2018 10:50:09 +0100 Subject: lib/mysql-joins.php new: it contains mysql_join_* functions similar to the ones in lib/mysql-functions of the build scripts --- buildmaster/status.php | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'buildmaster/status.php') diff --git a/buildmaster/status.php b/buildmaster/status.php index 3776d81..05a4455 100644 --- a/buildmaster/status.php +++ b/buildmaster/status.php @@ -27,8 +27,8 @@ if ($result -> num_rows > 0) { $result = mysql_run_query( "SELECT MAX(`binary_packages_in_repositories`.`last_moved`) AS `last_moved`" . " FROM `binary_packages`" . - " JOIN `binary_packages_in_repositories` ON `binary_packages_in_repositories`.`package`=`binary_packages`.`id`" . - " JOIN `build_assignments` ON `binary_packages`.`build_assignment`=`build_assignments`.`id`" . + mysql_join_binary_packages_binary_packages_in_repositories() . + mysql_join_binary_packages_build_assignments() . " WHERE `binary_packages_in_repositories`.`last_moved`>`build_assignments`.`return_date`" ); @@ -47,12 +47,9 @@ $age_queries = array( "SELECT " . "`build_assignments`.`package_source`" . " FROM `build_assignments`" . - " JOIN `binary_packages`" . - " ON `binary_packages`.`build_assignment`=`build_assignments`.`id`" . - " JOIN `binary_packages_in_repositories`" . - " ON `binary_packages_in_repositories`.`package`=`binary_packages`.`id`" . - " JOIN `repositories`" . - " ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . + mysql_join_build_assignments_binary_packages() . + mysql_join_binary_packages_binary_packages_in_repositories() . + mysql_join_binary_packages_in_repositories_repositories() . " WHERE `repositories`.`name`=\"build-list\"" . " AND `build_assignments`.`is_blocked` IS NULL" . " GROUP BY `build_assignments`.`package_source`" . @@ -69,10 +66,8 @@ $age_queries = array( "`binary_packages_in_repositories`.`package`," . "MIN(`binary_packages_in_repositories`.`last_moved`) AS `first_last_moved`" . " FROM `binary_packages_in_repositories`" . - " JOIN `repositories`" . - " ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . - " JOIN `repository_stabilities`" . - " ON `repositories`.`stability`=`repository_stabilities`.`id`" . + mysql_join_binary_packages_in_repositories_repositories() . + mysql_join_repositories_repository_stabilities() . " WHERE `repository_stabilities`.`name`=\"staging\"" . " GROUP BY `binary_packages_in_repositories`.`package`" . ") AS `binary_packages_in_repositories`" . @@ -88,10 +83,8 @@ $age_queries = array( "`binary_packages_in_repositories`.`package`," . "MIN(`binary_packages_in_repositories`.`last_moved`) AS `first_last_moved`" . " FROM `binary_packages_in_repositories`" . - " JOIN `repositories`" . - " ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . - " JOIN `repository_stabilities`" . - " ON `repositories`.`stability`=`repository_stabilities`.`id`" . + mysql_join_binary_packages_in_repositories_repositories() . + mysql_join_repositories_repository_stabilities() . " WHERE `repository_stabilities`.`name`=\"testing\"" . " GROUP BY `binary_packages_in_repositories`.`package`" . ") AS `binary_packages_in_repositories`" . @@ -109,10 +102,8 @@ $age_queries = array( "`binary_packages_in_repositories`.`package`," . "MIN(`binary_packages_in_repositories`.`last_moved`) AS `first_last_moved`" . " FROM `binary_packages_in_repositories`" . - " JOIN `repositories`" . - " ON `binary_packages_in_repositories`.`repository`=`repositories`.`id`" . - " JOIN `repository_stabilities`" . - " ON `repositories`.`stability`=`repository_stabilities`.`id`" . + mysql_join_binary_packages_in_repositories_repositories() . + mysql_join_repositories_repository_stabilities() . " WHERE `repository_stabilities`.`name`=\"testing\"" . " GROUP BY `binary_packages_in_repositories`.`package`" . ") AS `binary_packages_in_repositories`" . -- cgit v1.2.3-70-g09d2