From c2fe8173da9348b6fa471fb909be152d66043c1d Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Wed, 21 Aug 2024 15:14:24 -0500 Subject: [PATCH 1/2] Use an "expression" to specify the `session` column default in the `key` table. MySQL requires that the default value for a `TEXT` column be written as an expression. See https://dev.mysql.com/doc/refman/8.4/en/data-type-defaults.html. MariaDB apparently works fine without this, but works fine with it as well. This fixes issue #2536. --- lib/WeBWorK/DB/Record/Key.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WeBWorK/DB/Record/Key.pm b/lib/WeBWorK/DB/Record/Key.pm index b6381f66c5..6dc1a0dc6d 100644 --- a/lib/WeBWorK/DB/Record/Key.pm +++ b/lib/WeBWorK/DB/Record/Key.pm @@ -30,7 +30,7 @@ BEGIN { user_id => { type => "VARCHAR(100) NOT NULL", key => 1 }, key => { type => "TEXT" }, timestamp => { type => "BIGINT" }, - session => { type => "TEXT NOT NULL DEFAULT '{}'" }, + session => { type => "TEXT NOT NULL DEFAULT ('{}')" }, ); } From df3d00e5864a382dd5313e49f4651cb37a41db22 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Tue, 27 Aug 2024 15:46:01 -0500 Subject: [PATCH 2/2] Also use an "expression" to specify the `data` column default in the `lti_launch_data` table. --- lib/WeBWorK/DB/Record/LTILaunchData.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/WeBWorK/DB/Record/LTILaunchData.pm b/lib/WeBWorK/DB/Record/LTILaunchData.pm index 46e7619848..b198330045 100644 --- a/lib/WeBWorK/DB/Record/LTILaunchData.pm +++ b/lib/WeBWorK/DB/Record/LTILaunchData.pm @@ -30,7 +30,7 @@ BEGIN { state => { type => "VARCHAR(200) NOT NULL", key => 1 }, nonce => { type => "TEXT NOT NULL" }, timestamp => { type => "BIGINT" }, - data => { type => "TEXT NOT NULL DEFAULT '{}'" } + data => { type => "TEXT NOT NULL DEFAULT ('{}')" } ); }