summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-13 13:47:03 +0200
committerErich Eckner <git@eckner.net>2018-09-13 13:47:03 +0200
commit501bc41303280811927a330720665a2c41fd9074 (patch)
tree21edb12847f91f7571c1215d824f1e591f33e908 /lib/mysql-functions
parentbf1267babf5e4eb34d1b397e2b7ae03c0d0d7f54 (diff)
downloadbuilder-501bc41303280811927a330720665a2c41fd9074.tar.xz
lib/mysql-functions: remove obsolete function mysql_update_versions_ordering()
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions41
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 2e665dd..c5ffa78 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -1121,47 +1121,6 @@ mysql_query_and_delete_unneeded_binary_packages() {
printf ');\n'
}
-# mysql_update_versions_ordering
-# calculate the correct ordering of `versions` entries
-mysql_update_versions_ordering() {
- ( # new shell is intentional
- tmp_file=$(mktemp "${work_dir}/tmp.mysql-functions.mysql_update_versions_ordering.XXXXXX")
- trap 'rm "${tmp_file}"' EXIT
- {
- printf 'SELECT '
- printf 'CONCAT('
- printf '`versions`.`epoch`,":",'
- printf '`versions`.`version`'
- printf '),'
- printf '`versions`.`id`'
- printf ' FROM `versions`;\n'
- } | \
- mysql_run_query | \
- expand_version 1 | \
- sort -k1V,1 | \
- cat -n | \
- sed '
- s/^\s*\([0-9]\+\)\s\+\S\+\s\+\([0-9]\+\)$/\1\t\2/
- ' > \
- "${tmp_file}"
- {
- printf 'CREATE TEMPORARY TABLE `v`('
- printf '`id` BIGINT,'
- printf '`order` BIGINT,'
- printf 'PRIMARY KEY `id`(`id`)'
- printf ');\n'
- printf 'LOAD DATA LOCAL INFILE "%s" INTO TABLE `v`(`order`,`id`);\n' \
- "${tmp_file}"
- printf 'UPDATE `versions`'
- printf ' JOIN `v`'
- printf ' ON `v`.`id`=`versions`.`id`'
- printf ' SET `versions`.`order`=`v`.`order`;\n'
- printf 'DROP TEMPORARY TABLE `v`;\n'
- } | \
- mysql_run_query
- )
-}
-
# mysql_sort_versions [-f]
# sort the table of versions, iff versions without order exist or -f was
# given