]> git.koha-community.org Git - koha.git/commit
Bug 34494: Table tmp_holdsqueue fails to be created for MySQL 8
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 8 Aug 2023 11:07:34 +0000 (07:07 -0400)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 15 Aug 2023 08:25:58 +0000 (11:25 +0300)
commit158ac7df71f3be25bcba85543ff98eef4d5c6ad3
treea1bac2023056c6c145e84e82f93db52c0b6cc7f0
parent813cfe1eec1f6090f715638a774fa755b5ff4788
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!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
installer/data/mysql/atomicupdate/fix_tmp_holdsqueue.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql