Bug 33368: Extends borrowers.flags to bigint
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 30 Mar 2023 07:58:30 +0000 (09:58 +0200)
committerJacob O'Mara <jacobomara901@gmail.com>
Sun, 16 Apr 2023 17:52:33 +0000 (18:52 +0100)
commitd978e86b2db3f712cdbecbf548278286f5b16b59
tree3ab00f4cf7e0905abf5ea50f63e3a307aa4611fa
parent593b45dcb132db749efa86b11484f75b51dbc674
Bug 33368: Extends borrowers.flags to bigint

it's a int(11) which means its limit is 2^31

We have currently 29 permissions, there is only one remaining, at 31 permissions
the permission system won't support a case where a patron has all permissions.

Test plan:
Don't apply this patch
Add another permission
INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES (30, 'new permission 1', '', 0) ;
Go to the interface, tick all the boxes
select flags from borrowers where borrowernumber=5;
=> 2113928830
Remember:
2^31  2147483648
2^32  4294967296

Add another one
INSERT INTO userflags (bit, flag, flagdesc, defaulton) VALUES (31, 'new permission 2', '', 0) ;
Repeat the step before
=> boom
CGI::Compile::ROOT::kohadevbox_koha_members_member_2dflags_2epl::member_2dflags_2epl(): DBI Exception: DBD::mysql::st execute failed: Out of range value for column 'flags' at row 1 at /usr/share/perl5/CGI/Emulate/PSGI.pm line 30

Apply the patch, try again

QA note: That's ofc not the best solution, but the easiest for now

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e81612c7191c8136ed72ce9c59e3951ca3c9adbc)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
installer/data/mysql/atomicupdate/bug_33368.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql