Bugzilla – Attachment 115066 Details for
Bug 26947
kohastructure.sql should be updated for each release
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26947: (follow-up) Set key checks to disabled for kohastructure
Bug-26947-follow-up-Set-key-checks-to-disabled-for.patch (text/plain), 1.76 KB, created by
Jonathan Druart
on 2021-01-12 10:53:55 UTC
(
hide
)
Description:
Bug 26947: (follow-up) Set key checks to disabled for kohastructure
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-01-12 10:53:55 UTC
Size:
1.76 KB
patch
obsolete
>From 713f4ed9692a7e6c62c2c6528558f4867a7bef9d Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 18 Nov 2020 17:08:11 +0000 >Subject: [PATCH] Bug 26947: (follow-up) Set key checks to disabled for > kohastructure > >This patch adds sql calls to disable foreign key checks for the initial >kohastructure schema load and then re-enables them again for subsequent >actions. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Installer.pm | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/C4/Installer.pm b/C4/Installer.pm >index 1c5dc8f1ec..e87109574b 100644 >--- a/C4/Installer.pm >+++ b/C4/Installer.pm >@@ -279,7 +279,23 @@ sub load_db_schema { > my $self = shift; > > my $datadir = C4::Context->config('intranetdir') . "/installer/data/$self->{dbms}"; >+ >+ # Disable checks before load >+ $self->{'dbh'}->do(q{SET NAMES utf8mb4}); >+ $self->{'dbh'}->do(q{SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0}); >+ $self->{'dbh'}->do(q{SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0}); >+ $self->{'dbh'}->do(q{SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'}); >+ $self->{'dbh'}->do(q{SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0}); >+ >+ # Load kohastructure > my $error = $self->load_sql("$datadir/kohastructure.sql"); >+ >+ # Re-enable checks after load >+ $self->{'dbh'}->do(q{SET SQL_MODE=@OLD_SQL_MODE}); >+ $self->{'dbh'}->do(q{SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS}); >+ $self->{'dbh'}->do(q{SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS}); >+ $self->{'dbh'}->do(q{SET SQL_NOTES=@OLD_SQL_NOTES}); >+ > return $error; > > } >-- >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 26947
:
113603
|
113794
|
113799
|
113800
|
113802
|
113803
|
113804
|
113805
|
113989
|
114021
|
114022
|
114023
|
114024
|
114025
|
114195
|
114196
|
114197
|
114198
|
114199
|
114201
|
115065
| 115066 |
115067
|
115068
|
115069
|
115070
|
115073