Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-31 15:41:08 +0200
committerErich Eckner <git@eckner.net>2018-05-31 15:41:08 +0200
commit5b6581935b8c1d64313c812e6bfa3d0309aaea18 (patch)
tree723912bc40fcb599152e38b7bcb45a1bc1daa675
parent8dde526290718371b6da178c65955d431910fd97 (diff)
count(*) -> COUNT(1)
-rwxr-xr-xbin/get-assignment2
-rwxr-xr-xbin/ping-from-slave2
-rwxr-xr-xbin/why-dont-you2
-rwxr-xr-xlib/mysql-functions6
4 files changed, 6 insertions, 6 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index 0bfe48f..c8fcbaf 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -176,7 +176,7 @@ fi
count_pending=$(
# shellcheck disable=SC2016
{
- printf 'SELECT count(*)'
+ printf 'SELECT COUNT(1)'
printf ' FROM `build_assignments`'
mysql_join_build_assignments_binary_packages
mysql_join_binary_packages_binary_packages_in_repositories
diff --git a/bin/ping-from-slave b/bin/ping-from-slave
index 6246b02..55a3300 100755
--- a/bin/ping-from-slave
+++ b/bin/ping-from-slave
@@ -13,7 +13,7 @@
if [ "$(
# shellcheck disable=SC2016,SC2154
{
- printf 'SELECT count(*) FROM `build_slaves`'
+ printf 'SELECT COUNT(1) FROM `build_slaves`'
mysql_join_build_slaves_build_assignments
printf ' WHERE `build_slaves`.`name`=from_base64("%s");\n' \
"$(printf '%s' "${slave}" | base64 -w0)"
diff --git a/bin/why-dont-you b/bin/why-dont-you
index e35e0bd..b05f98e 100755
--- a/bin/why-dont-you
+++ b/bin/why-dont-you
@@ -44,7 +44,7 @@ case "${action}" in
printf 'SELECT DISTINCT `to_build`.`ba_id`,'
printf 'If(`to_build`.`is_broken`,1,0),'
printf '('
- printf 'SELECT count(*) FROM `failed_builds`'
+ printf 'SELECT COUNT(1) FROM `failed_builds`'
printf 'WHERE `failed_builds`.`build_assignment`=`to_build`.`ba_id`'
printf ')'
printf ',replace(to_base64(`%s`.`%s`),"\\n","")' \
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 52f0ef2..9470579 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -828,7 +828,7 @@ mysql_cleanup() {
if [ "$#" = '0' ]; then
operator='DELETE'
elif [ "$#" = '1' ] && [ "x$1" = 'xdry' ]; then
- operator='SELECT COUNT(*)'
+ operator='SELECT COUNT(1)'
else
>&2 echo 'Unknown parameter'
>&2 echo 'Call "mysql_clean_up" or "mysql_clean_up dry".'
@@ -892,7 +892,7 @@ mysql_cleanup() {
printf 'UPDATE `build_slaves`'
printf ' SET `build_slaves`.`currently_building`=NULL'
else
- printf 'SELECT COUNT(*) FROM `build_slaves`'
+ printf 'SELECT COUNT(1) FROM `build_slaves`'
fi
printf ' WHERE `build_slaves`.`currently_building` IS NOT NULL'
printf ' AND TIMEDIFF(NOW(),('
@@ -905,7 +905,7 @@ mysql_cleanup() {
printf ' SET `build_slaves`.`last_action`=NULL,'
printf ' `build_slaves`.`logged_lines`=NULL'
else
- printf 'SELECT COUNT(*) FROM `build_slaves`'
+ printf 'SELECT COUNT(1) FROM `build_slaves`'
fi
printf ' WHERE `build_slaves`.`currently_building` IS NULL'
printf ' AND (`build_slaves`.`last_action` IS NOT NULL'