View Issue Details

IDProjectCategoryView StatusLast Update
0011744mantisbtdb mssqlpublic2014-09-23 18:05
Reporterczema Assigned Torombert  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
OSWindows 2003 Standard 
Product Version1.2.0 
Target Version1.2.9Fixed in Version1.2.9 
Summary0011744: Failure getting tag candidates on MSSQL
Description

When no tags have been defined, going to view.php throws the following error:

Database query failed. Error received from database was 0002812: Could not find stored procedure 'NE'. for the query: SELECT id, name, description FROM mantis_tag_table WHERE id IN ( ) ORDER BY name ASC .

Steps To Reproduce

On a new installation of Mantis on MSSQL, create a new bug. View the bug.

Additional Information

The above query is generated on line 425 in /core/tag_api.php. The error results because no tags exist in the mantis_bug_tag_table. Therefore, there is no tag names are inserted into the IN function.

This can be resolved by returning an empty array if the query on line 417 returns no rows.

TagsNo tags attached.

Relationships

related to 0015721 closedgrangeway Functionality to consider porting to master-2.0.x 
has duplicate 0012954 closedrombert Cannont view issue details 
related to 0014395 closeddregad Critical Failure when Assigning Tags to Multiple Issues at Once 

Activities

czema

czema

2010-04-05 14:36

reporter   ~0025032

I am not a PHP programmer, but I believe adding this at line 421 will resolve the issue:

if ($result.EOF) return $t_subquery_results;

makafre

makafre

2010-04-07 16:34

reporter   ~0025056

Last edited: 2010-04-07 16:35

Your fix helped me too, I was having a similar error.

I am also getting:

Database query failed. Error received from database was 0000209: Ambiguous column name 'id'. for the query: SELECT DISTINCT mantis_bug_table.*, mantis_bug_table.last_updated, mantis_bug_table.date_submitted FROM mantis_project_table, mantis_bug_table WHERE mantis_project_table.enabled = ? AND mantis_project_table.id = mantis_bug_table.project_id AND ( mantis_bug_table.project_id = 1 ) ORDER BY id DESC, mantis_bug_table.last_updated DESC, mantis_bug_table.date_submitted DESC.

(check the ORDER BY part)

This is when I click on "View Issues", did you get that as well?

czema

czema

2010-04-07 16:55

reporter   ~0025057

I haven't received that error yet. This is a different problem altogether. A new issue should be opened for it.

It is clear that the ORDER BY clause needs to be fixed. It should say "mantis_bug_table.id DESC" rather than "id DESC"

jyperion

jyperion

2011-10-14 06:28

reporter   ~0029957

My 2 cents: to really get the tags combo box fill in well:

while( $row = db_fetch_array( $result ) ) {
422

  • $t_subquery_results[] = (int)$row;
    422
  • $t_subquery_results[] = (int)$row['id'];
    423 423
    }
rombert

rombert

2011-10-14 06:48

reporter   ~0029959

Last edited: 2011-10-14 06:48

Can you retry with latest master-1.2.x from git ? I've applied a fix for bug 0013363 which should solve this problem as well.

jyperion

jyperion

2011-10-14 08:11

reporter   ~0029961

I have tried with your patch too.
In fact, your patch correct an error when No tags are created.
If you create several tags,just the id=1 is displayed.
the $row gives an array, and not an integer, this array is converted into (1,1) ... the next query is false.

rombert

rombert

2011-10-14 08:47

reporter   ~0029963

Got it, thanks. Can you resubmit the pull request on github or just attach a patch?

jyperion

jyperion

2011-10-14 09:36

reporter   ~0029964

here is :
https://github.com/mantisbt/mantisbt/pull/18

i change the order for return the empty array in first

ps
(I have an account under mantisbt.org/bugs, with an hotmail.com email ... never received the activation URL (and email not put in junk folder)
jyperion is the same person as gcompagnon

rombert

rombert

2011-10-14 09:45

reporter   ~0029965

Thanks! I started a discussion on the pull request.

jyperion

jyperion

2011-10-14 09:51

reporter   ~0029966

I closed the 18

here is the correct (last) one:
https://github.com/mantisbt/mantisbt/pull/19

rombert

rombert

2011-10-14 10:09

reporter   ~0029968

Cherry-picked to 1.2.x as well. Thanks!

grangeway

grangeway

2013-04-05 17:57

reporter   ~0036250

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

grangeway

grangeway

2014-05-16 15:00

reporter   ~0040349

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 c2a05f8c

2011-10-14 02:50

user21490


Details Diff
Fix 0011744: Failure getting tag candidates on MSSQL
make the query to get the available tags id , return the correct list
Affected Issues
0011744
mod - core/tag_api.php Diff File

MantisBT: master-1.2.x 52ac5d2f

2011-10-14 02:50

user21490


Details Diff
Fix 0011744: Failure getting tag candidates on MSSQL
make the query to get the available tags id , return the correct list
Affected Issues
0011744
mod - core/tag_api.php Diff File

MantisBT: master 12cf79d3

2011-10-14 03:03

rombert


Details Diff
Merge pull request #19 from gcompagnon/patch-4

Fix 0011744: Failure getting tag candidates on MSSQL
Affected Issues
0011744
mod - core/tag_api.php Diff File