View Issue Details

IDProjectCategoryView StatusLast Update
0006428mantisbtcustom fieldspublic2006-02-04 05:53
Reportercristic Assigned Toryandesign  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionduplicate 
Product Version0.19.3 
Summary0006428: MySQL 5: Unknown column 'p.field_id' in 'on clause'
Description

On MySQL 5.0.15 with:
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,STRICT_ALL_TABLES"

you have the following error:

APPLICATION ERROR 0000401
Database query failed. Error received from database was #1054: Unknown column 'p.field_id' in 'on clause' for the query: SELECT f.name, f.type, f.access_level_r, f.default_value, f.type, s.value
FROM mantis_custom_field_project_table AS p, mantis_custom_field_table AS f
LEFT JOIN mantis_custom_field_string_table AS s
ON p.field_id=s.field_id AND s.bug_id='1188'
WHERE p.project_id = '6' AND p.field_id = f.id
ORDER BY p.sequence ASC, f.name ASC

Additional Information

Into the custom_field_api.php at line 753:

$query = "SELECT f.name, f.type, f.access_level_r, f.default_value, f.type, s.value
FROM $t_custom_field_project_table AS p, $t_custom_field_table AS f
LEFT JOIN $t_custom_field_string_table AS s
ON p.field_id=s.field_id AND s.bug_id='$c_bug_id'
WHERE p.project_id = '$c_project_id' AND p.field_id = f.id
ORDER BY p.sequence ASC, f.name ASC";

should be transformed to:

$query = "SELECT f.name, f.type, f.access_level_r, f.default_value, f.type, s.value
FROM $t_custom_field_project_table AS p INNER JOIN $t_custom_field_table AS f ON p.field_id = f.id
LEFT JOIN $t_custom_field_string_table AS s
ON p.field_id=s.field_id AND s.bug_id='$c_bug_id'
WHERE p.project_id = '$c_project_id'
ORDER BY p.sequence ASC, f.name ASC";

TagsNo tags attached.

Relationships

duplicate of 0006394 closedthraxisp Unknown column p.field_id when closing bug when using MySQL >= 5.0.12 

Activities

There are no notes attached to this issue.