Bug 15086 - Creators layout and template sql has warnings
Summary: Creators layout and template sql has warnings
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Mark Tompsett
QA Contact: Testopia
URL:
Keywords:
Depends on: 15053
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-29 22:23 UTC by Mark Tompsett
Modified: 2016-12-05 21:25 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15086: Creators layout and template sql has warnings (23.24 KB, patch)
2015-10-29 22:34 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 15086: Creators layout and template sql has warnings (23.14 KB, patch)
2016-01-04 15:08 UTC, Mark Tompsett
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15086: Creators layout and template sql has warnings (23.29 KB, patch)
2016-05-11 15:17 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 15086: Creators layout and template sql has warnings (23.35 KB, patch)
2016-05-13 20:39 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2015-10-29 22:23:15 UTC
When doing a hacked install:
use ... {koha database name}
truncate creator_layouts;
truncate creator_templates;
truncate printers_profiles;
source installer/data/mysql/... {name of a sample_labels type file}
Warnings are generated, which may not be visible in the UI.

TEST PLAN
---------
(1) Run this BEFORE applying:
truncate creator_layouts;
truncate creator_templates;
truncate printers_profile;
source installer/data/mysql/de-DE/optional/sample_creator_data.sql
truncate creator_layouts;
truncate creator_templates;
truncate printers_profile;
source installer/data/mysql/es-ES/optional/sample_creator_data.sql
truncate creator_layouts;
truncate creator_templates;
truncate printers_profile;
source installer/data/mysql/fr-FR/2-Optionel/sample_labels.sql
truncate creator_layouts;
truncate creator_templates;
truncate printers_profile;
source installer/data/mysql/it-IT/necessari/sample_creator_data.sql
truncate creator_layouts;
truncate creator_templates;
truncate printers_profile;
source installer/data/mysql/nb-NO/2-Valgfritt/sample_creator_data.sql
truncate creator_layouts;
truncate creator_templates;
truncate printers_profile;
source installer/data/mysql/ru-RU/optional/print_labels.sql
truncate creator_layouts;
truncate creator_templates;
truncate printers_profile;
source installer/data/mysql/uk-UA/optional/print_labels.sql
truncate creator_layouts;
truncate creator_templates;
truncate printers_profile;
source installer/data/mysql/en/optional/sample_creator_data.sql

--Notice the warnings
show warnings;
-- Most of them are the:
-/*!40000 ALTER TABLE `creator_layouts` DISABLE KEYS */;
-/*!40000 ALTER TABLE `creator_layouts` ENABLE KEYS */;

In the Russian, the layout_name was truncated, because the layout_name was only 20. An atomic update sql and kohastructure.sql update were provided to widen it to 25.

(2) Apply the patch
(3) Run the database update
(4) Redo step (1)
    -- There should be no warnings or errors

NOTE: fr-FR, ru-RU, and uk-UA were slightly different in structure, so the structure was made the same as the other files.
Comment 1 Mark Tompsett 2015-10-29 22:34:12 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2015-10-29 22:39:21 UTC
Don't forget to apply 15053 first, before applying this. :)
Comment 3 Chris Cormack 2015-12-23 19:49:05 UTC
CONFLICT (content): Merge conflict in installer/data/mysql/it-IT/necessari/sample_creator_data.sql
Comment 4 Mark Tompsett 2016-01-04 15:08:48 UTC Comment hidden (obsolete)
Comment 5 Bernardo Gonzalez Kriegel 2016-05-11 15:17:48 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2016-05-13 20:39:20 UTC
Created attachment 51486 [details] [review]
Bug 15086: Creators layout and template sql has warnings

When doing a hacked install off the master branch:
use ... {koha database name}
truncate creator_layouts;
truncate creator_templates;
truncate printers_profiles;
source installer/data/mysql/... {name of a sample_labels type file}
Warnings are generated, which may not be visible in the UI.

Most of the warnings were triggered by:
-/*!40000 ALTER TABLE `creator_layouts` DISABLE KEYS */;
-/*!40000 ALTER TABLE `creator_layouts` ENABLE KEYS */;
http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html#error_er_illegal_ha

In the Russian, the layout_name was truncated, because the layout_name was only 20. An atomic update sql and kohastructure.sql update were provided to widen it to 25.
http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html#error_warn_data_truncated

Also fr-FR, ru-RU, and uk-UA were slightly different in structure, so the structure was made the same as the other files.

See comment #1 for the test plan.

NOTE: pl-PL is likely very out of date, but is not affected in this regard.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works, no more warnings
mysql> show warnings;
Empty set (0.01 sec)

No errors

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Kyle M Hall 2016-05-16 17:35:37 UTC
Pushed to master for Koha 16.05, thanks Mark!
Comment 8 Julian Maurice 2016-05-17 05:57:08 UTC
Patch pushed to 3.22.x, will be in 3.22.7