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-04-24 13:28:26 +0200
committerErich Eckner <git@eckner.net>2018-04-24 13:28:26 +0200
commit7673a80a19fa5c8cbd71afe9ecf93ee5ede223de (patch)
treeddebddbd5e096141bd03c9ab749eef0156a18d6a
parentcefea1135f1a88ceb77f45758b07c0c824cd9d71 (diff)
bin/bootstrap-mysql,misc/database-layout.dump: small cleanup
-rwxr-xr-xbin/bootstrap-mysql6
-rw-r--r--misc/database-layout.dump6
2 files changed, 8 insertions, 4 deletions
diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql
index 822d995..8ccb2a2 100755
--- a/bin/bootstrap-mysql
+++ b/bin/bootstrap-mysql
@@ -408,6 +408,7 @@ if [ ! "$1" = 'slim' ]; then
# now we delete all unreplaceable and unmoveable packages from the respective
# list until no further changes are required
printf 'REPEAT\n'
+ printf 'SET row_count_saved = 0;\n'
# create copies of our temporary tables *yuck*
for table in 'replaced' 'moveable'; do
for copy in '' '2'; do
@@ -449,7 +450,7 @@ if [ ! "$1" = 'slim' ]; then
printf ' JOIN `moveable_binary_packages_copy` ON `moveable_binary_packages_copy`.`id`=`install_target_providers`.`package`'
printf ' WHERE `install_target_providers`.`install_target`=`dependencies`.`depending_on`'
printf ');\n'
- printf 'SET @row_count_saved = ROW_COUNT();\n'
+ printf 'SET row_count_saved = row_count_saved + ROW_COUNT();\n'
# refresh copies of our temporary tables *yuck*
for table in 'replaced' 'moveable'; do
@@ -529,7 +530,8 @@ if [ ! "$1" = 'slim' ]; then
printf ' AND `subst_itp`.`install_target`=`install_target_providers`.`install_target`'
# b) 2) ^
printf ');\n'
- printf 'UNTIL row_count_saved=0 AND ROW_COUNT()=0\n'
+ printf 'SET row_count_saved = row_count_saved + ROW_COUNT();\n'
+ printf 'UNTIL row_count_saved=0\n'
printf 'END REPEAT;\n'
for table in 'moveable' 'replaced'; do
for copy in '' '2'; do
diff --git a/misc/database-layout.dump b/misc/database-layout.dump
index 84c17cb..33c4e4a 100644
--- a/misc/database-layout.dump
+++ b/misc/database-layout.dump
@@ -80,6 +80,7 @@ INSERT IGNORE INTO `replaced_binary_packages` (`id`,`replaced_by`)
JOIN `binary_packages` AS `r_bp`
ON `r_r`.`id`=`r_bp`.`repository` AND `r_bp`.`pkgname`=`m_bp`.`pkgname`;
REPEAT
+SET row_count_saved = 0;
DELETE
FROM `replaced_binary_packages_copy`;
INSERT IGNORE INTO `replaced_binary_packages_copy`
@@ -125,7 +126,7 @@ SELECT *
JOIN `moveable_binary_packages_copy`
ON `moveable_binary_packages_copy`.`id`=`install_target_providers`.`package`
WHERE `install_target_providers`.`install_target`=`dependencies`.`depending_on`);
-SET @row_count_saved = ROW_COUNT();
+SET row_count_saved = row_count_saved + ROW_COUNT();
DELETE
FROM `replaced_binary_packages_copy`;
INSERT IGNORE INTO `replaced_binary_packages_copy`
@@ -182,7 +183,8 @@ SELECT *
SELECT *
FROM `replaced_binary_packages_copy2`
WHERE `replaced_binary_packages_copy2`.`id`=`subst_bp`.`id`) AND `subst_itp`.`install_target`=`install_target_providers`.`install_target`);
-UNTIL row_count_saved=0 AND ROW_COUNT()=0
+SET row_count_saved = row_count_saved + ROW_COUNT();
+UNTIL row_count_saved=0
END REPEAT;
DROP TEMPORARY TABLE `moveable_binary_packages_copy`;
DROP TEMPORARY TABLE `replaced_binary_packages_copy`;