MantisBT - TestLink
View Issue Details
0003245TestLinkInstallerpublic2010-03-05 00:472011-03-18 19:08
goosetea1 
fman 
normalmajoralways
closedfixed 
1.9 Beta 2 
 
0003245: [MIGRATION] Can not migrate data because of incorrect data in custom fields
1. There is Java Script error in version 1.8.4 (I believe I reported it before under other username, but can't find now), when you try to enter more than 255 characters in custom field. But still you can ignore this error and enter data.
2. Now I tried to migrate database and I get this error (I susspect it comes from the JS error I mentioned above)

migrate_testcases
Updating Database Contents Failed! - Upgrade failed!
TestLink setup couldn't install the default site into the selected database. The last error to occur was Column length too big for column 'default_value' (max = 255); use BLOB or TEXT instead during the execution of SQL statement ALTER TABLE /*prefix*/custom_fields MODIFY COLUMN default_value varchar(4000) NOT NULL default ''
Migration
child of 0004040closed fman Migration problems (Container Issue) 
png bug1.png (38,840) 2010-03-05 00:47
http://mantis.testlink.org/file_download.php?file_id=1422&type=bug
png
Issue History
2010-03-05 00:47goosetea1New Issue
2010-03-05 00:47goosetea1File Added: bug1.png
2010-03-23 23:05goosetea1Note Added: 0009500
2010-03-23 23:26goosetea1Note Added: 0009501
2010-11-16 18:39goosetea1Note Added: 0012595
2010-11-20 07:56fmanNote Added: 0012664
2010-11-20 07:57fmanNote Edited: 0012664bug_revision_view_page.php?bugnote_id=12664#r640
2010-11-20 07:59fmanNote Added: 0012665
2010-11-20 07:59fmanAssigned To => fman
2010-11-20 07:59fmanStatusnew => assigned
2010-11-20 10:31fmanRelationship addedchild of 0004040
2010-11-20 10:31fmanSummaryCan not migrate data because of incorrect data in custom fields => [MIGRATION] Can not migrate data because of incorrect data in custom fields
2010-11-20 10:32fmanTag Attached: Migration
2010-12-21 10:38goosetea1Note Added: 0013050
2010-12-21 10:41goosetea1Note Edited: 0013050bug_revision_view_page.php?bugnote_id=13050#r760
2010-12-21 11:37fmanStatusassigned => resolved
2010-12-21 11:37fmanResolutionopen => fixed
2011-03-18 19:08fmanNote Added: 0014022
2011-03-18 19:08fmanStatusresolved => closed

Notes
(0009500)
goosetea1   
2010-03-23 23:05   
by the way, it is reproduced in 1.9 beta3

TestLink setup couldn't install the default site into the selected database. The last error to occur was Column length too big for column 'default_value' (max = 255); use BLOB or TEXT instead during the execution of SQL statement ALTER TABLE /*prefix*/custom_fields MODIFY COLUMN default_value varchar(4000) NOT NULL default ''

in beta 2 I migrated data by changing data types in sql scripts. But I am not sure that it is correct thing to do. I guess I will be changing field types then in all versions to come :(
(0009501)
goosetea1   
2010-03-23 23:26   
it looks as if the problem with varchar(4000) throughout mysql scripts

ALTER TABLE /*prefix*/custom_fields MODIFY COLUMN default_value varchar(4000) NOT NULL default '';

from what I read varchar can be 0 - 255
VARCHAR( ) A variable section from 0 to 255 characters long.
(0012595)
goosetea1   
2010-11-16 18:39   
still the problem is present in 1.9 release
TestLink setup will now attempt to setup the database:

Creating connection to Database Server: OK!

Connecting to database `test19`: OK!
Creating Testlink DB user `root`: OK! (ok - user_exists ok - grant assignment)
Processing:sql/alter_tables/1.9/mysql/DB.1.3/step1/db_schema_update.sql
migrate_testcasesRecords to process: count($workingSet)


 ============================================================================== DB Access Error - debug_print_backtrace() OUTPUT START ============================================================================== #0 database->exec_query( INSERT INTO cfield_design_values (field_id,node_id,value) VALUES ( 3, 14, '' ),( 3, 128, '' ),( 3, 204, '' ),( 3, 4153, '' ),( 3, 18, '' ),( 3, 130, '' ),( 3, 4049, '' ),( 3, 4154, '' ),( 3, 22, '' ),( 3, 206, '' ),( 3, 1127, '' ),( 3, 3889, '' ),( 3, 24, '' ),( 3, 26, '' ),( 3, 213, '' ),( 3, 1878, '' ),( 3, 28, 'User can select type of sorting (ascending or descending).' ),( 3, 32, '' ),( 3, 217, '' ),( 3, 34, '' ),( 3, 218, '' ),( 3, 36, '' ),( 3, 38, 'External organization users will see only candidates assigned to the organization profile.
Recruiters will see only their Candidates and Candidates with ATL status.' ),( 3, 137, 'External organization users will see only candidates assigned to the organization profile.
Recruiters will see only their Candidates and Candidates with ATL status.' ),( 3, 219, 'External organization users will see only candidates assigned to the organization profile.
Recruiters will see only their Candidates and Candidates with ATL status.' ),( 3, 40, 'User can select type of sorting (ascending or descending).' ),( 3, 44, 'Assign ?? is used in the case of ATL (Available to Lock) and TEMP LOCK Candidates or to reassign from an existing Recruiter to a new Recruiter.
Recruiter Manager can assign Recruiter only for Candidates from his Organization and Program.' ),( 3, 220, 'Assign ?? is used in the case of ATL (Available to Lock) and TEMP LOCK Candidates or to reassign from an existing Recruiter to a new Recruiter.
Recruiter Manager can assign Recruiter only for Candidates from his Organization and Program.' ),( 3, 221, 'Assign ?? is used in the case of ATL (Available to Lock) and TEMP LOCK Candidates or to reassign from an existing Recruiter to a new Recruiter.
Recruiter Manager can assign Recruiter only for Candidates from his Organization and Program.' ),( 3, 1348, 'Assign ?? is used in the case of ATL (Available to Lock) and TEMP LOCK Candidates or to reassign from an existing Recruiter to a new Recruiter.
Recruiter Manager can assign Recruiter only for Candidates from his Organization and Program.' ),( 3, 1349, 'Assign ?? is used in the case of ATL (Available to Lock) and TEMP LOCK Candidates or to reassign from an existing Recruiter to a new Recruiter.
Recruiter Manager can assign Recruiter only for Candidates from his O
(0012664)
fman   
2010-11-20 07:56   
(edited on: 2010-11-20 07:57)
From MySQL Manuals:

Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions. The effective maximum length of a VARCHAR in MySQL 5.0.3 and later is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used.

We expect people is using MySQL > 5.0.3 (just for the records XAMPP 1.7.3 is provided with MySQL 5.1.41).

(0012665)
fman   
2010-11-20 07:59   
If you can provide your db (export zipped) we can do test on it ->
send to francisco.mancardi@gmail.com
(0013050)
goosetea1   
2010-12-21 10:38   
(edited on: 2010-12-21 10:41)
Sorry that I didn't answer before. I was on holiday.
I appreciate that you've pointed to mysql version. I had 4.1 so when I moved to 5.5 this problem with Varchar was resolved.
I had some difficulties with migration due to new tables in old database (probably at some point new tables were created in old database). But it is not direct testlink issue. I had to remove new tables from old dump (because migration script was giving me errors like "this table already exists").
And then some problems with ' being used in test cases. Looked like migration script couldn't handle \' and gave me errors like "inappropriate syntaxsys".
Anyway all those troubles were rather local troubles.
I think we should close this bug. thanks.

(0014022)
fman   
2011-03-18 19:08   
release - 1.9.2 - 20110320