From: John J. <jj...@as...> - 2007-07-18 17:38:04
|
Thanks for the suggestion Gavin, but it didn't work, giving the same error for location_addresses. This seems to be because there are two parts to the key, and 255+255>500. I noticed that in lib/WeBWorK/DB/Schema/NewSQL/Std.pm, there is a place where 255 is specified as part of a key length. I changed that to 25 (which might be a more sensible value anyway), and addcourse seemed to get farther. Now the error is skipping creation of 'problem_merged' table: no create_table method When I go into the new course, things seem ok until I create a problem set, and then try to edit the list of problems in the set. Then I get the same error I was getting on the older course: |Can't call method "get_fields_where" on an undefined value at /opt/devel/webwork-modperl/lib/WeBWorK/DB.pm line 717. | Call stack The information below can help locate the source of the problem. * |in WeBWorK::DB::listLocations called at line 597 of /opt/devel/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm| * |in WeBWorK::ContentGenerator::Instructor::ProblemSetDetail::extraSetFields called at line 344 of /opt/devel/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm| * |in WeBWorK::ContentGenerator::Instructor::ProblemSetDetail::FieldTable called at line 1685 of /opt/devel/webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/ProblemSetDetail.pm| * |in WeBWorK::ContentGenerator::Instructor::ProblemSetDetail::body called at line 152 of /opt/devel/webwork-modperl/lib/WeBWorK/Template.pm| * |in WeBWorK::Template::template called at line 486 of /opt/devel/webwork-modperl/lib/WeBWorK/ContentGenerator.pm| * |in WeBWorK::ContentGenerator::content called at line 194 of /opt/devel/webwork-modperl/lib/WeBWorK/ContentGenerator.pm| * |in WeBWorK::ContentGenerator::go called at line 338 of /opt/devel/webwork-modperl/lib/WeBWorK.pm| This seems to be connected to the locations business. John P. Gavin LaRose wrote: > Hi John, > > I can't see anywhere in the WeBWorK code that the key length is > defined. However, if the database has some funny definition it would > throw an error whenever you bumped into it. The only place I can see > a length of 500 is in the location_addresses table, so I'd be tempted > to try and make sure that there isn't still a residual error with > that. My solution would be the "heavy club" method, of dropping the > tables I think might be offending and then recreating them, e.g., > mysql> use webwork; > mysql> drop table locations; > mysql> drop table location_addresses; > mysql> create table locations (location_id tinyblob not null, > > description text, primary_key (location_id(255))); > mysql> create table location_addresses ((location_id tinyblob not > null, > > ip_mask tinyblob not null, primary key (location_id(255), > > ip_mask(255))); > > Gavin > |