summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorTomas Mozes <hydrapolic@gmail.com>2020-01-20 10:44:57 +0100
committerThomas Deutschmann <whissi@gentoo.org>2020-01-23 02:20:19 +0100
commita3d89b6a4809cb863f571fcedd36e219c41e257c (patch)
tree12775837c045d0091435a415c2072c8ee4f47d24 /dev-db
parentdev-php/phpspec-prophecy: bump to v1.10.1 (diff)
downloadgentoo-a3d89b6a4809cb863f571fcedd36e219c41e257c.tar.gz
gentoo-a3d89b6a4809cb863f571fcedd36e219c41e257c.tar.bz2
gentoo-a3d89b6a4809cb863f571fcedd36e219c41e257c.zip
dev-db/percona-toolkit: fix pt-osc with MariaDB
Fixes pt-online-schema-change with --alter-foreign-keys-method=drop_swap Bug: https://jira.percona.com/browse/PT-1795 Package-Manager: Portage-2.3.84, Repoman-2.3.20 Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/14395 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/percona-toolkit/files/percona-toolkit-3.1.0-drop-swap-gentoo-mariadb-fix.patch33
-rw-r--r--dev-db/percona-toolkit/percona-toolkit-3.1.0-r1.ebuild (renamed from dev-db/percona-toolkit/percona-toolkit-3.1.0.ebuild)3
2 files changed, 35 insertions, 1 deletions
diff --git a/dev-db/percona-toolkit/files/percona-toolkit-3.1.0-drop-swap-gentoo-mariadb-fix.patch b/dev-db/percona-toolkit/files/percona-toolkit-3.1.0-drop-swap-gentoo-mariadb-fix.patch
new file mode 100644
index 000000000000..0596365423f9
--- /dev/null
+++ b/dev-db/percona-toolkit/files/percona-toolkit-3.1.0-drop-swap-gentoo-mariadb-fix.patch
@@ -0,0 +1,33 @@
+diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change
+index 7ecec11..afdd7dd 100755
+--- a/bin/pt-online-schema-change
++++ b/bin/pt-online-schema-change
+@@ -8948,15 +8948,6 @@ sub main {
+ Quoter => $q,
+ );
+
+- my $vp = VersionParser->new($cxn->dbh());
+- if ($vp->cmp('8.0.14') > -1 && $vp->flavor() !~ m/maria/i) {
+- my $msg = "There is an error in MySQL that makes the server to die when trying to ".
+- "rename a table with FKs. See https://bugs.mysql.com/bug.php?id=96145\n".
+- "Since pt-online-schema change needs to rename the old <-> new tables as the final " .
+- "step, and the requested table has FKs, it cannot be executed under the current MySQL version";
+- _die($msg, NO_MINIMUM_REQUIREMENTS);
+- }
+-
+ if ( ($alter_fk_method || '') eq 'none' ) {
+ print "Not updating foreign keys because "
+ . "--alter-foreign-keys-method=none. Foreign keys "
+@@ -9872,12 +9863,6 @@ sub main {
+ }
+ }
+
+- if ($vp->cmp('8.0') > -1 && $vp->flavor() !~ m/maria/i && $alter_fk_method eq 'drop_swap') {
+- my $msg = "--alter-foreign-keys-method=drop_swap doesn't work with MySQL 8.0+\n".
+- "See https://bugs.mysql.com/bug.php?id=89441";
+- _die($msg, INVALID_PARAMETERS);
+- }
+-
+ # --plugin hook
+ if ( $plugin && $plugin->can('after_copy_rows') ) {
+ $plugin->after_copy_rows();
diff --git a/dev-db/percona-toolkit/percona-toolkit-3.1.0.ebuild b/dev-db/percona-toolkit/percona-toolkit-3.1.0-r1.ebuild
index 700a8fd29578..bc039dc30467 100644
--- a/dev-db/percona-toolkit/percona-toolkit-3.1.0.ebuild
+++ b/dev-db/percona-toolkit/percona-toolkit-3.1.0-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
@@ -40,6 +40,7 @@ DEPEND="${COMMON_DEPEND}
PATCHES=(
"${FILESDIR}"/${PN}-3.0.7-no-versioncheck.patch
"${FILESDIR}"/${PN}-3.0.10-slave-delay-fix.patch
+ "${FILESDIR}"/${PN}-3.1.0-drop-swap-gentoo-mariadb-fix.patch
)
src_prepare() {