View Issue Details

IDProjectCategoryView StatusLast Update
0010329mantisbtupgradepublic2009-06-23 15:28
Reporterdurk Assigned Tograngeway  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0a3 
Fixed in Version1.2.0rc1 
Summary0010329: Receive duplicate key on upgrade from 1.1.6 to 1.2.0a3 if existing categories exist with a leading or tailing space
Description

Receive duplicate key on upgrade from 1.1.6 to 1.2.0a3 if existing categories exist with a leading or tailing space

Steps To Reproduce

Add multiple bugs in a 1.1.6 install with a category "fubar" and then " fubar" or "fubar ".

When you run the upgrade script it will crash with duplicate key when it tries to insert the value twice.

Additional Information

Fixed this for my installation by wrapping the column name 'category' in a trim function in the install_functions.php - eg:

$query = "SELECT project_id, trim(category) as category FROM $t_project_category_table ORDER BY project_id, category";
$t_category_result = db_query_bound( $query );

$query = "SELECT project_id, trim(category) as category FROM $t_bug_table ORDER BY project_id, category";
$t_bug_result = db_query_bound( $query );
TagsNo tags attached.

Activities

grangeway

grangeway

2009-04-18 13:04

reporter   ~0021593

Patch commited to GIT trunk

Paul