Bug 30916

Summary: Staged import fails if a title is longer than 128 characters
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: MARC Bibliographic record staging/importAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low    
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Katrin Fischer 2022-06-07 08:25:54 UTC
The staged import tools will fail, if you try to import a record that has a title longer than 128 characters, as import_biblios.title is varchar(128). In comparison, biblio.title is mediumtext.

We should make the fields match up or at least extend the size of import_biblios.title.
Comment 1 Katrin Fischer 2022-06-07 08:36:28 UTC
I've tried to update locally to mediumtext, but this appears to fail because title is part of the PK.
Comment 2 Katrin Fischer 2022-06-07 08:57:10 UTC
This is an "old version" problem. In master, this table is 'prettier':

DROP TABLE IF EXISTS `import_biblios`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `import_biblios` (
  `import_record_id` int(11) NOT NULL,
  `matched_biblionumber` int(11) DEFAULT NULL,
  `control_number` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `original_source` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `author` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `isbn` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `issn` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `has_items` tinyint(1) NOT NULL DEFAULT 0,
  KEY `import_biblios_ibfk_1` (`import_record_id`),
  KEY `matched_biblionumber` (`matched_biblionumber`),
  KEY `title` (`title`(191)),
  KEY `isbn` (`isbn`(191)),
  CONSTRAINT `import_biblios_ibfk_1` FOREIGN KEY (`import_record_id`) REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;