Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#2445 closed defect (fixed)

Ticket search breaks with NULL values

Reported by: ErikRose Owned by: Jonas Borgström
Priority: normal Milestone: 0.10
Component: search system Version: 0.9
Severity: major Keywords:
Cc: psucorp@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Searches often fail to find tickets which have any of these fields set to NULL in the ticket table:

  • summary
  • keywords
  • description
  • reporter
  • cc

This is because the SQL is first concatenating all those fields and then running a LIKE against them. Trac 0.8.4 did this right. I'll attach patch in a moment that restores correct behavior.

Incidentally, this also fixes a bug which can result in false positives during search, as "fake" words are generated at field boundaries by the concatenation.

Attachments (1)

patchFor2445.patch (1020 bytes ) - added by ErikRose 18 years ago.

Download all attachments as: .zip

Change History (7)

by ErikRose, 18 years ago

Attachment: patchFor2445.patch added

comment:1 by ErikRose, 18 years ago

Component: ticket systemsearch system

Wikis and changesets share the second bug (the false positives): source:trunk/trac/versioncontrol/web_ui/changeset.py@2599 at line 389 and source:trunk/trac/wiki/web_ui.py@2599 at line 396.

comment:2 by anonymous, 18 years ago

I didn't check into it in depth, but it looks like, as of 0.9.0, Trac doesn't put NULLs in the DB anymore (which is good). My DB has NULLs because it was upgraded from 0.8.4. Do you think the DB upgrade script should be fixed to expunge NULLs? It would lower entropy….

comment:3 by Gunnar Wagenknecht <gunnar@…>, 18 years ago

Cc: gunnar@… added

If the code doesn't insert NULL anymore then the update script should update the database content to reflect the new code.

Should the database fields be created with "NOT NULL"?

comment:4 by ErikRose, 18 years ago

Cc: psucorp@… added

(Btw, the anonymous comment of 12/05 is mine: I don't think NULLs get inserted anymore.)

Yes, let's make it NOT NULL; it wouldn't hurt. My copy of SQLite 2.8.16 supports and enforces NOT NULL constraints.

comment:5 by Matthew Good, 18 years ago

Milestone: 0.10
Resolution: fixed
Status: newclosed

[2940] eliminated the use of concatenating the fields for the search, so this should be fixed.

comment:6 by anonymous, 18 years ago

Cc: gunnar@… removed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.