#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)
Change History (7)
by , 19 years ago
Attachment: | patchFor2445.patch added |
---|
comment:1 by , 19 years ago
Component: | ticket system → search system |
---|
comment:2 by , 19 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 , 19 years ago
Cc: | 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 , 19 years ago
Cc: | 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 , 18 years ago
Milestone: | → 0.10 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
[2940] eliminated the use of concatenating the fields for the search, so this should be fixed.
comment:6 by , 18 years ago
Cc: | removed |
---|
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.