Bug 13606: Upgrade sessions.a_session to MEDIUMTEXT
authorJonathan Druart <jonathan.druart@biblibre.com>
Wed, 21 Jan 2015 14:59:10 +0000 (15:59 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 23 Apr 2015 16:18:43 +0000 (13:18 -0300)
The previous patch fixed partially the problem.
If you try to update more that 1000 records, you will get the same
error.

This patch change the type of sessions.a_session from TEXT (64kb) MEDIUMTEXT (32mb).

Test plan:
1/ Try to modify a huge amount of records (1000 should be enough)
2/ Confirm it worked!

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

I confirm that with more than 1000 records the session object is truncated, and
then can't be anymore be desirialized, blocking completely Koha. Fixed with
this patch.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

This only pushes off the problem expontentially (64KB vs. 16MB), but this is a
good start.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl

index 9e5d436..eb73cc5 100644 (file)
@@ -1969,7 +1969,7 @@ CREATE TABLE `serial` ( -- issues related to subscriptions
 DROP TABLE IF EXISTS sessions;
 CREATE TABLE sessions (
   `id` varchar(32) NOT NULL,
-  `a_session` text NOT NULL,
+  `a_session` mediumtext NOT NULL,
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
index 0aaf114..fcb9d28 100755 (executable)
@@ -10183,6 +10183,15 @@ if( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q|
+         ALTER TABLE sessions CHANGE COLUMN a_session a_session MEDIUMTEXT
+    |);
+    print "Upgrade to $DBversion done (Bug 13606: Upgrade sessions.a_session to MEDIUMTEXT)\n";
+    SetVersion($DBversion);
+}
+
 # DEVELOPER PROCESS, search for anything to execute in the db_update directory
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.