Closed
Bug 158474
Opened 22 years ago
Closed 22 years ago
Abstract out GenerateSQL into perl module
Categories
(Bugzilla :: Query/Bug List, defect, P2)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.18
People
(Reporter: gerv, Assigned: gerv)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
The function GenerateSQL() in buglist.cgi turns a URL into an SQL query. This
ability is needed for both generic reporting (bug 12282) and generic charting
(bug 16009). The plan is to move this function into a perl module, Search.pm, so
this module can be used by all the CGIs which need this ability.
Assignee | ||
Comment 1•22 years ago
|
||
-> me.
Gerv
Assignee | ||
Comment 2•22 years ago
|
||
This patch transplants the code from buglist.cgi to the new module.
I have made very few changes to the code itself, in the interests of getting
this patch reviewed and checked in quickly, and not destabilising things. The
changes I have made to GenerateSQL() (now Search::init) are:
# Brought two helper functions used only by GenerateSQL into the module
# Added &:: to all the remaining global subroutines.
# Fixed error calls to use ThrowUserError/ThrowCodeError
# Removed commented-out "inject SQL" code
# Whitespace changes
Changes to buglist.cgi:
# Removed code which has gone to Search.pm
# Eliminated sillyness in favour of "use vars".
# Whitespace changes
Gerv
Comment 3•22 years ago
|
||
I've posted to reviewers@b.o about the naming convention for perl modules.
Comment 4•22 years ago
|
||
Comment on attachment 92098 [details] [diff] [review]
Patch v.1
Apart from the module naming issue, r=jouni. Let's wait for that to resolve
before checking this in.
Let's hope nothing breaks; the patch is fairly large and I might not have
trapped minor changes here and there... But I've tested it quite severely and
it seems to work fine.
Attachment #92098 -
Flags: review+
Assignee | ||
Comment 5•22 years ago
|
||
Is it really worth waiting for the naming issue to be resolved? Fixing it to
conform to what we decide is a three-liner.
Gerv
Comment 6•22 years ago
|
||
Moving files sucks with cvs.
Anyway, we decided on Bugzilla::Foo.pm, didn't we?
Assignee | ||
Comment 7•22 years ago
|
||
Uses new module naming convention.
Gerv
Attachment #92098 -
Attachment is obsolete: true
Assignee | ||
Comment 8•22 years ago
|
||
Working version of Patch v.2.
Gerv
Attachment #94681 -
Attachment is obsolete: true
Assignee | ||
Comment 9•22 years ago
|
||
Jouni gave this an r= conditional on package name, and louie also said he'd
looked at in in review bug 158486. Checked in.
Checking in buglist.cgi;
/cvsroot/mozilla/webtools/bugzilla/buglist.cgi,v <-- buglist.cgi
new revision: 1.188; previous revision: 1.187
done
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v
done
Checking in Bugzilla/Search.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v <-- Search.pm
initial revision: 1.1
done
Gerv
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 10•22 years ago
|
||
*** Bug 125798 has been marked as a duplicate of this bug. ***
Comment 11•22 years ago
|
||
You missed one:
Index: Search.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v
retrieving revision 1.1
diff -u -r1.1 Search.pm
--- Search.pm 9 Aug 2002 22:12:14 -0000 1.1
+++ Search.pm 10 Aug 2002 02:16:43 -0000
@@ -827,7 +827,7 @@
my $word = $w;
if ($word ne "") {
$word =~ tr/A-Z/a-z/;
- $word = SqlQuote(quotemeta($word));
+ $word = &::SqlQuote(quotemeta($word));
$word =~ s/^'//;
$word =~ s/'$//;
$word = '(^|[^a-z0-9])' . $word . '($|[^a-z0-9])';
Comment 12•22 years ago
|
||
... which I've checked in
Updated•12 years ago
|
QA Contact: matty_is_a_geek → default-qa
You need to log in
before you can comment on or make changes to this bug.
Description
•