OPL-update Issue

OPL-update Issue

by James Bodine -
Number of replies: 2
I've updated the webwork-open-problem-library using git pull in our campus install and now when I run OPL-update I get the following error.

8600DBD::mysql::db do failed: Data too long for column 'author' at row 1 at ./OPL-update line 736, <IN> line 601065.

Has anyone encountered this error before and figured out how to correct it?


In reply to James Bodine

Re: OPL-update Issue

by Danny Glin -
After a quick look around, here's what I think is happening:

The OPL-update script creates all of the tables in the database that it needs to store the metadata from the problems.  The maximum size of each column of each table is hard-coded in the script.

The author column in the textbook table is set to a maximum of 63 characters, and some of the author tags in individual problems exceed this.  I took a look at my database, and in my case it looks like it just truncates whatever doesn't fit.  It would appear that your server is set up to spit an error if it can't fit the data into the field.

The quick fix should be to edit the OPL-update script and change line 203 from
author varchar (63) NOT NULL
author varchar (100) NOT NULL

This will allow up to 100 characters in the author field of that table.  Hopefully this is the only offender for things that exceed the maximum space, and this allows OPL-update to complete.
In reply to Danny Glin

Re: OPL-update Issue

by James Bodine -
I suspected that too but was unsure about changing column sizes.

I changed the author column in the textbook table to 100 and running the OPL-update process it proceeded past that error.  Then I had to change the keyword column in the keyword table to 150 from 65.  Runing it again it gave me the error: 8900DBD::mysql::db do failed: Incorrect integer value: '' for column 'edition' at row 1 at ./OPL-update line 736, <IN> line 642539.

Searching through the problems I ended up have to make the following changes:

Replace EditionText1(' '), EditionText1('linear algebra','vector space','subpage'),EditionText1('Version 3.0'), EditionText1('December 9, 2010') and EditionText1('?') with EditionText1('') and running it one last time it succeeded.

It appears there is a lot of inconsistencies in the problem files.

Thanks for your help!