From de2aac43eeee9102fad048642187eeb184256104 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 22 Nov 2018 10:55:05 +0100 Subject: lib/mysql-functions: mysql_load_min_and_max_versions(): extract version ids, too --- lib/mysql-functions | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib') diff --git a/lib/mysql-functions b/lib/mysql-functions index 4b27ac9..a97202b 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -1377,6 +1377,30 @@ mysql_load_min_and_max_versions() { mysql_run_query ) fi + + if [ -z "${min_version_id}" ]; then + min_version_id=$( + { + printf 'SELECT `versions`.`id`' + printf ' FROM `versions`' + printf ' ORDER BY `versions`.`order`' + printf ' LIMIT 1' + } | \ + mysql_run_query + ) + fi + + if [ -z "${max_version_id}" ]; then + max_version_id=$( + { + printf 'SELECT `versions`.`id`' + printf ' FROM `versions`' + printf ' ORDER BY `versions`.`order` DESC' + printf ' LIMIT 1' + } | \ + mysql_run_query + ) + fi } # mysql_query_remove_old_binary_packages_from_build_list -- cgit v1.2.3-70-g09d2