diff options
author | Erich Eckner <git@eckner.net> | 2018-11-22 10:55:05 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-11-22 10:55:05 +0100 |
commit | de2aac43eeee9102fad048642187eeb184256104 (patch) | |
tree | 5da9d1d71e9e31985a2a6a92232cc32dc3e1a464 /lib | |
parent | 1ad723656baf44ecb9ec77336afadeee948729bc (diff) | |
download | builder-de2aac43eeee9102fad048642187eeb184256104.tar.xz |
lib/mysql-functions: mysql_load_min_and_max_versions(): extract version ids, too
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/mysql-functions | 24 |
1 files changed, 24 insertions, 0 deletions
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 |