WeBWorK Main Forum

DBD::MariaDB::st execute failed: Data too long for column 'answer_string'

DBD::MariaDB::st execute failed: Data too long for column 'answer_string'

by Ama Chefe -
Number of replies: 1

I have been battling with the "Data too long for column 'answer_string'" on this particular course for some weeks now. It started from WW 2.15 and Mysql, and still on WW 2.16 on MariaDB.

DBD::MariaDB::st execute failed: Data too long for column 'answer_string' at row 1 at /opt/webwork/webwork2/lib/WeBWorK/DB/Schema/NewSQL/Std.pm line 891.\n * in WeBWorK::DB::addPastAnswer called at line 115 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/ProblemUtil/ProblemUtil.pm\n * in WeBWorK::ContentGenerator::ProblemUtil::ProblemUtil::process_and_log_answer called at line 813 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm\n * in WeBWorK::ContentGenerator::Problem::pre_header_initialize called at line 213 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm\n * in WeBWorK::ContentGenerator::go called at line 386 of /opt/webwork/webwork2/lib/WeBWorK.pm, referer: https://webwork.xxx.edu/webwork2/STA212/Assignment1/1/

In reply to Ama Chefe

Re: DBD::MariaDB::st execute failed: Data too long for column 'answer_string'

by Nathan Wallach -
Based on https://github.com/openwebwork/webwork2/blob/main/lib/WeBWorK/DB/Record/PastAnswer.pm it seems that the limit is 5012 characters, and this does not seem to have changed in recent versions of WeBWorK.

I would suspect that if there is a problem it is either with some specific question or with "very long answers" entered by a a student.