View Issue Details

IDProjectCategoryView StatusLast Update
0011282mantisbtdb oraclepublic2014-09-23 18:05
Reporterbob Assigned Todregad  
PrioritynormalSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
Fixed in Version1.2.6 
Summary0011282: For 1.3.0 - ORA-00918: column ambiguously defined for the query: SELECT DISTINCT m_bug_tbl.*
Description

Getting error from Oracle about ambiguously defined columns

Steps To Reproduce

Probably only occurs with Oracle, but is due to the duplication of column names in the select clause.

TagsNo tags attached.
Attached Files
filter_api_bug1b.png (17,607 bytes)   
filter_api_bug1b.png (17,607 bytes)   
filter_api_bug1a.png (18,766 bytes)   
filter_api_bug1a.png (18,766 bytes)   
filter_api.php.patch (312 bytes)   
--- mantisbt-mantisbt-2521b5a/core/filter_api.php	Tue Apr  5 10:13:30 2011
+++ PROD_VER/core/filter_api.php	Mon Jul 25 12:14:22 2011
@@ -1083,8 +1083,6 @@
 	);
 	$t_select_clauses = array(
 		"$t_bug_table.*",
-		"$t_bug_table.last_updated",
-		"$t_bug_table.date_submitted",
 	);
 
 	$t_join_clauses = array();
filter_api.php.patch (312 bytes)   

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 

Activities

bob

bob

2009-12-11 13:31

reporter   ~0023897

Suggested Fix is:
Line 1074 of filter_api.php

Replace
"$t_bug_table.*",
"$t_bug_table.last_updated",
"$t_bug_table.date_submitted",

with
"$t_bug_table.ID",
"$t_bug_table.PROJECT_ID",
"$t_bug_table.REPORTER_ID",
"$t_bug_table.HANDLER_ID",
"$t_bug_table.DUPLICATE_ID",
"$t_bug_table.PRIORITY",
"$t_bug_table.SEVERITY",
"$t_bug_table.REPRODUCIBILITY",
"$t_bug_table.STATUS",
"$t_bug_table.RESOLUTION",
"$t_bug_table.PROJECTION",
"$t_bug_table.ETA",
"$t_bug_table.BUG_TEXT_ID",
"$t_bug_table.OS",
"$t_bug_table.OS_BUILD",
"$t_bug_table.PLATFORM",
"$t_bug_table.VERSION",
"$t_bug_table.FIXED_IN_VERSION",
"$t_bug_table.BUILD",
"$t_bug_table.PROFILE_ID",
"$t_bug_table.VIEW_STATE",
"$t_bug_table.SUMMARY",
"$t_bug_table.SPONSORSHIP_TOTAL",
"$t_bug_table.STICKY",
"$t_bug_table.TARGET_VERSION",
"$t_bug_table.CATEGORY_ID",
"$t_bug_table.DUE_DATE",
"$t_bug_table.LAST_UPDATED",
"$t_bug_table.DATE_SUBMITTED",

bob

bob

2009-12-25 13:52

reporter   ~0023984

Probably a better fix is just to comment out the last 2 columns listed, ie:

Line 1074 of filter_api.php

Change
"$t_bug_table.*",
"$t_bug_table.last_updated",
"$t_bug_table.date_submitted",

to
"$t_bug_table.*",

"$t_bug_table.last_updated",

    # "$t_bug_table.date_submitted",
DKuranov

DKuranov

2011-07-26 03:12

reporter   ~0029291

Patch against 1.2.5 attached.

dregad

dregad

2011-07-26 08:32

developer   ~0029295

Paul commented in IRC that this fix may break MS SQL - I have no way of testing that. It works on MySQL, and I can execute the query on Oracle (but I don't run Mantis on that so I can't fully test - I assume that the 2 people who proposed the patch did test).

If anyone has an issue with MS SQL, please update this.

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036429

Marking as 'acknowledged' not resolved/closed to track that change gets ported to master-2.0.x branch

grangeway

grangeway

2014-05-16 15:01

reporter   ~0040491

MantisBT currently supports Mysql and has support for other database engines.

The support for other databases is known to be problematic.

Having implemented the current database layer into Mantis 10 years ago, I'm currently working on replacing the current layer.

If you are interested in using Mantis with non-mysql databases - for example, Oracle, PGSQL or MSSQL, and would be willing to help out testing the new database layer, please drop me an email at paul@mantisforge.org

In the meantime, I'd advise running Mantis with Mysql Only to avoid issues.

Thanks
Paul

Related Changesets

MantisBT: master-1.2.x 817a8341

2011-07-26 01:03

dregad


Details Diff
Fix 0011282: Oracle error ORA-00918 column ambiguously defined

Filter API does a SELECT DISTINCT $t_bug_table.*; before this patch the fields
list also included 2 additional columns; MySQL had no problem with that, but
Oracle gave the above-mentioned error.
Affected Issues
0011282
mod - core/filter_api.php Diff File

MantisBT: master 0b3b459c

2011-07-26 01:03

dregad


Details Diff
Fix 0011282: Oracle error ORA-00918 column ambiguously defined

Filter API does a SELECT DISTINCT $t_bug_table.*; before this patch the fields
list also included 2 additional columns; MySQL had no problem with that, but
Oracle gave the above-mentioned error.
Affected Issues
0011282
mod - core/filter_api.php Diff File