Bugzilla – Attachment 154315 Details for
Bug 34494
Table tmp_holdsqueue fails to be created for MySQL 8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34494: Table tmp_holdsqueue fails to be created for MySQL 8
Bug-34494-Table-tmpholdsqueue-fails-to-be-created-.patch (text/plain), 2.27 KB, created by
Kyle M Hall (khall)
on 2023-08-08 11:19:57 UTC
(
hide
)
Description:
Bug 34494: Table tmp_holdsqueue fails to be created for MySQL 8
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2023-08-08 11:19:57 UTC
Size:
2.27 KB
patch
obsolete
>From d2e4e3e56a4107e76697684bb847e0d38db5b746 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 8 Aug 2023 07:07:34 -0400 >Subject: [PATCH] Bug 34494: Table tmp_holdsqueue fails to be created for MySQL > 8 > >It appears that MySQL 8 rejects creating any table where the primary key is nullable. The table tmp_holdsqueue has a nullable pk ( itemnumber ) but there is no reason for this column to be nullable ( generating a holds queue entry with no itemnumber is not possible ) so it make sense to just remove the nullability for MySQL compatiability. > >Test Plan: >1) Using MySQL 8.0, attempt to create a database from kohastructure.sql > If you use ktd, you can try: DB_IMAGE=mysql:8.0 ktd up >2) Note the failure to create the table >3) Apply this patch >4) Repeat step 1 >5) The table is created! >--- > .../data/mysql/atomicupdate/fix_tmp_holdsqueue.pl | 14 ++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 +- > 2 files changed, 15 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/fix_tmp_holdsqueue.pl > >diff --git a/installer/data/mysql/atomicupdate/fix_tmp_holdsqueue.pl b/installer/data/mysql/atomicupdate/fix_tmp_holdsqueue.pl >new file mode 100755 >index 00000000000..8f9346d9295 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/fix_tmp_holdsqueue.pl >@@ -0,0 +1,14 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "34494", >+ description => "Fix tmp_holdsqueue for MySQL compatiability", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{ >+ ALTER TABLE tmp_holdsqueue CHANGE COLUMN itemnumber `itemnumber` int(11) NOT NULL >+ }); >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index c1f800fe7f6..0943df54e53 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -5870,7 +5870,7 @@ DROP TABLE IF EXISTS `tmp_holdsqueue`; > /*!40101 SET character_set_client = utf8 */; > CREATE TABLE `tmp_holdsqueue` ( > `biblionumber` int(11) DEFAULT NULL, >- `itemnumber` int(11) DEFAULT NULL, >+ `itemnumber` int(11) NOT NULL, > `barcode` varchar(20) DEFAULT NULL, > `surname` longtext NOT NULL, > `firstname` mediumtext DEFAULT NULL, >-- >2.30.2
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 34494
:
154315
|
154317
|
154417
|
154418