Closed Bug 282790 Opened 20 years ago Closed 20 years ago

Saving a search, using a name which gets truncated to an identical name already stored, causes bugzilla to report an error.

Categories

(Bugzilla :: Query/Bug List, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: nitroxico2, Assigned: LpSolit)

Details

Attachments

(1 file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461; SV1; .NET CLR 1.1.4322)
Build Identifier: 


If you try to add a long name as the saved search name, it truncates it.
Then if you try the same long name again, you will get the error message.
 
I presume the code checks the name as it was typed in, and not the truncated 
part, so it thinks its unique.
 
The error is that an entry exists with the same truncated name.


Reproducible: Always

Actual Results:  
Software error:
DBD::mysql::st execute failed: Duplicate entry '8-RESOLVED (FIXED in the past 
3 weeks) Release+ Comment contains L' for key 1 [for Statement "INSERT INTO 
namedqueries (userid, name, query, linkinfooter)
                     VALUES (8, 'RESOLVED (FIXED in the past 3 weeks) Release+ 
Comment contains 
LBT_8_0_FIXES', 'query_format=advanced&short_desc_type=allwordssubstr&short_des
c=&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_fil
e_loc=&status_whiteboard_type=allwordssubstr&status_whiteboard=&keywords_type=a
llwords&keywords=&bug_status=RESOLVED&resolution=FIXED&emailassigned_to1=1&emai
ltype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailt
ype2=substring&email2=&bugidtype=include&bug_id=&chfieldfrom=3w&chfieldto=Now&c
hfield=resolution&chfieldvalue=FIXED&field0-0-0=longdesc&type0-0-
0=substring&value0-0-0=LBT_8_0_FIXES&field1-0-0=flagtypes.name&type1-0-
0=substring&value1-0-0=Release%2B', 1)"] at Bugzilla/DB.pm line 62
	Bugzilla::DB::SendSQL('INSERT INTO namedqueries (userid, name, query, 
linkinfooter)\x{a}...') called at C:/tools/wwwroot/casemgr/buglist.cgi line 396
Attached patch patch, v1Splinter Review
limit the query name to 64 characters.
Assignee: query-and-buglist → LpSolit
Status: UNCONFIRMED → ASSIGNED
Attachment #174755 - Flags: review?(mkanat)
OS: Windows XP → All
Hardware: PC → All
Target Milestone: --- → Bugzilla 2.20
Comment on attachment 174755 [details] [diff] [review]
patch, v1

OK. It looks good, but I don't like the magic numbers.

If we (or an admin, locally) ever changes the allowable size of a query name,
then we have to magically know that this code is here and remember to fix it.
Attachment #174755 - Flags: review?(mkanat) → review+
Flags: approval?
We should really do a max length on the input field in the template as well,
save them the trouble of needing to get an error.  But a=justdave on the
existing patch, you can file a separate bug for that if you want.  The a= here
can be brought forward if you update it to include the template though.
Flags: approval? → approval+
checked in for lpsolit
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: