Test plan:
1. Apply patch and update database
2. Verify that you can add a search field mapping for both 100a and 100A.
3. Verify that the above also works with a newly-created database.
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit
a5f3d405f56202beb4426da52f3bf4019f26484b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit
4a1986b6b102304ab0cce24e32a334f11d9556df)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
--- /dev/null
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+ my $table_sth = $dbh->prepare('SHOW CREATE TABLE `search_marc_map`');
+ $table_sth->execute();
+ my @table = $table_sth->fetchrow_array();
+ unless ( $table[1] =~ /`marc_field`.*COLLATE utf8mb4_bin/ ) { #catches utf8mb4 collated tables
+ $dbh->do("ALTER TABLE `search_marc_map` MODIFY `marc_field` VARCHAR(255) NOT NULL COLLATE utf8mb4_bin COMMENT 'the MARC specifier for this field'");
+ }
+
+ # Always end with this (adjust the bug info)
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 19670 - Change collation of marc_field to allow mixed case search field mappings)\n";
+}
id int(11) NOT NULL AUTO_INCREMENT,
index_name ENUM('biblios','authorities') NOT NULL COMMENT 'what storage index this map is for',
marc_type ENUM('marc21', 'unimarc', 'normarc') NOT NULL COMMENT 'what MARC type this map is for',
- marc_field VARCHAR(255) NOT NULL COMMENT 'the MARC specifier for this field',
+ marc_field VARCHAR(255) NOT NULL COLLATE utf8mb4_bin COMMENT 'the MARC specifier for this field',
PRIMARY KEY(`id`),
UNIQUE key `index_name` (`index_name`, `marc_field` (191), `marc_type`),
INDEX (`index_name`)