Bugzilla – Attachment 133106 Details for
Bug 30497
Constraint old_reserves_ibfk_4 should be SET NULL instead of CASCADE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30497: Recreate old_reserves_ibfk_4 when it cascades
Bug-30497-Recreate-oldreservesibfk4-when-it-cascad.patch (text/plain), 1.69 KB, created by
Marcel de Rooy
on 2022-04-08 08:27:59 UTC
(
hide
)
Description:
Bug 30497: Recreate old_reserves_ibfk_4 when it cascades
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-04-08 08:27:59 UTC
Size:
1.69 KB
patch
obsolete
>From 46bdd5587f478fdc7f54eb36d34b05bd5999a874 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 8 Apr 2022 08:23:56 +0000 >Subject: [PATCH] Bug 30497: Recreate old_reserves_ibfk_4 when it cascades >Content-Type: text/plain; charset=utf-8 > >Test plan: >Drop old_reserves_ibfk_4. >Add back with: > alter table old_reserves ADD CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE; >Run dbrev. Check that constraint has been replaced by SET NULL. >Run dbrev again. No changes. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > installer/data/mysql/atomicupdate/bug_30497.pl | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_30497.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_30497.pl b/installer/data/mysql/atomicupdate/bug_30497.pl >new file mode 100755 >index 0000000000..dd14ab1c32 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30497.pl >@@ -0,0 +1,16 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => 30497, >+ description => "Recreate old_reserves_ibfk_4 if cascading", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ my @info = $dbh->selectrow_array( q|SHOW CREATE TABLE old_reserves| ); >+ if( $info[1] =~ /^\s*CONSTRAINT .old_reserves_ibfk_4.*CASCADE$/m ) { >+ $dbh->do( q|ALTER TABLE old_reserves DROP CONSTRAINT old_reserves_ibfk_4| ); >+ $dbh->do( q|ALTER TABLE old_reserves ADD CONSTRAINT old_reserves_ibfk_4 FOREIGN KEY (itemtype) REFERENCES itemtypes (itemtype) ON DELETE SET NULL ON UPDATE SET NULL| ); >+ } >+ }, >+}; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30497
:
133106
|
139680
|
140073