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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 6 Apr 2023 15:53:19 +0000 (12:53 -0300)
commite81612c7191c8136ed72ce9c59e3951ca3c9adbc
tree34becc7e9ab0e85af3747388bca20475152ee41e
parent6b9117df81f7fe4691e0cba54ff4e0f1e0762a26
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>
installer/data/mysql/atomicupdate/bug_33368.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql