View Issue Details

IDProjectCategoryView StatusLast Update
0020513mantisbtcode cleanuppublic2016-08-15 09:02
ReporteratrolAssigned Todregad 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
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

View 3 revisions

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 07:07:19

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
mod - core/custom_field_api.php Diff File

MantisBT: master ac3f577f

2016-01-14 07:07:19

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
mod - core/custom_field_api.php Diff File

Issue History

Date Modified Username Field Change
2016-01-13 17:42 atrol New Issue
2016-01-14 07:11 dregad Changeset attached => MantisBT master-1.2.x 0d624abf
2016-01-14 07:11 dregad Assigned To => dregad
2016-01-14 07:11 dregad Status new => resolved
2016-01-14 07:11 dregad Resolution open => fixed
2016-01-14 07:11 dregad Fixed in Version => 1.2.20
2016-01-14 07:11 dregad Changeset attached => MantisBT master ac3f577f
2016-01-14 07:17 dregad Target Version => 1.2.20
2016-01-14 07:17 dregad Note Added: 0052308
2016-01-14 07:17 dregad Note Edited: 0052308 View Revisions
2016-01-14 07:26 dregad Note Edited: 0052308 View Revisions
2016-08-15 09:02 dregad Status resolved => closed