Bugzilla – Attachment 36744 Details for
Bug 13810
Prevent updatedatabase.pl from breaking because of case insensitive utf8 collation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Change default collation to utf8_bin
Change-default-collation-to-utf8bin.patch (text/plain), 1.72 KB, created by
Nicolas Legrand
on 2015-03-09 16:17:35 UTC
(
hide
)
Description:
Change default collation to utf8_bin
Filename:
MIME Type:
Creator:
Nicolas Legrand
Created:
2015-03-09 16:17:35 UTC
Size:
1.72 KB
patch
obsolete
>From 70d916b8e41aa824da0877f90430c0ba8f513b33 Mon Sep 17 00:00:00 2001 >From: Nicolas Legrand <nicolas.legrand@bulac.fr> >Date: Mon, 9 Mar 2015 17:07:31 +0100 >Subject: [PATCH] Change default collation to utf8_bin > >When upgrading database from 3.18 to master upgrade Upgrade to >3.19.00.006 (Bug 11944 - Convert DB tables to utf8_unicode_ci) may >fail like this: > >DBD::mysql::db do failed: Duplicate entry 'ACQ-995-a' for key 'PRIMARY' at ./installer/data/mysql/updatedatabase.pl line 9671. > >This is from table marc_subfield_structure where the keys are made of >framework (ACQ), tagfield (995) and tagsubfield (a). If we have a key >ACQ-995-A it thinks the entries are duplicates, because the collation >is case insensitive. It's rather annoying, since it's legit in mark to >have a subfield 'a' different from subfield 'A' inside the same >subfield. > >utf8_bin prevent updatedatabase.pl from breaking. > >http://bugs.koha-community.org/show_bug.cgi?id=13810 >--- > installer/data/mysql/updatedatabase.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index bd39629..2288a00 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9666,7 +9666,7 @@ if ( CheckVersion($DBversion) ) { > $table_sth->execute; > my @table = $table_sth->fetchrow_array; > unless ( $table[1] =~ /COLLATE=utf8mb4_unicode_ci/ ) { #catches utf8mb4 collated tables >- $dbh->do(qq|ALTER TABLE $name CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci|); >+ $dbh->do(qq|ALTER TABLE $name CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin|) > } > } > $dbh->do(q|SET foreign_key_checks = 1|);; >-- >1.7.10.4
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 13810
:
36744
|
37437
|
38543
|
38562
|
38664
|
38793