[LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm
raeburn
raeburn at source.lon-capa.org
Thu Mar 4 18:54:36 EST 2021
raeburn Thu Mar 4 23:54:36 2021 EDT
Modified files:
/loncom/interface loncoursedata.pm
Log:
- Bug 6949
Store placeholder in place of actual submission in md5_*_parameter table if
data length of submission > max_allowed_packet size for MySQL server.
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.205 loncom/interface/loncoursedata.pm:1.206
--- loncom/interface/loncoursedata.pm:1.205 Tue Mar 2 19:51:02 2021
+++ loncom/interface/loncoursedata.pm Thu Mar 4 23:54:36 2021
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: loncoursedata.pm,v 1.205 2021/03/02 19:51:02 raeburn Exp $
+# $Id: loncoursedata.pm,v 1.206 2021/03/04 23:54:36 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1150,18 +1150,28 @@
if ($length > $max_param) {
&Apache::lonnet::logthis("SQL parameter insert for student: $sname for parameter: $parameter would exceed max_allowed_packet size");
&Apache::lonnet::logthis("symb_id: $symb_id");
- &Apache::lonnet::logthis("Skipping this item. You may want to increase the max_allowed_packet size from the current: $max_allowed_packet");
- next;
- } else {
- if ($length + $curr_params_length > $max_param) {
- push(@store_parameters_values,$curr_params_values);
- $curr_params_values = $sql_parameter;
- $curr_params_length = $length;
+ &Apache::lonnet::logthis("You may want to increase the max_allowed_packet size from the current: $max_allowed_packet");
+ if ($parameter =~ /\.submission$/) {
+ $sql_parameter = "('".join("','",
+ $symb_id,$student_id,
+ $parameter)."',".
+ $dbh->quote('WARNING: Submission too large -- see grading interface for actual submission')."),\n";
+ $length = length($sql_parameter);
+ &Apache::lonnet::logthis("Placeholder inserted instead of value of actual submission");
+ &Apache::lonnet::logthis("See grading interface for the actual submission");
} else {
- $curr_params_values .= $sql_parameter;
- $curr_params_length += $length;
+ &Apache::lonnet::logthis("Skipping this item");
+ next;
}
}
+ if ($length + $curr_params_length > $max_param) {
+ push(@store_parameters_values,$curr_params_values);
+ $curr_params_values = $sql_parameter;
+ $curr_params_length = $length;
+ } else {
+ $curr_params_values .= $sql_parameter;
+ $curr_params_length += $length;
+ }
} else {
$curr_params_values .= $sql_parameter;
}
More information about the LON-CAPA-cvs
mailing list