Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0002006mantisbtsqlpublic2003-12-13 04:50
Reporterrcrespo Assigned Toaarjona  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
PlatformalphaOSFreeBSD/AlphaOS Version4.4-RELEASE
Product Version0.17.3 
Summary0002006: when searching and you type in a username you get a sql query error
Description

when searching and you type in a username into the search field it gives you a sql error.

Steps To Reproduce

login into mantis
go to the view bugs
type in the search field a username of a valid user on the system

Additional Information

ERROR: FAILED QUERY: SELECT COUNT( DISTINCT ( mantis_bug_table.id ) ) as count FROM mantis_bug_table, mantis_bug_text_table LEFT JOIN mantis_bugnote_table ON mantis_bugnote_table.bug_id = mantis_bug_table.id LEFT JOIN mantis_bugnote_text_table ON mantis_bugnote_text_table.id = mantis_bugnote_table.bugnote_text_id WHERE project_id='0000003' AND reporter_id='0000035' AND status<>'90' AND ((summary LIKE '%rcrespo%') OR (description LIKE '%rcrespo%') OR (steps_to_reproduce LIKE '%rcrespo%') OR (additional_information LIKE '%rcrespo%') OR (mantis_bug_table.id LIKE '%rcrespo%') OR (mantis_bugnote_text_table.note LIKE '%rcrespo%')) AND mantis_bug_text_table.id = mantis_bug_table.bug_text_id :
1052: Column: 'reporter_id' in where clause is ambiguous

TagsNo tags attached.

Relationships

has duplicate 0002003 closedprescience Searching with Viewer -> Updater Accounts Causes Error 
has duplicate 0002018 closedaarjona ERROR Screen when filtering 'Reporter' and 'Search'. 
has duplicate 0002027 closedaarjona Failed Query when entering search term and clicking 'Apply Filter' 
has duplicate 0002038 closedaarjona Usage of word 'quot' in Search field. 

Activities

aarjona

aarjona

2002-05-21 07:33

reporter   ~0002612

I tried it here and got no errors. May have to do with differences in MySQL versions.
A way to fix this might be use strictly the table_name.column_name format on all queries.

rcrespo

rcrespo

2002-05-21 07:35

reporter   ~0002613

here's my setup

mysql Ver 11.15 Distrib 3.23.42, for -freebsd4.4 (alpha)
Apache/1.3.20 (Unix) mod_perl/1.26 PHP/4.0.6

FreeBSD/Alpha 4.4-Release

aarjona

aarjona

2002-05-21 12:12

reporter   ~0002615

further observation reveals that this happens only with viewer, reporter and updater accounts.

I'll try to work out a fix tonight

rcrespo

rcrespo

2002-05-21 14:16

reporter   ~0002619

ive seen it happen with developer and administrator as well.

aarjona

aarjona

2002-05-21 14:24

reporter   ~0002620

just noticed that in my case the ambiguity was because of a different column (view_state). However I believe both symptoms are solved with the same fix.

Narcissus

Narcissus

2002-05-21 15:44

reporter   ~0002622

This is the same as Bug 0002003

prescience

prescience

2002-05-21 18:14

reporter   ~0002625

Go ahead and use the table qualifiers unless you find an easier fix.

aarjona

aarjona

2002-05-22 15:02

reporter   ~0002644

Last edited: 2002-05-27 14:36

fixed in CVS.

edited on: 05-27 14:36

updater

updater

2002-05-25 17:03

updater   ~0002674

if it's really fixed in cvs maybe the demo should be updated. i just got the error from bug 0002003 using the demo:

ERROR: FAILED QUERY: SELECT DISTINCT( mantis_bug_table.id ) as count FROM mantis_bug_table, mantis_bug_text_table LEFT JOIN mantis_bugnote_table ON mantis_bugnote_table.bug_id = mantis_bug_table.id LEFT JOIN mantis_bugnote_text_table ON mantis_bugnote_text_table.id = mantis_bugnote_table.bugnote_text_id WHERE project_id='0000002' AND (view_state='10' OR (view_state='50' AND reporter_id='0000006')) AND status<>'90' AND category='penguins' AND ((summary LIKE '%well%') OR (description LIKE '%well%') OR (steps_to_reproduce LIKE '%well%') OR (additional_information LIKE '%well%') OR (mantis_bug_table.id LIKE '%well%') OR (mantis_bugnote_text_table.note LIKE '%well%')) AND mantis_bug_text_table.id = mantis_bug_table.bug_text_id :
1052: Column: 'view_state' in where clause is ambiguous

aarjona

aarjona

2002-10-07 14:53

reporter   ~0003343

I don't think this is an isssue anymore