View Issue Details

IDProjectCategoryView StatusLast Update
0008220mantisbtdb mssqlpublic2014-05-16 15:00
Reporterrzg Assigned Togiallu  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version1.1.0a4 
Summary0008220: New summary item contains invalid sql
Description

The new code in core/summary_api.php summary_print_by_activity() Line 290 contains SQL errors:

SELECT COUNT(h.id) as count, b.id, b.summary
FROM mantis_bug_table AS b, mantis_bug_history_table AS h
WHERE h.bug_id = b.id
AND b.status < 80
AND project_id=28
GROUP BY h.bug_id
ORDER BY count DESC, b.last_updated DESC

Msg 8120, Level 16, State 1, Line 1
Column 'b.id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Msg 8120, Level 16, State 1, Line 1
Column 'b.summary' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Msg 8127, Level 16, State 1, Line 1
Column name 'b.last_updated' is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause.

TagsNo tags attached.

Activities

rzg

rzg

2007-08-01 10:03

reporter   ~0015317

GROUP BY h.bug_id, b.id, b.summary, b.last_updated is one way to fix...

giallu

giallu

2007-08-01 10:23

reporter   ~0015318

great... because I have zero experience with MSSQL.

I'm trying the fix with MySQL and will commit the changed query if it works

rzg

rzg

2007-08-01 10:52

reporter   ~0015319

Ok.

FYI http://dev.mysql.com/doc/refman/5.1/en/group-by-hidden-fields.html explains this MySQL extension. You can set a specific SQL mode to disable it if you want to emulate the behavior of other DBMSs.

giallu

giallu

2007-08-01 11:22

reporter   ~0015321

I verified MySQL is not affected and applied the full GROUP BY clause.

Thanks for your testing and report

grangeway

grangeway

2014-05-16 15:00

reporter   ~0040414

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 c7ac83dd

2007-08-01 11:20

giallu


Details Diff
Fix 8220: New summary item contains invalid (MS)sql

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@4522 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0008220
mod - core/summary_api.php Diff File