From fb9f877ce42a69f8f36b2251e0726ea59d238220 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 20 Jan 2019 20:04:33 +0100 Subject: lib/mysql.php: mysql_query_package_version() new --- lib/mysql.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'lib/mysql.php') diff --git a/lib/mysql.php b/lib/mysql.php index 33ab4f0..19d0dae 100644 --- a/lib/mysql.php +++ b/lib/mysql.php @@ -65,3 +65,26 @@ function mysql_url_encode($input) { return "REPLACE(" . $input . ",\"+\",\"%2B\")"; } + +function mysql_query_package_version($table) { + return + "CONCAT(" . + "IF(" . + "`" .$table . "`.`epoch`=\"0\"," . + "\"\"," . + "CONCAT(" . + "`" . $table . "`.`epoch`," . + "\":\"" . + ")" . + ")," . + "`" . $table . "`.`pkgver`,\"-\"," . + "`" . $table . "`.`pkgrel`," . + "IF(`" . $table . "`.`sub_pkgrel_omitted`," . + "\"\"," . + "CONCAT(" . + "\".\"," . + "`" . $table . "`.`sub_pkgrel`" . + ")" . + ")" . + ")"; +} -- cgit v1.2.3-70-g09d2