summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-29 16:01:37 +0200
committerErich Eckner <git@eckner.net>2018-03-29 16:01:37 +0200
commit790ca15472478f9c714e11067fcc956fbe0fb572 (patch)
treedae78048258b42b3b2fe66d4a7a4bd831d896865
parentf271fb00686fdf51307bc038247ef155f90f7f3c (diff)
downloadbuilder-790ca15472478f9c714e11067fcc956fbe0fb572.tar.xz
bin/wtf: explicitely chose partition
-rwxr-xr-xbin/wtf6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/wtf b/bin/wtf
index 247b3e3..b3e29a6 100755
--- a/bin/wtf
+++ b/bin/wtf
@@ -21,6 +21,8 @@ hash=$(
)"
)
+partition=$((hash % mysql_files_table_partitions))
+
result=$(
# shellcheck disable=SC2016
{
@@ -31,7 +33,11 @@ result=$(
mysql_join_binary_packages_architectures
mysql_join_binary_packages_repositories
mysql_join_binary_packages_file_providers
+ printf ' PARTITION (p%s)' \
+ "${partition}"
mysql_join_file_providers_files
+ printf ' PARTITION (p%s)' \
+ "${partition}"
printf ' WHERE `files`.`name_hash`=%s' \
"${hash}"
printf ' AND (`files`.`name`=from_base64("%s")' \