View Issue Details

IDProjectCategoryView StatusLast Update
0020513mantisbtcode cleanuppublic2016-08-15 09:02
Reporteratrol Assigned Todregad  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version1.2.20Fixed in Version1.2.20 
Summary0020513: Double fetch of same database column
Description

The column "type" is fetched two times in the following statement
$t_query = 'SELECT f.name, f.type, f.access_level_r, f.default_value, f.type, s.value ....
in function custom_field_get_all_linked_fields

The fix for it in Mantis is trivial.

It's worth to mention that there might be a bug in ADOdb that can cause issues in certain circumstances.
Maybe there is a problem when counting fields if there is the same field name in a statement more than one time.
Error you get is:
[mantisconnect.php] Error Type: SYSTEM NOTICE,
Error Description: Undefined offset: 5
Stack Trace:
adodb.inc.php L1357 FetchField(<integer>5)
...

For the whole story have a look at
https://www.mantisbt.org/forums/viewtopic.php?f=4&t=21339

TagsNo tags attached.

Activities

dregad

dregad

2016-01-14 07:17

developer   ~0052308

Last edited: 2016-01-14 07:26

Removed the duplicated field in the SQL.

Note: The second occurence of 'f.type' was introduced a long time ago (before 1.0.0), in commit MantisBT master dbd2e96b

Related Changesets

MantisBT: master-1.2.x 0d624abf

2016-01-14 02:07

dregad


Details Diff
Do not fetch column twice in the same query

Doing so with mssqlnative driver triggers a PHP NOTICE in ADOdb library,
likely due to the use of associative fetch mode.

Fixes 0020513
Affected Issues
0020513
mod - core/custom_field_api.php Diff File

MantisBT: master ac3f577f

2016-01-14 02:07

dregad


Details Diff
Do not fetch column twice in the same query

Doing so with mssqlnative driver triggers a PHP NOTICE in ADOdb library,
likely due to the use of associative fetch mode.

Fixes 0020513
Affected Issues
0020513
mod - core/custom_field_api.php Diff File