From c87df4e334cdabeb4282ff1faee781b0fcd1248f Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 25 Dec 2007 01:26:05 -0600 Subject: [PATCH] bug 1368 - remove FOREIGN_KEY_CHECKS = 0 from installer [1] Web installer no longer sets FOREIGN_KEY_CHECKS = 0 when loading frameworks and sample SQL. [2] Removed FOREIGN_KEY_CHECKS = 0 from SQL scripts [3] Fixed FK issues in en/optional/sample_patrons.sql Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- .../marc21/mandatory/authorities_normal_marc21.sql | 1 - .../marc21/mandatory/marc21_framework_DEFAULT.sql | 1 - .../marc21/optional/marc21_simple_bib_frameworks.sql | 1 - .../unimarc/mandatory/authorities_normal_unimarc.sql | 1 - .../unimarc/mandatory/unimarc_framework_DEFAULT.sql | 1 - installer/data/mysql/en/optional/sample_patrons.sql | 5 ++--- installer/install.pl | 8 ++------ 7 files changed, 4 insertions(+), 14 deletions(-) diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql b/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql index 311c4727cc..8614555ecf 100644 --- a/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql +++ b/installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql @@ -25,7 +25,6 @@ -- ******************************************************* -SET FOREIGN_KEY_CHECKS = 0; -- ****************************************************** diff --git a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql index 75e35df692..7b360abca1 100644 --- a/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql +++ b/installer/data/mysql/en/marcflavour/marc21/mandatory/marc21_framework_DEFAULT.sql @@ -25,7 +25,6 @@ -- ************************************************************* -SET FOREIGN_KEY_CHECKS = 0; -- ****************************************************** diff --git a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql index fa71998544..320bb16185 100644 --- a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql +++ b/installer/data/mysql/en/marcflavour/marc21/optional/marc21_simple_bib_frameworks.sql @@ -72,7 +72,6 @@ -SET FOREIGN_KEY_CHECKS = 0; -- ******************************** diff --git a/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.sql b/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.sql index c9a6801c24..5dd3df0c77 100644 --- a/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.sql +++ b/installer/data/mysql/en/marcflavour/unimarc/mandatory/authorities_normal_unimarc.sql @@ -36,7 +36,6 @@ -- **************************************************************************** -SET FOREIGN_KEY_CHECKS = 0; -- ****************************************************** diff --git a/installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql b/installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql index c1aec586c3..1f333a3075 100644 --- a/installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql +++ b/installer/data/mysql/en/marcflavour/unimarc/mandatory/unimarc_framework_DEFAULT.sql @@ -42,7 +42,6 @@ -- **************************************************************************** -SET FOREIGN_KEY_CHECKS = 0; -- ****************************************************** diff --git a/installer/data/mysql/en/optional/sample_patrons.sql b/installer/data/mysql/en/optional/sample_patrons.sql index d28e44cf82..7b9aafeb05 100644 --- a/installer/data/mysql/en/optional/sample_patrons.sql +++ b/installer/data/mysql/en/optional/sample_patrons.sql @@ -1,7 +1,6 @@ -SET FOREIGN_KEY_CHECKS = 0; INSERT INTO `borrowers` (`borrowernumber`, `cardnumber`, `surname`, `firstname`, `title`, `othernames`, `initials`, `streetnumber`, `streettype`, `address`, `address2`, `city`, `zipcode`, `email`, `phone`, `mobile`, `fax`, `emailpro`, `phonepro`, `B_streetnumber`, `B_streettype`, `B_address`, `B_city`, `B_zipcode`, `B_email`, `B_phone`, `dateofbirth`, `branchcode`, `categorycode`, `dateenrolled`, `dateexpiry`, `gonenoaddress`, `lost`, `debarred`, `contactname`, `contactfirstname`, `contacttitle`, `guarantorid`, `borrowernotes`, `relationship`, `ethnicity`, `ethnotes`, `sex`, `userid`, `opacnote`, `contactnote`, `password`, `flags`, `sort1`, `sort2`) VALUES -(1,'1','Admin','Koha',NULL,NULL,'',NULL,NULL,'',NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'SAT2','A',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,109,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1,'1','Admin','Koha',NULL,NULL,'',NULL,NULL,'',NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'SAT2','S',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,109,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (2,'23529000152273','Welch','Marcus',NULL,NULL,'',NULL,NULL,'5601 Library Rd.',NULL,'Springfield, MA','44224',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'SAT1','ST','1985-10-24','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'M','23529000152273',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.43609457503641','0.38613959717205'), (3,'23529000445172','Daniels','Tanya',NULL,NULL,'',NULL,NULL,'2035 Library Rd.',NULL,'Portland, ME','44236',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1966-10-14','SAT2','PT','1990-08-22','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'F','23529000445172',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.62241429148467','0.95365269664084'), (4,'23529000105040','Dillon','Eva',NULL,NULL,'',NULL,NULL,'8916 Library Rd.',NULL,'Springfield, MA','44224',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1952-04-03','SAT2','PT','1987-07-01','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'F','23529000105040',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.90102063948384','0.64414513823031'), @@ -16,7 +15,7 @@ INSERT INTO `borrowers` (`borrowernumber`, `cardnumber`, `surname`, `firstname`, (13,'23529000132291','Edwards','Roy',NULL,NULL,'',NULL,NULL,'9929 Library Rd.',NULL,'Portland, OR','44240',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1928-09-09','SAT2','PT','1992-03-10','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'F','23529000132291',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.59739638920631','0.5227448963772'), (14,'23529000035726','Mccullough','Phillip',NULL,NULL,'',NULL,NULL,'410 Library Rd.',NULL,'Portland, ME','44236',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1943-11-23','MAIN','PT','1986-01-23','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'F','23529000035726',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.82153534500071','0.53944206660561'), (15,'23529001203323','Peterson','Gordon',NULL,NULL,'',NULL,NULL,'6285 Library Rd.',NULL,'Springfield, MA','44224',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1963-10-01','MAIN','J','1984-09-11','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,131,NULL,NULL,NULL,NULL,'F','23529001203323',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.23260432875958','0.54469547471469'), -(16,'23529000991266','Walker','Andrea',NULL,NULL,'',NULL,NULL,'4992 Library Rd.',NULL,'Portland, OR','44240',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1956-08-05','SAT1','ILL','1993-06-23','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'F','23529000991266',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.025664418028355','0.49423569673135'), +(16,'23529000991266','Walker','Andrea',NULL,NULL,'',NULL,NULL,'4992 Library Rd.',NULL,'Portland, OR','44240',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1956-08-05','SAT1','IL','1993-06-23','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'F','23529000991266',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.025664418028355','0.49423569673135'), (17,'23529000711078','King','Casey',NULL,NULL,'',NULL,NULL,'3438 Library Rd.',NULL,'Springfield, MA','44224',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1953-09-23','MAIN','S','1992-05-18','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'F','23529000711078',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.39418526030535','0.48821924206635'), (18,'23529000809559','Delgado','Floyd',NULL,NULL,'',NULL,NULL,'6661 Library Rd.',NULL,'Springfield, MA','44224',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1968-02-01','SAT2','K','1988-08-05','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,160,NULL,NULL,NULL,NULL,'M','23529000809559',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.25854046014933','0.82804460528125'), (19,'23529000035676','Acevedo','Henry',NULL,NULL,'',NULL,NULL,'4345 Library Rd.',NULL,'Springfield, MA','44224',NULL,'(212) 555-1212',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'1958-05-30','SAT2','S','1990-09-23','2020-12-31',NULL,NULL,NULL,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,'F','23529000035676',NULL,NULL,'42b29d0771f3b7ef',NULL,'0.36460167669188','0.33887459834933'), diff --git a/installer/install.pl b/installer/install.pl index 98762545c9..640dac0ca5 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -307,8 +307,6 @@ elsif ( $step && $step == 3 ) { my @bb = split /\/|\\/, ($b); $aa[-1] cmp $bb[-1] } $query->param('framework'); - if ( $info{dbms} eq 'mysql' ) { $dbh->do('SET FOREIGN_KEY_CHECKS=0'); } - elsif ( $info{dbms} eq 'Pg' ) { $dbh->do('SET CONSTRAINTS ALL DEFERRED;'); } my $request = $dbh->prepare( "SELECT value FROM systempreferences WHERE variable='FrameworksLoaded'" @@ -382,8 +380,6 @@ elsif ( $step && $step == 3 ) { "list" => \@list ); $template->param( "$op" => 1 ); - if ( $info{dbms} eq 'mysql' ) { $dbh->do('SET FOREIGN_KEY_CHECKS=1'); } - elsif ( $info{dbms} eq 'Pg' ) { $dbh->do('SET CONSTRAINTS ALL IMMEDIATE;'); } } elsif ( $op && $op eq 'selectframeworks' ) { # @@ -469,7 +465,7 @@ elsif ( $step && $step == 3 ) { }; } @listname; my @fwks = - sort { $a->{'fwkname'} lt $b->{'fwkname'} } @frameworklist; + sort { $a->{'fwkname'} cmp $b->{'fwkname'} } @frameworklist; # $cell{"mandatory"}=($requirelevel=~/(mandatory|requi|oblig|necess)/i); $cell{"frameworks"} = \@fwks; @@ -516,7 +512,7 @@ elsif ( $step && $step == 3 ) { }; } @listname; my @fwks = - sort { $a->{'fwkname'} lt $b->{'fwkname'} } @frameworklist; + sort { $a->{'fwkname'} cmp $b->{'fwkname'} } @frameworklist; # $cell{"mandatory"}=($requirelevel=~/(mandatory|requi|oblig|necess)/i); $cell{"frameworks"} = \@fwks; -- 2.39.5